OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 6188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6199 inline void set_is_observed() { | 6199 inline void set_is_observed() { |
6200 set_bit_field(bit_field() | (1 << kIsObserved)); | 6200 set_bit_field(bit_field() | (1 << kIsObserved)); |
6201 } | 6201 } |
6202 | 6202 |
6203 inline bool is_observed() { | 6203 inline bool is_observed() { |
6204 return ((1 << kIsObserved) & bit_field()) != 0; | 6204 return ((1 << kIsObserved) & bit_field()) != 0; |
6205 } | 6205 } |
6206 | 6206 |
6207 inline void set_is_extensible(bool value); | 6207 inline void set_is_extensible(bool value); |
6208 inline bool is_extensible(); | 6208 inline bool is_extensible(); |
6209 inline void mark_prototype_map(); | 6209 inline void set_is_prototype_map(bool value); |
6210 inline bool is_prototype_map(); | 6210 inline bool is_prototype_map(); |
6211 | 6211 |
6212 inline void set_elements_kind(ElementsKind elements_kind) { | 6212 inline void set_elements_kind(ElementsKind elements_kind) { |
6213 DCHECK(elements_kind < kElementsKindCount); | 6213 DCHECK(elements_kind < kElementsKindCount); |
6214 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); | 6214 DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize)); |
6215 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); | 6215 set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind)); |
6216 DCHECK(this->elements_kind() == elements_kind); | 6216 DCHECK(this->elements_kind() == elements_kind); |
6217 } | 6217 } |
6218 | 6218 |
6219 inline ElementsKind elements_kind() { | 6219 inline ElementsKind elements_kind() { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6534 Handle<Name> name, | 6534 Handle<Name> name, |
6535 Handle<Object> value, | 6535 Handle<Object> value, |
6536 PropertyAttributes attributes, | 6536 PropertyAttributes attributes, |
6537 StoreFromKeyed store_mode); | 6537 StoreFromKeyed store_mode); |
6538 | 6538 |
6539 inline void AppendDescriptor(Descriptor* desc); | 6539 inline void AppendDescriptor(Descriptor* desc); |
6540 | 6540 |
6541 // Returns a copy of the map, with all transitions dropped from the | 6541 // Returns a copy of the map, with all transitions dropped from the |
6542 // instance descriptors. | 6542 // instance descriptors. |
6543 static Handle<Map> Copy(Handle<Map> map); | 6543 static Handle<Map> Copy(Handle<Map> map); |
6544 static Handle<Map> CopyAsPrototypeMap(Handle<Map> map); | |
6545 static Handle<Map> Create(Handle<JSFunction> constructor, | 6544 static Handle<Map> Create(Handle<JSFunction> constructor, |
6546 int extra_inobject_properties); | 6545 int extra_inobject_properties); |
6547 | 6546 |
6548 // Returns the next free property index (only valid for FAST MODE). | 6547 // Returns the next free property index (only valid for FAST MODE). |
6549 int NextFreePropertyIndex(); | 6548 int NextFreePropertyIndex(); |
6550 | 6549 |
6551 // Returns the number of properties described in instance_descriptors | 6550 // Returns the number of properties described in instance_descriptors |
6552 // filtering out properties with the specified attributes. | 6551 // filtering out properties with the specified attributes. |
6553 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, | 6552 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, |
6554 PropertyAttributes filter = NONE); | 6553 PropertyAttributes filter = NONE); |
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7775 DECL_ACCESSORS(literals_or_bindings, FixedArray) | 7774 DECL_ACCESSORS(literals_or_bindings, FixedArray) |
7776 | 7775 |
7777 inline FixedArray* literals(); | 7776 inline FixedArray* literals(); |
7778 inline void set_literals(FixedArray* literals); | 7777 inline void set_literals(FixedArray* literals); |
7779 | 7778 |
7780 inline FixedArray* function_bindings(); | 7779 inline FixedArray* function_bindings(); |
7781 inline void set_function_bindings(FixedArray* bindings); | 7780 inline void set_function_bindings(FixedArray* bindings); |
7782 | 7781 |
7783 // The initial map for an object created by this constructor. | 7782 // The initial map for an object created by this constructor. |
7784 inline Map* initial_map(); | 7783 inline Map* initial_map(); |
7785 inline void set_initial_map(Map* value); | 7784 static void SetInitialMap(Handle<JSFunction> function, Handle<Map> map); |
7786 inline bool has_initial_map(); | 7785 inline bool has_initial_map(); |
7787 static void EnsureHasInitialMap(Handle<JSFunction> function); | 7786 static void EnsureHasInitialMap(Handle<JSFunction> function); |
7788 | 7787 |
7789 // Get and set the prototype property on a JSFunction. If the | 7788 // Get and set the prototype property on a JSFunction. If the |
7790 // function has an initial map the prototype is set on the initial | 7789 // function has an initial map the prototype is set on the initial |
7791 // map. Otherwise, the prototype is put in the initial map field | 7790 // map. Otherwise, the prototype is put in the initial map field |
7792 // until an initial map is needed. | 7791 // until an initial map is needed. |
7793 inline bool has_prototype(); | 7792 inline bool has_prototype(); |
7794 inline bool has_instance_prototype(); | 7793 inline bool has_instance_prototype(); |
7795 inline Object* prototype(); | 7794 inline Object* prototype(); |
(...skipping 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11272 } else { | 11271 } else { |
11273 value &= ~(1 << bit_position); | 11272 value &= ~(1 << bit_position); |
11274 } | 11273 } |
11275 return value; | 11274 return value; |
11276 } | 11275 } |
11277 }; | 11276 }; |
11278 | 11277 |
11279 } } // namespace v8::internal | 11278 } } // namespace v8::internal |
11280 | 11279 |
11281 #endif // V8_OBJECTS_H_ | 11280 #endif // V8_OBJECTS_H_ |
OLD | NEW |