| Index: src/objects.h
|
| ===================================================================
|
| --- src/objects.h (revision 7006)
|
| +++ 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) \
|
| @@ -518,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,
|
| @@ -675,6 +680,7 @@
|
| V(Oddball) \
|
| V(SharedFunctionInfo) \
|
| V(JSValue) \
|
| + V(JSMessageObject) \
|
| V(StringWrapper) \
|
| V(Proxy) \
|
| V(Boolean) \
|
| @@ -1582,7 +1588,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
|
| @@ -3286,13 +3293,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.
|
| @@ -3456,8 +3463,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;
|
| @@ -4190,6 +4197,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();
|
| @@ -4371,6 +4382,7 @@
|
| static const int kCodeAgeShift = 4;
|
| static const int kCodeAgeMask = 0x7;
|
| static const int kOptimizationDisabled = 7;
|
| + static const int kStrictModeFunction = 8;
|
|
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
|
| };
|
| @@ -4716,6 +4728,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.
|
| @@ -4854,10 +4928,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.
|
|
|