Commit 2619ccd1 authored by julien.gilli's avatar julien.gilli Committed by Commit bot

Move post-mortem constants from accessors table to constants table

Some post-mortem metadata constants that are not offsets to objects'
properties were incorrectly defined in the accessors table. This change
fixes it by moving them from the accessors table to the constants table.

More background is available at
https://github.com/nodejs/post-mortem/issues/27.

R=danno@chromium.org,bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2051563003
Cr-Commit-Position: refs/heads/master@{#36878}
parent 7dde77ac
......@@ -50,7 +50,8 @@ import re
import sys
#
# Miscellaneous constants, tags, and masks used for object identification.
# Miscellaneous constants such as tags and masks used for object identification,
# enumeration values used as indexes in internal tables, etc..
#
consts_misc = [
{ 'name': 'FirstNonstringType', 'value': 'FIRST_NONSTRING_TYPE' },
......@@ -181,17 +182,46 @@ consts_misc = [
'value': 'JSArrayBuffer::WasNeutered::kMask' },
{ 'name': 'jsarray_buffer_was_neutered_shift',
'value': 'JSArrayBuffer::WasNeutered::kShift' },
{ 'name': 'context_idx_closure',
'value': 'Context::CLOSURE_INDEX' },
{ 'name': 'context_idx_native',
'value': 'Context::NATIVE_CONTEXT_INDEX' },
{ 'name': 'context_idx_prev',
'value': 'Context::PREVIOUS_INDEX' },
{ 'name': 'context_idx_ext',
'value': 'Context::EXTENSION_INDEX' },
{ 'name': 'context_min_slots',
'value': 'Context::MIN_CONTEXT_SLOTS' },
{ 'name': 'namedictionaryshape_prefix_size',
'value': 'NameDictionaryShape::kPrefixSize' },
{ 'name': 'namedictionaryshape_entry_size',
'value': 'NameDictionaryShape::kEntrySize' },
{ 'name': 'namedictionary_prefix_start_index',
'value': 'NameDictionary::kPrefixStartIndex' },
{ 'name': 'seedednumberdictionaryshape_prefix_size',
'value': 'SeededNumberDictionaryShape::kPrefixSize' },
{ 'name': 'unseedednumberdictionaryshape_prefix_size',
'value': 'UnseededNumberDictionaryShape::kPrefixSize' },
{ 'name': 'numberdictionaryshape_entry_size',
'value': 'NumberDictionaryShape::kEntrySize' }
];
#
# The following useful fields are missing accessors, so we define fake ones.
# Please note that extra accessors should _only_ be added to expose offsets that
# can be used to access actual V8 objects' properties. They should not be added
# for exposing other values. For instance, enumeration values or class'
# constants should be exposed by adding an entry in the "consts_misc" table, not
# in this "extras_accessors" table.
#
extras_accessors = [
'JSFunction, context, Context, kContextOffset',
'Context, closure_index, int, CLOSURE_INDEX',
'Context, native_context_index, int, NATIVE_CONTEXT_INDEX',
'Context, previous_index, int, PREVIOUS_INDEX',
'Context, min_context_slots, int, MIN_CONTEXT_SLOTS',
'HeapObject, map, Map, kMapOffset',
'JSObject, elements, Object, kElementsOffset',
'FixedArray, data, uintptr_t, kHeaderSize',
......@@ -205,12 +235,6 @@ extras_accessors = [
'Map, bit_field2, char, kBitField2Offset',
'Map, bit_field3, int, kBitField3Offset',
'Map, prototype, Object, kPrototypeOffset',
'NameDictionaryShape, prefix_size, int, kPrefixSize',
'NameDictionaryShape, entry_size, int, kEntrySize',
'NameDictionary, prefix_start_index, int, kPrefixStartIndex',
'SeededNumberDictionaryShape, prefix_size, int, kPrefixSize',
'UnseededNumberDictionaryShape, prefix_size, int, kPrefixSize',
'NumberDictionaryShape, entry_size, int, kEntrySize',
'Oddball, kind_offset, int, kKindOffset',
'HeapNumber, value, double, kValueOffset',
'ConsString, first, String, kFirstOffset',
......@@ -254,6 +278,7 @@ header = '''
#include "src/v8.h"
#include "src/frames.h"
#include "src/frames-inl.h" /* for architecture-specific frame constants */
#include "src/contexts.h"
using namespace v8::internal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment