The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.
Please select the desired protocol below to get the URL.
This URL has Read-Only access.
main_repo / deps / mdb_v8 / v8dbg.h @ e851fef6
History | View | Annotate | Download (3.04 KB)
1 |
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
---|---|
2 |
*
|
3 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
* of this software and associated documentation files (the "Software"), to
|
5 |
* deal in the Software without restriction, including without limitation the
|
6 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7 |
* sell copies of the Software, and to permit persons to whom the Software is
|
8 |
* furnished to do so, subject to the following conditions:
|
9 |
*
|
10 |
* The above copyright notice and this permission notice shall be included in
|
11 |
* all copies or substantial portions of the Software.
|
12 |
*
|
13 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
18 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
19 |
* IN THE SOFTWARE.
|
20 |
*/
|
21 |
|
22 |
/*
|
23 |
* v8dbg.h: macros for use by V8 heap inspection tools. The consumer must
|
24 |
* define values for various tags and shifts. The MDB module gets these
|
25 |
* constants from information encoded in the binary itself.
|
26 |
*/
|
27 |
|
28 |
#ifndef _V8DBG_H
|
29 |
#define _V8DBG_H
|
30 |
|
31 |
/*
|
32 |
* Recall that while V8 heap objects are always 4-byte aligned, heap object
|
33 |
* pointers always have the last bit set. So when looking for a field nominally
|
34 |
* at offset X, one must be sure to clear the tag bit first.
|
35 |
*/
|
36 |
#define V8_OFF_HEAP(x) ((x) - V8_HeapObjectTag)
|
37 |
|
38 |
/*
|
39 |
* Determine whether a given pointer refers to a SMI, Failure, or HeapObject.
|
40 |
*/
|
41 |
#define V8_IS_SMI(ptr) (((ptr) & V8_SmiTagMask) == V8_SmiTag)
|
42 |
#define V8_IS_FAILURE(ptr) (((ptr) & V8_FailureTagMask) == V8_FailureTag)
|
43 |
#define V8_IS_HEAPOBJECT(ptr) \
|
44 |
(((ptr) & V8_HeapObjectTagMask) == V8_HeapObjectTag) |
45 |
|
46 |
/*
|
47 |
* Extract the value of a SMI "pointer". Recall that small integers are stored
|
48 |
* using the upper 31 bits.
|
49 |
*/
|
50 |
#define V8_SMI_VALUE(smi) ((smi) >> (V8_SmiValueShift + V8_SmiShiftSize))
|
51 |
|
52 |
/*
|
53 |
* Determine the encoding and representation of a V8 string.
|
54 |
*/
|
55 |
#define V8_TYPE_STRING(type) (((type) & V8_IsNotStringMask) == V8_StringTag)
|
56 |
|
57 |
#define V8_STRENC_ASCII(type) \
|
58 |
(((type) & V8_StringEncodingMask) == V8_AsciiStringTag) |
59 |
|
60 |
#define V8_STRREP_SEQ(type) \
|
61 |
(((type) & V8_StringRepresentationMask) == V8_SeqStringTag) |
62 |
#define V8_STRREP_CONS(type) \
|
63 |
(((type) & V8_StringRepresentationMask) == V8_ConsStringTag) |
64 |
#define V8_STRREP_EXT(type) \
|
65 |
(((type) & V8_StringRepresentationMask) == V8_ExternalStringTag) |
66 |
|
67 |
/*
|
68 |
* Several of the following constants and transformations are hardcoded in V8 as
|
69 |
* well, so there's no way to extract them programmatically from the binary.
|
70 |
*/
|
71 |
#define V8_DESC_KEYIDX(x) ((x) + V8_PROP_IDX_FIRST)
|
72 |
#define V8_DESC_VALIDX(x) ((x) << 1) |
73 |
#define V8_DESC_DETIDX(x) (((x) << 1) + 1) |
74 |
|
75 |
#define V8_DESC_ISFIELD(x) \
|
76 |
((V8_SMI_VALUE(x) & V8_PROP_TYPE_MASK) == V8_PROP_TYPE_FIELD) |
77 |
|
78 |
#endif /* _V8DBG_H */ |