| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 PropertyAttributes GetElementAttributeWithReceiver(JSReceiver* receiver, | 1939 PropertyAttributes GetElementAttributeWithReceiver(JSReceiver* receiver, |
| 1940 uint32_t index, | 1940 uint32_t index, |
| 1941 bool continue_search); | 1941 bool continue_search); |
| 1942 | 1942 |
| 1943 static void DefineAccessor(Handle<JSObject> object, | 1943 static void DefineAccessor(Handle<JSObject> object, |
| 1944 Handle<Name> name, | 1944 Handle<Name> name, |
| 1945 Handle<Object> getter, | 1945 Handle<Object> getter, |
| 1946 Handle<Object> setter, | 1946 Handle<Object> setter, |
| 1947 PropertyAttributes attributes); | 1947 PropertyAttributes attributes); |
| 1948 | 1948 |
| 1949 Object* LookupAccessor(Name* name, AccessorComponent component); | 1949 MaybeObject* LookupAccessor(Name* name, AccessorComponent component); |
| 1950 | 1950 |
| 1951 MUST_USE_RESULT MaybeObject* DefineAccessor(AccessorInfo* info); | 1951 MUST_USE_RESULT MaybeObject* DefineAccessor(AccessorInfo* info); |
| 1952 | 1952 |
| 1953 // Used from Object::GetProperty(). | 1953 // Used from Object::GetProperty(). |
| 1954 MUST_USE_RESULT MaybeObject* GetPropertyWithFailedAccessCheck( | 1954 MUST_USE_RESULT MaybeObject* GetPropertyWithFailedAccessCheck( |
| 1955 Object* receiver, | 1955 Object* receiver, |
| 1956 LookupResult* result, | 1956 LookupResult* result, |
| 1957 Name* name, | 1957 Name* name, |
| 1958 PropertyAttributes* attributes); | 1958 PropertyAttributes* attributes); |
| 1959 MUST_USE_RESULT MaybeObject* GetPropertyWithInterceptor( | 1959 MUST_USE_RESULT MaybeObject* GetPropertyWithInterceptor( |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2328 // Casting. | 2328 // Casting. |
| 2329 static inline JSObject* cast(Object* obj); | 2329 static inline JSObject* cast(Object* obj); |
| 2330 | 2330 |
| 2331 // Disalow further properties to be added to the object. | 2331 // Disalow further properties to be added to the object. |
| 2332 static Handle<Object> PreventExtensions(Handle<JSObject> object); | 2332 static Handle<Object> PreventExtensions(Handle<JSObject> object); |
| 2333 MUST_USE_RESULT MaybeObject* PreventExtensions(); | 2333 MUST_USE_RESULT MaybeObject* PreventExtensions(); |
| 2334 | 2334 |
| 2335 // ES5 Object.freeze | 2335 // ES5 Object.freeze |
| 2336 MUST_USE_RESULT MaybeObject* Freeze(Isolate* isolate); | 2336 MUST_USE_RESULT MaybeObject* Freeze(Isolate* isolate); |
| 2337 | 2337 |
| 2338 |
| 2339 // Called the first time an object is observed with ES7 Object.observe. |
| 2340 MUST_USE_RESULT MaybeObject* SetObserved(Isolate* isolate); |
| 2341 |
| 2338 // Copy object | 2342 // Copy object |
| 2339 MUST_USE_RESULT MaybeObject* DeepCopy(Isolate* isolate); | 2343 MUST_USE_RESULT MaybeObject* DeepCopy(Isolate* isolate); |
| 2340 | 2344 |
| 2341 // Dispatched behavior. | 2345 // Dispatched behavior. |
| 2342 void JSObjectShortPrint(StringStream* accumulator); | 2346 void JSObjectShortPrint(StringStream* accumulator); |
| 2343 DECLARE_PRINTER(JSObject) | 2347 DECLARE_PRINTER(JSObject) |
| 2344 DECLARE_VERIFIER(JSObject) | 2348 DECLARE_VERIFIER(JSObject) |
| 2345 #ifdef OBJECT_PRINT | 2349 #ifdef OBJECT_PRINT |
| 2346 inline void PrintProperties() { | 2350 inline void PrintProperties() { |
| 2347 PrintProperties(stdout); | 2351 PrintProperties(stdout); |
| (...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4668 inline CheckType check_type(); | 4672 inline CheckType check_type(); |
| 4669 inline void set_check_type(CheckType value); | 4673 inline void set_check_type(CheckType value); |
| 4670 | 4674 |
| 4671 // [type-recording unary op type]: For kind UNARY_OP_IC. | 4675 // [type-recording unary op type]: For kind UNARY_OP_IC. |
| 4672 inline byte unary_op_type(); | 4676 inline byte unary_op_type(); |
| 4673 inline void set_unary_op_type(byte value); | 4677 inline void set_unary_op_type(byte value); |
| 4674 | 4678 |
| 4675 // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in. | 4679 // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in. |
| 4676 inline byte to_boolean_state(); | 4680 inline byte to_boolean_state(); |
| 4677 | 4681 |
| 4678 // [compare_nil]: For kind COMPARE_NIL_IC tells what state the stub is in. | |
| 4679 byte compare_nil_state(); | |
| 4680 byte compare_nil_value(); | |
| 4681 | |
| 4682 // [has_function_cache]: For kind STUB tells whether there is a function | 4682 // [has_function_cache]: For kind STUB tells whether there is a function |
| 4683 // cache is passed to the stub. | 4683 // cache is passed to the stub. |
| 4684 inline bool has_function_cache(); | 4684 inline bool has_function_cache(); |
| 4685 inline void set_has_function_cache(bool flag); | 4685 inline void set_has_function_cache(bool flag); |
| 4686 | 4686 |
| 4687 | 4687 |
| 4688 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether | 4688 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether |
| 4689 // the code is going to be deoptimized because of dead embedded maps. | 4689 // the code is going to be deoptimized because of dead embedded maps. |
| 4690 inline bool marked_for_deoptimization(); | 4690 inline bool marked_for_deoptimization(); |
| 4691 inline void set_marked_for_deoptimization(bool flag); | 4691 inline void set_marked_for_deoptimization(bool flag); |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5476 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, | 5476 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, |
| 5477 TransitionFlag flag); | 5477 TransitionFlag flag); |
| 5478 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, | 5478 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, |
| 5479 TransitionFlag flag); | 5479 TransitionFlag flag); |
| 5480 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor( | 5480 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor( |
| 5481 DescriptorArray* descriptors, | 5481 DescriptorArray* descriptors, |
| 5482 Descriptor* descriptor, | 5482 Descriptor* descriptor, |
| 5483 int index, | 5483 int index, |
| 5484 TransitionFlag flag); | 5484 TransitionFlag flag); |
| 5485 MUST_USE_RESULT MaybeObject* AsElementsKind(ElementsKind kind); | 5485 MUST_USE_RESULT MaybeObject* AsElementsKind(ElementsKind kind); |
| 5486 |
| 5486 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, | 5487 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, |
| 5487 TransitionFlag flag); | 5488 TransitionFlag flag); |
| 5489 MUST_USE_RESULT MaybeObject* CopyForObserved(); |
| 5488 | 5490 |
| 5489 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, | 5491 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, |
| 5490 NormalizedMapSharingMode sharing); | 5492 NormalizedMapSharingMode sharing); |
| 5491 | 5493 |
| 5492 inline void AppendDescriptor(Descriptor* desc, | 5494 inline void AppendDescriptor(Descriptor* desc, |
| 5493 const DescriptorArray::WhitenessWitness&); | 5495 const DescriptorArray::WhitenessWitness&); |
| 5494 | 5496 |
| 5495 // Returns a copy of the map, with all transitions dropped from the | 5497 // Returns a copy of the map, with all transitions dropped from the |
| 5496 // instance descriptors. | 5498 // instance descriptors. |
| 5497 static Handle<Map> Copy(Handle<Map> map); | 5499 static Handle<Map> Copy(Handle<Map> map); |
| 5498 MUST_USE_RESULT MaybeObject* Copy(); | 5500 MUST_USE_RESULT MaybeObject* Copy(); |
| 5499 | 5501 |
| 5500 // Returns the next free property index (only valid for FAST MODE). | 5502 // Returns the next free property index (only valid for FAST MODE). |
| 5501 int NextFreePropertyIndex(); | 5503 int NextFreePropertyIndex(); |
| 5502 | 5504 |
| 5503 // Returns the number of properties described in instance_descriptors | 5505 // Returns the number of properties described in instance_descriptors |
| 5504 // filtering out properties with the specified attributes. | 5506 // filtering out properties with the specified attributes. |
| 5505 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, | 5507 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, |
| 5506 PropertyAttributes filter = NONE); | 5508 PropertyAttributes filter = NONE); |
| 5507 | 5509 |
| 5510 // Returns the number of slots allocated for the initial properties |
| 5511 // backing storage for instances of this map. |
| 5512 int InitialPropertiesLength() { |
| 5513 return pre_allocated_property_fields() + unused_property_fields() - |
| 5514 inobject_properties(); |
| 5515 } |
| 5516 |
| 5508 // Casting. | 5517 // Casting. |
| 5509 static inline Map* cast(Object* obj); | 5518 static inline Map* cast(Object* obj); |
| 5510 | 5519 |
| 5511 // Locate an accessor in the instance descriptor. | 5520 // Locate an accessor in the instance descriptor. |
| 5512 AccessorDescriptor* FindAccessor(Name* name); | 5521 AccessorDescriptor* FindAccessor(Name* name); |
| 5513 | 5522 |
| 5514 // Code cache operations. | 5523 // Code cache operations. |
| 5515 | 5524 |
| 5516 // Clears the code cache. | 5525 // Clears the code cache. |
| 5517 inline void ClearCodeCache(Heap* heap); | 5526 inline void ClearCodeCache(Heap* heap); |
| (...skipping 4294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9812 } else { | 9821 } else { |
| 9813 value &= ~(1 << bit_position); | 9822 value &= ~(1 << bit_position); |
| 9814 } | 9823 } |
| 9815 return value; | 9824 return value; |
| 9816 } | 9825 } |
| 9817 }; | 9826 }; |
| 9818 | 9827 |
| 9819 } } // namespace v8::internal | 9828 } } // namespace v8::internal |
| 9820 | 9829 |
| 9821 #endif // V8_OBJECTS_H_ | 9830 #endif // V8_OBJECTS_H_ |
| OLD | NEW |