| 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 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2146 Name* name, | 2146 Name* name, |
| 2147 Object* value, | 2147 Object* value, |
| 2148 bool check_prototype, | 2148 bool check_prototype, |
| 2149 StrictModeFlag strict_mode); | 2149 StrictModeFlag strict_mode); |
| 2150 MUST_USE_RESULT MaybeObject* SetPropertyWithCallback( | 2150 MUST_USE_RESULT MaybeObject* SetPropertyWithCallback( |
| 2151 Object* structure, | 2151 Object* structure, |
| 2152 Name* name, | 2152 Name* name, |
| 2153 Object* value, | 2153 Object* value, |
| 2154 JSObject* holder, | 2154 JSObject* holder, |
| 2155 StrictModeFlag strict_mode); | 2155 StrictModeFlag strict_mode); |
| 2156 |
| 2156 MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor( | 2157 MUST_USE_RESULT MaybeObject* SetPropertyWithInterceptor( |
| 2157 Name* name, | 2158 Name* name, |
| 2158 Object* value, | 2159 Object* value, |
| 2159 PropertyAttributes attributes, | 2160 PropertyAttributes attributes, |
| 2160 StrictModeFlag strict_mode); | 2161 StrictModeFlag strict_mode); |
| 2162 static Handle<Object> SetPropertyWithInterceptor( |
| 2163 Handle<JSObject> object, |
| 2164 Handle<Name> name, |
| 2165 Handle<Object> value, |
| 2166 PropertyAttributes attributes, |
| 2167 StrictModeFlag strict_mode); |
| 2168 |
| 2161 MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( | 2169 MUST_USE_RESULT MaybeObject* SetPropertyPostInterceptor( |
| 2162 Name* name, | 2170 Name* name, |
| 2163 Object* value, | 2171 Object* value, |
| 2164 PropertyAttributes attributes, | 2172 PropertyAttributes attributes, |
| 2165 StrictModeFlag strict_mode, | 2173 StrictModeFlag strict_mode, |
| 2166 StoreMode mode = ALLOW_AS_CONSTANT); | 2174 StoreMode mode = ALLOW_AS_CONSTANT); |
| 2167 | 2175 |
| 2168 static Handle<Object> SetLocalPropertyIgnoreAttributes( | 2176 static Handle<Object> SetLocalPropertyIgnoreAttributes( |
| 2169 Handle<JSObject> object, | 2177 Handle<JSObject> object, |
| 2170 Handle<Name> key, | 2178 Handle<Name> key, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2500 // if it is called on a second object with this map, a | 2508 // if it is called on a second object with this map, a |
| 2501 // normal property is added instead, with a map transition. | 2509 // normal property is added instead, with a map transition. |
| 2502 // This avoids the creation of many maps with the same constant | 2510 // This avoids the creation of many maps with the same constant |
| 2503 // function, all orphaned. | 2511 // function, all orphaned. |
| 2504 MUST_USE_RESULT MaybeObject* AddConstantProperty( | 2512 MUST_USE_RESULT MaybeObject* AddConstantProperty( |
| 2505 Name* name, | 2513 Name* name, |
| 2506 Object* constant, | 2514 Object* constant, |
| 2507 PropertyAttributes attributes, | 2515 PropertyAttributes attributes, |
| 2508 TransitionFlag flag); | 2516 TransitionFlag flag); |
| 2509 | 2517 |
| 2510 MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( | |
| 2511 Name* name, | |
| 2512 Object* value, | |
| 2513 PropertyAttributes attributes); | |
| 2514 | |
| 2515 // Returns a new map with all transitions dropped from the object's current | 2518 // Returns a new map with all transitions dropped from the object's current |
| 2516 // map and the ElementsKind set. | 2519 // map and the ElementsKind set. |
| 2517 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, | 2520 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, |
| 2518 ElementsKind to_kind); | 2521 ElementsKind to_kind); |
| 2519 inline MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( | 2522 inline MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( |
| 2520 Isolate* isolate, | 2523 Isolate* isolate, |
| 2521 ElementsKind elements_kind); | 2524 ElementsKind elements_kind); |
| 2522 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( | 2525 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( |
| 2523 ElementsKind elements_kind); | 2526 ElementsKind elements_kind); |
| 2524 | 2527 |
| 2525 static Handle<Object> TransitionElementsKind(Handle<JSObject> object, | 2528 static Handle<Object> TransitionElementsKind(Handle<JSObject> object, |
| 2526 ElementsKind to_kind); | 2529 ElementsKind to_kind); |
| 2527 | 2530 |
| 2528 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); | 2531 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); |
| 2529 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind); | 2532 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind); |
| 2530 | 2533 |
| 2531 MUST_USE_RESULT MaybeObject* MigrateToMap(Map* new_map); | |
| 2532 MUST_USE_RESULT MaybeObject* GeneralizeFieldRepresentation( | |
| 2533 int modify_index, | |
| 2534 Representation new_representation, | |
| 2535 StoreMode store_mode); | |
| 2536 | |
| 2537 // Add a property to a fast-case object. | 2534 // Add a property to a fast-case object. |
| 2538 MUST_USE_RESULT MaybeObject* AddFastProperty( | 2535 MUST_USE_RESULT MaybeObject* AddFastProperty( |
| 2539 Name* name, | 2536 Name* name, |
| 2540 Object* value, | 2537 Object* value, |
| 2541 PropertyAttributes attributes, | 2538 PropertyAttributes attributes, |
| 2542 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, | 2539 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, |
| 2543 ValueType value_type = OPTIMAL_REPRESENTATION, | 2540 ValueType value_type = OPTIMAL_REPRESENTATION, |
| 2544 TransitionFlag flag = INSERT_TRANSITION); | 2541 TransitionFlag flag = INSERT_TRANSITION); |
| 2545 | 2542 |
| 2546 // Add a property to a slow-case object. | 2543 // Add a property to a slow-case object. |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2747 Handle<Name> name, | 2744 Handle<Name> name, |
| 2748 Handle<Object> old_value); | 2745 Handle<Object> old_value); |
| 2749 | 2746 |
| 2750 // Deliver change records to observers. May cause GC. | 2747 // Deliver change records to observers. May cause GC. |
| 2751 static void DeliverChangeRecords(Isolate* isolate); | 2748 static void DeliverChangeRecords(Isolate* isolate); |
| 2752 | 2749 |
| 2753 private: | 2750 private: |
| 2754 friend class DictionaryElementsAccessor; | 2751 friend class DictionaryElementsAccessor; |
| 2755 friend class JSReceiver; | 2752 friend class JSReceiver; |
| 2756 | 2753 |
| 2754 static void AddProperty( |
| 2755 Handle<JSObject> object, |
| 2756 Handle<Name> name, |
| 2757 Handle<Object> value, |
| 2758 PropertyAttributes attributes, |
| 2759 StrictModeFlag strict_mode, |
| 2760 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, |
| 2761 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, |
| 2762 ValueType value_type = OPTIMAL_REPRESENTATION, |
| 2763 StoreMode mode = ALLOW_AS_CONSTANT, |
| 2764 TransitionFlag flag = INSERT_TRANSITION); |
| 2765 |
| 2766 static void AddFastPropertyUsingMap(Handle<JSObject> object, |
| 2767 Handle<Map> new_map, |
| 2768 Handle<Name> name, |
| 2769 Handle<Object> value, |
| 2770 int field_index, |
| 2771 Representation representation); |
| 2772 |
| 2773 MUST_USE_RESULT MaybeObject* GeneralizeFieldRepresentation( |
| 2774 int modify_index, |
| 2775 Representation new_representation, |
| 2776 StoreMode store_mode); |
| 2777 static void GeneralizeFieldRepresentation(Handle<JSObject> object, |
| 2778 int modify_index, |
| 2779 Representation new_representation, |
| 2780 StoreMode store_mode); |
| 2781 |
| 2782 static void ReplaceSlowProperty(Handle<JSObject> object, |
| 2783 Handle<Name> name, |
| 2784 Handle<Object> value, |
| 2785 PropertyAttributes attributes); |
| 2786 |
| 2787 MUST_USE_RESULT MaybeObject* MigrateToMap(Map* new_map); |
| 2788 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map); |
| 2789 |
| 2790 static void SetPropertyToField(LookupResult* lookup, |
| 2791 Handle<Name> name, |
| 2792 Handle<Object> value); |
| 2793 static void SetPropertyToFieldWithAttributes(LookupResult* lookup, |
| 2794 Handle<Name> name, |
| 2795 Handle<Object> value, |
| 2796 PropertyAttributes attributes); |
| 2797 static void SetPropertyUsingTransition(LookupResult* lookup, |
| 2798 Handle<Name> name, |
| 2799 Handle<Object> value, |
| 2800 PropertyAttributes attributes); |
| 2801 static void ConvertAndSetLocalProperty(LookupResult* lookup, |
| 2802 Handle<Name> name, |
| 2803 Handle<Object> value, |
| 2804 PropertyAttributes attributes); |
| 2805 |
| 2757 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, | 2806 MUST_USE_RESULT MaybeObject* GetElementWithCallback(Object* receiver, |
| 2758 Object* structure, | 2807 Object* structure, |
| 2759 uint32_t index, | 2808 uint32_t index, |
| 2760 Object* holder); | 2809 Object* holder); |
| 2761 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor( | 2810 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithInterceptor( |
| 2762 JSReceiver* receiver, | 2811 JSReceiver* receiver, |
| 2763 uint32_t index, | 2812 uint32_t index, |
| 2764 bool continue_search); | 2813 bool continue_search); |
| 2765 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithoutInterceptor( | 2814 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithoutInterceptor( |
| 2766 JSReceiver* receiver, | 2815 JSReceiver* receiver, |
| (...skipping 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5622 StoreMode store_mode); | 5671 StoreMode store_mode); |
| 5623 MUST_USE_RESULT MaybeObject* GeneralizeRepresentation( | 5672 MUST_USE_RESULT MaybeObject* GeneralizeRepresentation( |
| 5624 int modify_index, | 5673 int modify_index, |
| 5625 Representation representation, | 5674 Representation representation, |
| 5626 StoreMode store_mode); | 5675 StoreMode store_mode); |
| 5627 MUST_USE_RESULT MaybeObject* CopyGeneralizeAllRepresentations( | 5676 MUST_USE_RESULT MaybeObject* CopyGeneralizeAllRepresentations( |
| 5628 int modify_index, | 5677 int modify_index, |
| 5629 StoreMode store_mode, | 5678 StoreMode store_mode, |
| 5630 PropertyAttributes attributes, | 5679 PropertyAttributes attributes, |
| 5631 const char* reason); | 5680 const char* reason); |
| 5681 static Handle<Map> CopyGeneralizeAllRepresentations( |
| 5682 Handle<Map> map, |
| 5683 int modify_index, |
| 5684 StoreMode store_mode, |
| 5685 PropertyAttributes attributes, |
| 5686 const char* reason); |
| 5632 | 5687 |
| 5633 void PrintGeneralization(FILE* file, | 5688 void PrintGeneralization(FILE* file, |
| 5634 const char* reason, | 5689 const char* reason, |
| 5635 int modify_index, | 5690 int modify_index, |
| 5636 int split, | 5691 int split, |
| 5637 int descriptors, | 5692 int descriptors, |
| 5638 bool constant_to_field, | 5693 bool constant_to_field, |
| 5639 Representation old_representation, | 5694 Representation old_representation, |
| 5640 Representation new_representation); | 5695 Representation new_representation); |
| 5641 | 5696 |
| (...skipping 4634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10276 } else { | 10331 } else { |
| 10277 value &= ~(1 << bit_position); | 10332 value &= ~(1 << bit_position); |
| 10278 } | 10333 } |
| 10279 return value; | 10334 return value; |
| 10280 } | 10335 } |
| 10281 }; | 10336 }; |
| 10282 | 10337 |
| 10283 } } // namespace v8::internal | 10338 } } // namespace v8::internal |
| 10284 | 10339 |
| 10285 #endif // V8_OBJECTS_H_ | 10340 #endif // V8_OBJECTS_H_ |
| OLD | NEW |