1 /** Copyright Joyent, Inc. and other Node contributors. 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining a 4 * copy of this software and associated documentation files (the 5 * "Software"), to deal in the Software without restriction, including 6 * without limitation the rights to use, copy, modify, merge, publish, 7 * distribute, sublicense, and/or sell copies of the Software, and to permit 8 * persons to whom the Software is furnished to do so, subject to the 9 * following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 * USE OR OTHER DEALINGS IN THE SOFTWARE. 21 */ 22 23 /* 24 * This header defines short names for V8 constants for use by the ustack 25 * helper. 26 */ 27 28 #ifndef SRC_V8ABBR_H_ 29 #define SRC_V8ABBR_H_ 30 31 /* Frame pointer offsets */ 32 #define V8_OFF_FP_FUNC V8DBG_OFF_FP_FUNCTION 33 #define V8_OFF_FP_CONTEXT V8DBG_OFF_FP_CONTEXT 34 #define V8_OFF_FP_MARKER V8DBG_OFF_FP_MARKER 35 36 /* Stack frame types */ 37 #define V8_FT_ENTRY V8DBG_FRAMETYPE_ENTRYFRAME 38 #define V8_FT_ENTRYCONSTRUCT V8DBG_FRAMETYPE_CONSTRUCTENTRYFRAME 39 #define V8_FT_EXIT V8DBG_FRAMETYPE_EXITFRAME 40 #define V8_FT_JAVASCRIPT V8DBG_FRAMETYPE_JAVASCRIPTFRAME 41 #define V8_FT_OPTIMIZED V8DBG_FRAMETYPE_OPTIMIZEDFRAME 42 #define V8_FT_INTERNAL V8DBG_FRAMETYPE_INTERNALFRAME 43 #define V8_FT_CONSTRUCT V8DBG_FRAMETYPE_CONSTRUCTFRAME 44 #define V8_FT_STUB V8DBG_FRAMETYPE_STUBFRAME 45 46 /* Identification masks and tags */ 47 #define V8_SmiTagMask (V8DBG_SMITAGMASK) 48 #define V8_SmiTag (V8DBG_SMITAG) 49 #define V8_SmiValueShift (V8DBG_SMISHIFTSIZE + V8DBG_SMITAGMASK) 50 51 #define V8_HeapObjectTagMask V8DBG_HEAPOBJECTTAGMASK 52 #define V8_HeapObjectTag V8DBG_HEAPOBJECTTAG 53 54 #define V8_IsNotStringMask V8DBG_ISNOTSTRINGMASK 55 #define V8_StringTag V8DBG_STRINGTAG 56 57 #define V8_StringEncodingMask V8DBG_STRINGENCODINGMASK 58 #define V8_AsciiStringTag V8DBG_ONEBYTESTRINGTAG 59 60 #define V8_StringRepresentationMask V8DBG_STRINGREPRESENTATIONMASK 61 #define V8_SeqStringTag V8DBG_SEQSTRINGTAG 62 #define V8_ConsStringTag V8DBG_CONSSTRINGTAG 63 #define V8_ExternalStringTag V8DBG_EXTERNALSTRINGTAG 64 65 /* Instance types */ 66 #define V8_IT_FIXEDARRAY V8DBG_TYPE_FIXEDARRAY__FIXED_ARRAY_TYPE 67 #define V8_IT_CODE V8DBG_TYPE_CODE__CODE_TYPE 68 #define V8_IT_SCRIPT V8DBG_TYPE_SCRIPT__SCRIPT_TYPE 69 70 /* Node-specific offsets */ 71 #define NODE_OFF_EXTSTR_DATA sizeof(void*) 72 73 /* 74 * Not all versions of V8 have the offset for the "chars" array in the 75 * SeqTwoByteString class, but it's the same as the one for SeqOneByteString. 76 */ 77 #ifndef V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR 78 #define V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR \ 79 V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR 80 #endif 81 82 /* Heap class->field offsets */ 83 #define V8_OFF_HEAP(off) ((off) - 1) 84 85 #define V8_OFF_FUNC_SHARED \ 86 V8_OFF_HEAP(V8DBG_CLASS_JSFUNCTION__SHARED__SHAREDFUNCTIONINFO) 87 #define V8_OFF_RAW_NAME \ 88 V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) 89 #define V8_OFF_SHARED_IDENT \ 90 V8_OFF_HEAP( \ 91 V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) 92 #define V8_OFF_SHARED_SCRIPT \ 93 V8_OFF_HEAP( \ 94 V8DBG_CLASS_SHAREDFUNCTIONINFO__SCRIPT_OR_DEBUG_INFO__HEAPOBJECT) 95 #define V8_OFF_SHARED_FUNIDENT \ 96 V8_OFF_HEAP( \ 97 V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) 98 #define V8_OFF_SCRIPT_NAME \ 99 V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__NAME__OBJECT) 100 #define V8_OFF_SCRIPT_LENDS \ 101 V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__LINE_ENDS__OBJECT) 102 #define V8_OFF_STR_LENGTH \ 103 V8_OFF_HEAP(V8DBG_CLASS_STRING__LENGTH__INT32_T) 104 #define V8_OFF_STR_CHARS \ 105 V8_OFF_HEAP(V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR) 106 #define V8_OFF_CONSSTR_CAR \ 107 V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__FIRST__STRING) 108 #define V8_OFF_CONSSTR_CDR \ 109 V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__SECOND__STRING) 110 #define V8_OFF_EXTSTR_RSRC \ 111 V8_OFF_HEAP(V8DBG_CLASS_EXTERNALSTRING__RESOURCE__OBJECT) 112 #define V8_OFF_FA_SIZE \ 113 V8_OFF_HEAP(V8DBG_CLASS_FIXEDARRAYBASE__LENGTH__SMI) 114 #define V8_OFF_FA_DATA \ 115 V8_OFF_HEAP(V8DBG_CLASS_FIXEDARRAY__DATA__UINTPTR_T) 116 #define V8_OFF_HEAPOBJ_MAP \ 117 V8_OFF_HEAP(V8DBG_CLASS_HEAPOBJECT__MAP__MAP) 118 #define V8_OFF_MAP_ATTRS \ 119 V8_OFF_HEAP(V8DBG_CLASS_MAP__INSTANCE_TYPE__UINT16_T) 120 #define V8_OFF_TWOBYTESTR_CHARS \ 121 V8_OFF_HEAP(V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR) 122 123 #endif /* SRC_V8ABBR_H_ */ 124