| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 72ca092f5123c0f4920b17bba638594b49612c17..fa90b0689a35129ca0bf0898637ecf4a9f968fa6 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -2346,6 +2346,10 @@ class JSObject: public JSReceiver {
|
| bool from_javascript,
|
| ShouldThrow should_throw);
|
|
|
| + // Makes the object prototype immutable
|
| + MUST_USE_RESULT static Maybe<bool> SetImmutableProto(
|
| + Handle<JSObject> object, bool from_javascript, ShouldThrow should_throw);
|
| +
|
| // Initializes the body starting at |start_offset|. It is responsibility of
|
| // the caller to initialize object header. Fill the pre-allocated fields with
|
| // pre_allocated_value and the rest with filler_value.
|
| @@ -5703,7 +5707,7 @@ class Map: public HeapObject {
|
| class Deprecated : public BitField<bool, 23, 1> {};
|
| class IsUnstable : public BitField<bool, 24, 1> {};
|
| class IsMigrationTarget : public BitField<bool, 25, 1> {};
|
| - // Bit 26 is free.
|
| + class ImmutablePrototype : public BitField<bool, 26, 1> {};
|
| class NewTargetIsBase : public BitField<bool, 27, 1> {};
|
| // Bit 28 is free.
|
|
|
| @@ -5991,6 +5995,8 @@ class Map: public HeapObject {
|
| inline bool is_stable();
|
| inline void set_migration_target(bool value);
|
| inline bool is_migration_target();
|
| + inline void set_immutable_proto(bool value);
|
| + inline bool is_immutable_proto();
|
| inline void set_construction_counter(int value);
|
| inline int construction_counter();
|
| inline void deprecate();
|
| @@ -6163,6 +6169,8 @@ class Map: public HeapObject {
|
| Handle<Object> prototype,
|
| PrototypeOptimizationMode mode);
|
|
|
| + static Handle<Map> TransitionToImmutableProto(Handle<Map> map);
|
| +
|
| static const int kMaxPreAllocatedPropertyFields = 255;
|
|
|
| // Layout description.
|
| @@ -10685,7 +10693,9 @@ class FunctionTemplateInfo: public TemplateInfo {
|
| class ObjectTemplateInfo: public TemplateInfo {
|
| public:
|
| DECL_ACCESSORS(constructor, Object)
|
| - DECL_ACCESSORS(internal_field_count, Object)
|
| + DECL_ACCESSORS(data, Object)
|
| + DECL_INT_ACCESSORS(internal_field_count)
|
| + DECL_BOOLEAN_ACCESSORS(immutable_proto)
|
|
|
| DECLARE_CAST(ObjectTemplateInfo)
|
|
|
| @@ -10694,9 +10704,9 @@ class ObjectTemplateInfo: public TemplateInfo {
|
| DECLARE_VERIFIER(ObjectTemplateInfo)
|
|
|
| static const int kConstructorOffset = TemplateInfo::kHeaderSize;
|
| - static const int kInternalFieldCountOffset =
|
| - kConstructorOffset + kPointerSize;
|
| - static const int kSize = kInternalFieldCountOffset + kPointerSize;
|
| + // LSB is for immutable_proto, higher bits for internal_field_count
|
| + static const int kDataOffset = kConstructorOffset + kPointerSize;
|
| + static const int kSize = kDataOffset + kPointerSize;
|
| };
|
|
|
|
|
|
|