OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 Handle<JSGlobalProxy> ReinitializeJSGlobalProxy( | 136 Handle<JSGlobalProxy> ReinitializeJSGlobalProxy( |
137 Handle<JSFunction> constructor, | 137 Handle<JSFunction> constructor, |
138 Handle<JSGlobalProxy> global) { | 138 Handle<JSGlobalProxy> global) { |
139 CALL_HEAP_FUNCTION(Heap::ReinitializeJSGlobalProxy(*constructor, *global), | 139 CALL_HEAP_FUNCTION(Heap::ReinitializeJSGlobalProxy(*constructor, *global), |
140 JSGlobalProxy); | 140 JSGlobalProxy); |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 void SetExpectedNofProperties(Handle<JSFunction> func, int nof) { | 144 void SetExpectedNofProperties(Handle<JSFunction> func, int nof) { |
145 // If objects constructed from this function exist then changing | 145 // If objects constructed from this function exist then changing |
146 // 'estimated_nof_properties' is dangerous since the previois value might | 146 // 'estimated_nof_properties' is dangerous since the previous value might |
147 // have been compiled into the fast construct stub. More over, the inobject | 147 // have been compiled into the fast construct stub. More over, the inobject |
148 // slack tracking logic might have adjusted the previous value, so even | 148 // slack tracking logic might have adjusted the previous value, so even |
149 // passing the same value is risky. | 149 // passing the same value is risky. |
150 if (func->shared()->live_objects_may_exist()) return; | 150 if (func->shared()->live_objects_may_exist()) return; |
151 | 151 |
152 func->shared()->set_expected_nof_properties(nof); | 152 func->shared()->set_expected_nof_properties(nof); |
153 if (func->has_initial_map()) { | 153 if (func->has_initial_map()) { |
154 Handle<Map> new_initial_map = | 154 Handle<Map> new_initial_map = |
155 Factory::CopyMapDropTransitions(Handle<Map>(func->initial_map())); | 155 Factory::CopyMapDropTransitions(Handle<Map>(func->initial_map())); |
156 new_initial_map->set_unused_property_fields(nof); | 156 new_initial_map->set_unused_property_fields(nof); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 876 |
877 OptimizedObjectForAddingMultipleProperties:: | 877 OptimizedObjectForAddingMultipleProperties:: |
878 ~OptimizedObjectForAddingMultipleProperties() { | 878 ~OptimizedObjectForAddingMultipleProperties() { |
879 // Reoptimize the object to allow fast property access. | 879 // Reoptimize the object to allow fast property access. |
880 if (has_been_transformed_) { | 880 if (has_been_transformed_) { |
881 TransformToFastProperties(object_, unused_property_fields_); | 881 TransformToFastProperties(object_, unused_property_fields_); |
882 } | 882 } |
883 } | 883 } |
884 | 884 |
885 } } // namespace v8::internal | 885 } } // namespace v8::internal |
OLD | NEW |