| Index: src/objects.h
|
| ===================================================================
|
| --- src/objects.h (revision 6800)
|
| +++ src/objects.h (working copy)
|
| @@ -54,7 +54,8 @@
|
| // - JSGlobalObject
|
| // - JSBuiltinsObject
|
| // - JSGlobalProxy
|
| -// - JSValue
|
| +// - JSValue
|
| +// - JSMessageObject
|
| // - ByteArray
|
| // - PixelArray
|
| // - ExternalArray
|
| @@ -288,6 +289,8 @@
|
| V(FIXED_ARRAY_TYPE) \
|
| V(SHARED_FUNCTION_INFO_TYPE) \
|
| \
|
| + V(JS_MESSAGE_OBJECT_TYPE) \
|
| + \
|
| V(JS_VALUE_TYPE) \
|
| V(JS_OBJECT_TYPE) \
|
| V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
|
| @@ -455,6 +458,7 @@
|
|
|
| enum InstanceType {
|
| // String types.
|
| + // FIRST_STRING_TYPE
|
| SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kSeqStringTag,
|
| ASCII_SYMBOL_TYPE = kAsciiStringTag | kSymbolTag | kSeqStringTag,
|
| CONS_SYMBOL_TYPE = kTwoByteStringTag | kSymbolTag | kConsStringTag,
|
| @@ -471,6 +475,7 @@
|
| EXTERNAL_STRING_TYPE = kTwoByteStringTag | kExternalStringTag,
|
| EXTERNAL_STRING_WITH_ASCII_DATA_TYPE =
|
| kTwoByteStringTag | kExternalStringTag | kAsciiDataHintTag,
|
| + // LAST_STRING_TYPE
|
| EXTERNAL_ASCII_STRING_TYPE = kAsciiStringTag | kExternalStringTag,
|
| PRIVATE_EXTERNAL_ASCII_STRING_TYPE = EXTERNAL_ASCII_STRING_TYPE,
|
|
|
| @@ -516,6 +521,8 @@
|
| FIXED_ARRAY_TYPE,
|
| SHARED_FUNCTION_INFO_TYPE,
|
|
|
| + JS_MESSAGE_OBJECT_TYPE,
|
| +
|
| JS_VALUE_TYPE, // FIRST_JS_OBJECT_TYPE
|
| JS_OBJECT_TYPE,
|
| JS_CONTEXT_EXTENSION_OBJECT_TYPE,
|
| @@ -523,8 +530,9 @@
|
| JS_BUILTINS_OBJECT_TYPE,
|
| JS_GLOBAL_PROXY_TYPE,
|
| JS_ARRAY_TYPE,
|
| - JS_REGEXP_TYPE, // LAST_JS_OBJECT_TYPE
|
|
|
| + JS_REGEXP_TYPE, // LAST_JS_OBJECT_TYPE, FIRST_FUNCTION_CLASS_TYPE
|
| +
|
| JS_FUNCTION_TYPE,
|
|
|
| // Pseudo-types
|
| @@ -532,6 +540,8 @@
|
| LAST_TYPE = JS_FUNCTION_TYPE,
|
| INVALID_TYPE = FIRST_TYPE - 1,
|
| FIRST_NONSTRING_TYPE = MAP_TYPE,
|
| + FIRST_STRING_TYPE = FIRST_TYPE,
|
| + LAST_STRING_TYPE = FIRST_NONSTRING_TYPE - 1,
|
| // Boundaries for testing for an external array.
|
| FIRST_EXTERNAL_ARRAY_TYPE = EXTERNAL_BYTE_ARRAY_TYPE,
|
| LAST_EXTERNAL_ARRAY_TYPE = EXTERNAL_FLOAT_ARRAY_TYPE,
|
| @@ -541,7 +551,10 @@
|
| // function objects are not counted as objects, even though they are
|
| // implemented as such; only values whose typeof is "object" are included.
|
| FIRST_JS_OBJECT_TYPE = JS_VALUE_TYPE,
|
| - LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE
|
| + LAST_JS_OBJECT_TYPE = JS_REGEXP_TYPE,
|
| + // RegExp objects have [[Class]] "function" because they are callable.
|
| + // All types from this type and above are objects with [[Class]] "function".
|
| + FIRST_FUNCTION_CLASS_TYPE = JS_REGEXP_TYPE
|
| };
|
|
|
|
|
| @@ -624,6 +637,72 @@
|
| #endif
|
| };
|
|
|
| +
|
| +#define OBJECT_TYPE_LIST(V) \
|
| + V(Smi) \
|
| + V(HeapObject) \
|
| + V(Number) \
|
| +
|
| +#define HEAP_OBJECT_TYPE_LIST(V) \
|
| + V(HeapNumber) \
|
| + V(String) \
|
| + V(Symbol) \
|
| + V(SeqString) \
|
| + V(ExternalString) \
|
| + V(ConsString) \
|
| + V(ExternalTwoByteString) \
|
| + V(ExternalAsciiString) \
|
| + V(SeqTwoByteString) \
|
| + V(SeqAsciiString) \
|
| + \
|
| + V(PixelArray) \
|
| + V(ExternalArray) \
|
| + V(ExternalByteArray) \
|
| + V(ExternalUnsignedByteArray) \
|
| + V(ExternalShortArray) \
|
| + V(ExternalUnsignedShortArray) \
|
| + V(ExternalIntArray) \
|
| + V(ExternalUnsignedIntArray) \
|
| + V(ExternalFloatArray) \
|
| + V(ByteArray) \
|
| + V(JSObject) \
|
| + V(JSContextExtensionObject) \
|
| + V(Map) \
|
| + V(DescriptorArray) \
|
| + V(DeoptimizationInputData) \
|
| + V(DeoptimizationOutputData) \
|
| + V(FixedArray) \
|
| + V(Context) \
|
| + V(CatchContext) \
|
| + V(GlobalContext) \
|
| + V(JSFunction) \
|
| + V(Code) \
|
| + V(Oddball) \
|
| + V(SharedFunctionInfo) \
|
| + V(JSValue) \
|
| + V(JSMessageObject) \
|
| + V(StringWrapper) \
|
| + V(Proxy) \
|
| + V(Boolean) \
|
| + V(JSArray) \
|
| + V(JSRegExp) \
|
| + V(HashTable) \
|
| + V(Dictionary) \
|
| + V(SymbolTable) \
|
| + V(JSFunctionResultCache) \
|
| + V(NormalizedMapCache) \
|
| + V(CompilationCacheTable) \
|
| + V(CodeCacheHashTable) \
|
| + V(MapCache) \
|
| + V(Primitive) \
|
| + V(GlobalObject) \
|
| + V(JSGlobalObject) \
|
| + V(JSBuiltinsObject) \
|
| + V(JSGlobalProxy) \
|
| + V(UndetectableObject) \
|
| + V(AccessCheckNeeded) \
|
| + V(JSGlobalPropertyCell) \
|
| +
|
| // Object is the abstract superclass for all classes in the
|
| // object hierarchy.
|
| // Object does not use any virtual functions to avoid the
|
| @@ -633,68 +712,11 @@
|
| class Object : public MaybeObject {
|
| public:
|
| // Type testing.
|
| - inline bool IsSmi();
|
| - inline bool IsHeapObject();
|
| - inline bool IsHeapNumber();
|
| - inline bool IsString();
|
| - inline bool IsSymbol();
|
| - // See objects-inl.h for more details
|
| - inline bool IsSeqString();
|
| - inline bool IsExternalString();
|
| - inline bool IsExternalTwoByteString();
|
| - inline bool IsExternalAsciiString();
|
| - inline bool IsSeqTwoByteString();
|
| - inline bool IsSeqAsciiString();
|
| - inline bool IsConsString();
|
| +#define IS_TYPE_FUNCTION_DECL(type_) inline bool Is##type_();
|
| + OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL)
|
| + HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL)
|
| +#undef IS_TYPE_FUNCTION_DECL
|
|
|
| - inline bool IsNumber();
|
| - inline bool IsByteArray();
|
| - inline bool IsPixelArray();
|
| - inline bool IsExternalArray();
|
| - inline bool IsExternalByteArray();
|
| - inline bool IsExternalUnsignedByteArray();
|
| - inline bool IsExternalShortArray();
|
| - inline bool IsExternalUnsignedShortArray();
|
| - inline bool IsExternalIntArray();
|
| - inline bool IsExternalUnsignedIntArray();
|
| - inline bool IsExternalFloatArray();
|
| - inline bool IsJSObject();
|
| - inline bool IsJSContextExtensionObject();
|
| - inline bool IsMap();
|
| - inline bool IsFixedArray();
|
| - inline bool IsDescriptorArray();
|
| - inline bool IsDeoptimizationInputData();
|
| - inline bool IsDeoptimizationOutputData();
|
| - inline bool IsContext();
|
| - inline bool IsCatchContext();
|
| - inline bool IsGlobalContext();
|
| - inline bool IsJSFunction();
|
| - inline bool IsCode();
|
| - inline bool IsOddball();
|
| - inline bool IsSharedFunctionInfo();
|
| - inline bool IsJSValue();
|
| - inline bool IsStringWrapper();
|
| - inline bool IsProxy();
|
| - inline bool IsBoolean();
|
| - inline bool IsJSArray();
|
| - inline bool IsJSRegExp();
|
| - inline bool IsHashTable();
|
| - inline bool IsDictionary();
|
| - inline bool IsSymbolTable();
|
| - inline bool IsJSFunctionResultCache();
|
| - inline bool IsNormalizedMapCache();
|
| - inline bool IsCompilationCacheTable();
|
| - inline bool IsCodeCacheHashTable();
|
| - inline bool IsMapCache();
|
| - inline bool IsPrimitive();
|
| - inline bool IsGlobalObject();
|
| - inline bool IsJSGlobalObject();
|
| - inline bool IsJSBuiltinsObject();
|
| - inline bool IsJSGlobalProxy();
|
| - inline bool IsUndetectableObject();
|
| - inline bool IsAccessCheckNeeded();
|
| - inline bool IsJSGlobalPropertyCell();
|
| -
|
| // Returns true if this object is an instance of the specified
|
| // function template.
|
| inline bool IsInstanceOf(FunctionTemplateInfo* type);
|
| @@ -709,6 +731,7 @@
|
| INLINE(bool IsNull());
|
| INLINE(bool IsTrue());
|
| INLINE(bool IsFalse());
|
| + inline bool IsArgumentsMarker();
|
|
|
| // Extract the number.
|
| inline double Number();
|
| @@ -1164,7 +1187,12 @@
|
| // caching.
|
| class JSObject: public HeapObject {
|
| public:
|
| - enum DeleteMode { NORMAL_DELETION, FORCE_DELETION };
|
| + enum DeleteMode {
|
| + NORMAL_DELETION,
|
| + STRICT_DELETION,
|
| + FORCE_DELETION
|
| + };
|
| +
|
| enum ElementsKind {
|
| // The only "fast" kind.
|
| FAST_ELEMENTS,
|
| @@ -1242,7 +1270,8 @@
|
| MUST_USE_RESULT MaybeObject* SetPropertyWithFailedAccessCheck(
|
| LookupResult* result,
|
| String* name,
|
| - Object* value);
|
| + Object* value,
|
| + bool check_prototype);
|
| MUST_USE_RESULT MaybeObject* SetPropertyWithCallback(Object* structure,
|
| String* name,
|
| Object* value,
|
| @@ -1257,7 +1286,7 @@
|
| String* name,
|
| Object* value,
|
| PropertyAttributes attributes);
|
| - MUST_USE_RESULT MaybeObject* IgnoreAttributesAndSetLocalProperty(
|
| + MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes(
|
| String* key,
|
| Object* value,
|
| PropertyAttributes attributes);
|
| @@ -1456,7 +1485,8 @@
|
| void LookupRealNamedProperty(String* name, LookupResult* result);
|
| void LookupRealNamedPropertyInPrototypes(String* name, LookupResult* result);
|
| void LookupCallbackSetterInPrototypes(String* name, LookupResult* result);
|
| - bool SetElementWithCallbackSetterInPrototypes(uint32_t index, Object* value);
|
| + MUST_USE_RESULT MaybeObject* SetElementWithCallbackSetterInPrototypes(
|
| + uint32_t index, Object* value, bool* found);
|
| void LookupCallback(String* name, LookupResult* result);
|
|
|
| // Returns the number of properties on this object filtering out properties
|
| @@ -2512,6 +2542,11 @@
|
| inline void MakeZeroSize();
|
| inline void Clear();
|
|
|
| + inline int size();
|
| + inline void set_size(int size);
|
| + inline int finger_index();
|
| + inline void set_finger_index(int finger_index);
|
| +
|
| // Casting
|
| static inline JSFunctionResultCache* cast(Object* obj);
|
|
|
| @@ -3020,6 +3055,9 @@
|
| };
|
|
|
|
|
| +class SafepointEntry;
|
| +
|
| +
|
| // Code describes objects with on-the-fly generated machine code.
|
| class Code: public HeapObject {
|
| public:
|
| @@ -3059,11 +3097,16 @@
|
| NUMBER_OF_KINDS = LAST_IC_KIND + 1
|
| };
|
|
|
| + typedef int ExtraICState;
|
| +
|
| + static const ExtraICState kNoExtraICState = 0;
|
| +
|
| #ifdef ENABLE_DISASSEMBLER
|
| // Printing
|
| static const char* Kind2String(Kind kind);
|
| static const char* ICState2String(InlineCacheState state);
|
| static const char* PropertyType2String(PropertyType type);
|
| + static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra);
|
| inline void Disassemble(const char* name) {
|
| Disassemble(name, stdout);
|
| }
|
| @@ -3094,6 +3137,7 @@
|
| // [flags]: Access to specific code flags.
|
| inline Kind kind();
|
| inline InlineCacheState ic_state(); // Only valid for IC stubs.
|
| + inline ExtraICState extra_ic_state(); // Only valid for IC stubs.
|
| inline InLoopFlag ic_in_loop(); // Only valid for IC stubs.
|
| inline PropertyType type(); // Only valid for monomorphic IC stubs.
|
| inline int arguments_count(); // Only valid for call IC stubs.
|
| @@ -3139,13 +3183,13 @@
|
|
|
| // [safepoint_table_start]: For kind OPTIMIZED_CODE, the offset in
|
| // the instruction stream where the safepoint table starts.
|
| - inline unsigned safepoint_table_start();
|
| - inline void set_safepoint_table_start(unsigned offset);
|
| + inline unsigned safepoint_table_offset();
|
| + inline void set_safepoint_table_offset(unsigned offset);
|
|
|
| // [stack_check_table_start]: For kind FUNCTION, the offset in the
|
| // instruction stream where the stack check table starts.
|
| - inline unsigned stack_check_table_start();
|
| - inline void set_stack_check_table_start(unsigned offset);
|
| + inline unsigned stack_check_table_offset();
|
| + inline void set_stack_check_table_offset(unsigned offset);
|
|
|
| // [check type]: For kind CALL_IC, tells how to check if the
|
| // receiver is valid for the given call.
|
| @@ -3167,9 +3211,8 @@
|
| inline byte compare_state();
|
| inline void set_compare_state(byte value);
|
|
|
| - // Get the safepoint entry for the given pc. Returns NULL for
|
| - // non-safepoint pcs.
|
| - uint8_t* GetSafepointEntry(Address pc);
|
| + // Get the safepoint entry for the given pc.
|
| + SafepointEntry GetSafepointEntry(Address pc);
|
|
|
| // Mark this code object as not having a stack check table. Assumes kind
|
| // is FUNCTION.
|
| @@ -3179,22 +3222,26 @@
|
| Map* FindFirstMap();
|
|
|
| // Flags operations.
|
| - static inline Flags ComputeFlags(Kind kind,
|
| - InLoopFlag in_loop = NOT_IN_LOOP,
|
| - InlineCacheState ic_state = UNINITIALIZED,
|
| - PropertyType type = NORMAL,
|
| - int argc = -1,
|
| - InlineCacheHolderFlag holder = OWN_MAP);
|
| + static inline Flags ComputeFlags(
|
| + Kind kind,
|
| + InLoopFlag in_loop = NOT_IN_LOOP,
|
| + InlineCacheState ic_state = UNINITIALIZED,
|
| + ExtraICState extra_ic_state = kNoExtraICState,
|
| + PropertyType type = NORMAL,
|
| + int argc = -1,
|
| + InlineCacheHolderFlag holder = OWN_MAP);
|
|
|
| static inline Flags ComputeMonomorphicFlags(
|
| Kind kind,
|
| PropertyType type,
|
| + ExtraICState extra_ic_state = kNoExtraICState,
|
| InlineCacheHolderFlag holder = OWN_MAP,
|
| InLoopFlag in_loop = NOT_IN_LOOP,
|
| int argc = -1);
|
|
|
| static inline Kind ExtractKindFromFlags(Flags flags);
|
| static inline InlineCacheState ExtractICStateFromFlags(Flags flags);
|
| + static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags);
|
| static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags);
|
| static inline PropertyType ExtractTypeFromFlags(Flags flags);
|
| static inline int ExtractArgumentsCountFromFlags(Flags flags);
|
| @@ -3306,8 +3353,8 @@
|
| static const int kAllowOSRAtLoopNestingLevelOffset =
|
| kHasDeoptimizationSupportOffset + 1;
|
|
|
| - static const int kSafepointTableStartOffset = kStackSlotsOffset + kIntSize;
|
| - static const int kStackCheckTableStartOffset = kStackSlotsOffset + kIntSize;
|
| + static const int kSafepointTableOffsetOffset = kStackSlotsOffset + kIntSize;
|
| + static const int kStackCheckTableOffsetOffset = kStackSlotsOffset + kIntSize;
|
|
|
| // Flags layout.
|
| static const int kFlagsICStateShift = 0;
|
| @@ -3315,14 +3362,16 @@
|
| static const int kFlagsTypeShift = 4;
|
| static const int kFlagsKindShift = 7;
|
| static const int kFlagsICHolderShift = 11;
|
| - static const int kFlagsArgumentsCountShift = 12;
|
| + static const int kFlagsExtraICStateShift = 12;
|
| + static const int kFlagsArgumentsCountShift = 14;
|
|
|
| static const int kFlagsICStateMask = 0x00000007; // 00000000111
|
| static const int kFlagsICInLoopMask = 0x00000008; // 00000001000
|
| static const int kFlagsTypeMask = 0x00000070; // 00001110000
|
| static const int kFlagsKindMask = 0x00000780; // 11110000000
|
| static const int kFlagsCacheInPrototypeMapMask = 0x00000800;
|
| - static const int kFlagsArgumentsCountMask = 0xFFFFF000;
|
| + static const int kFlagsExtraICStateMask = 0x00003000;
|
| + static const int kFlagsArgumentsCountMask = 0xFFFFC000;
|
|
|
| static const int kFlagsNotUsedInLookup =
|
| (kFlagsICInLoopMask | kFlagsTypeMask | kFlagsCacheInPrototypeMapMask);
|
| @@ -3451,6 +3500,19 @@
|
| return ((1 << kHasFastElements) & bit_field2()) != 0;
|
| }
|
|
|
| + // Tells whether an instance has pixel array elements.
|
| + inline void set_has_pixel_array_elements(bool value) {
|
| + if (value) {
|
| + set_bit_field2(bit_field2() | (1 << kHasPixelArrayElements));
|
| + } else {
|
| + set_bit_field2(bit_field2() & ~(1 << kHasPixelArrayElements));
|
| + }
|
| + }
|
| +
|
| + inline bool has_pixel_array_elements() {
|
| + return ((1 << kHasPixelArrayElements) & bit_field2()) != 0;
|
| + }
|
| +
|
| // Tells whether the map is attached to SharedFunctionInfo
|
| // (for inobject slack tracking).
|
| inline void set_attached_to_shared_function_info(bool value);
|
| @@ -3509,6 +3571,11 @@
|
| // from the descriptors and the fast elements bit cleared.
|
| MUST_USE_RESULT inline MaybeObject* GetSlowElementsMap();
|
|
|
| + // Returns this map if it has the pixel array elements bit is set, otherwise
|
| + // returns a copy of the map, with all transitions dropped from the
|
| + // descriptors and the pixel array elements bit set.
|
| + MUST_USE_RESULT inline MaybeObject* GetPixelArrayElementsMap();
|
| +
|
| // Returns the property index for name (only valid for FAST MODE).
|
| int PropertyIndexFor(String* name);
|
|
|
| @@ -3627,6 +3694,7 @@
|
| static const int kStringWrapperSafeForDefaultValueOf = 3;
|
| static const int kAttachedToSharedFunctionInfo = 4;
|
| static const int kIsShared = 5;
|
| + static const int kHasPixelArrayElements = 6;
|
|
|
| // Layout of the default cache. It holds alternating name and code objects.
|
| static const int kCodeCacheEntrySize = 2;
|
| @@ -3939,7 +4007,6 @@
|
| inline bool IsApiFunction();
|
| inline FunctionTemplateInfo* get_api_func_data();
|
| inline bool HasBuiltinFunctionId();
|
| - inline bool IsBuiltinMathFunction();
|
| inline BuiltinFunctionId builtin_function_id();
|
|
|
| // [script info]: Script from which the function originates.
|
| @@ -4036,6 +4103,10 @@
|
| inline bool optimization_disabled();
|
| inline void set_optimization_disabled(bool value);
|
|
|
| + // Indicates whether the function is a strict mode function.
|
| + inline bool strict_mode();
|
| + inline void set_strict_mode(bool value);
|
| +
|
| // Indicates whether or not the code in the shared function support
|
| // deoptimization.
|
| inline bool has_deoptimization_support();
|
| @@ -4200,7 +4271,6 @@
|
| kThisPropertyAssignmentsOffset + kPointerSize,
|
| kSize> BodyDescriptor;
|
|
|
| - private:
|
| // Bit positions in start_position_and_type.
|
| // The source code start position is in the 30 most significant bits of
|
| // the start_position_and_type field.
|
| @@ -4217,7 +4287,37 @@
|
| static const int kCodeAgeShift = 4;
|
| static const int kCodeAgeMask = 0x7;
|
| static const int kOptimizationDisabled = 7;
|
| + static const int kStrictModeFunction = 8;
|
|
|
| + private:
|
| +#if V8_HOST_ARCH_32_BIT
|
| + // On 32 bit platforms, compiler hints is a smi.
|
| + static const int kCompilerHintsSmiTagSize = kSmiTagSize;
|
| + static const int kCompilerHintsSize = kPointerSize;
|
| +#else
|
| + // On 64 bit platforms, compiler hints is not a smi, see comment above.
|
| + static const int kCompilerHintsSmiTagSize = 0;
|
| + static const int kCompilerHintsSize = kIntSize;
|
| +#endif
|
| +
|
| + public:
|
| + // Constants for optimizing codegen for strict mode function tests.
|
| + // Allows to use byte-widgh instructions.
|
| + static const int kStrictModeBitWithinByte =
|
| + (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte;
|
| +
|
| +#if __BYTE_ORDER == __LITTLE_ENDIAN
|
| + static const int kStrictModeByteOffset = kCompilerHintsOffset +
|
| + (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte;
|
| +#elif __BYTE_ORDER == __BIG_ENDIAN
|
| + static const int kStrictModeByteOffset = kCompilerHintsOffset +
|
| + (kCompilerHintsSize - 1) -
|
| + ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte);
|
| +#else
|
| +#error Unknown byte ordering
|
| +#endif
|
| +
|
| + private:
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
|
| };
|
|
|
| @@ -4562,6 +4662,68 @@
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSValue);
|
| };
|
|
|
| +
|
| +// Representation of message objects used for error reporting through
|
| +// the API. The messages are formatted in JavaScript so this object is
|
| +// a real JavaScript object. The information used for formatting the
|
| +// error messages are not directly accessible from JavaScript to
|
| +// prevent leaking information to user code called during error
|
| +// formatting.
|
| +class JSMessageObject: public JSObject {
|
| + public:
|
| + // [type]: the type of error message.
|
| + DECL_ACCESSORS(type, String)
|
| +
|
| + // [arguments]: the arguments for formatting the error message.
|
| + DECL_ACCESSORS(arguments, JSArray)
|
| +
|
| + // [script]: the script from which the error message originated.
|
| + DECL_ACCESSORS(script, Object)
|
| +
|
| + // [stack_trace]: the stack trace for this error message.
|
| + DECL_ACCESSORS(stack_trace, Object)
|
| +
|
| + // [stack_frames]: an array of stack frames for this error object.
|
| + DECL_ACCESSORS(stack_frames, Object)
|
| +
|
| + // [start_position]: the start position in the script for the error message.
|
| + inline int start_position();
|
| + inline void set_start_position(int value);
|
| +
|
| + // [end_position]: the end position in the script for the error message.
|
| + inline int end_position();
|
| + inline void set_end_position(int value);
|
| +
|
| + // Casting.
|
| + static inline JSMessageObject* cast(Object* obj);
|
| +
|
| + // Dispatched behavior.
|
| +#ifdef OBJECT_PRINT
|
| + inline void JSMessageObjectPrint() {
|
| + JSMessageObjectPrint(stdout);
|
| + }
|
| + void JSMessageObjectPrint(FILE* out);
|
| +#endif
|
| +#ifdef DEBUG
|
| + void JSMessageObjectVerify();
|
| +#endif
|
| +
|
| + // Layout description.
|
| + static const int kTypeOffset = JSObject::kHeaderSize;
|
| + static const int kArgumentsOffset = kTypeOffset + kPointerSize;
|
| + static const int kScriptOffset = kArgumentsOffset + kPointerSize;
|
| + static const int kStackTraceOffset = kScriptOffset + kPointerSize;
|
| + static const int kStackFramesOffset = kStackTraceOffset + kPointerSize;
|
| + static const int kStartPositionOffset = kStackFramesOffset + kPointerSize;
|
| + static const int kEndPositionOffset = kStartPositionOffset + kPointerSize;
|
| + static const int kSize = kEndPositionOffset + kPointerSize;
|
| +
|
| + typedef FixedBodyDescriptor<HeapObject::kMapOffset,
|
| + kStackFramesOffset + kPointerSize,
|
| + kSize> BodyDescriptor;
|
| +};
|
| +
|
| +
|
| // Regular expressions
|
| // The regular expression holds a single reference to a FixedArray in
|
| // the kDataOffset field.
|
| @@ -4700,10 +4862,12 @@
|
| public:
|
| // Find cached value for a string key, otherwise return null.
|
| Object* Lookup(String* src);
|
| - Object* LookupEval(String* src, Context* context);
|
| + Object* LookupEval(String* src, Context* context, StrictModeFlag strict_mode);
|
| Object* LookupRegExp(String* source, JSRegExp::Flags flags);
|
| MaybeObject* Put(String* src, Object* value);
|
| - MaybeObject* PutEval(String* src, Context* context, Object* value);
|
| + MaybeObject* PutEval(String* src,
|
| + Context* context,
|
| + SharedFunctionInfo* value);
|
| MaybeObject* PutRegExp(String* src, JSRegExp::Flags flags, FixedArray* value);
|
|
|
| // Remove given value from cache.
|
|
|