| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 | 94 |
| 95 void SetExpectedNofPropertiesFromEstimate(Handle<JSFunction> func, | 95 void SetExpectedNofPropertiesFromEstimate(Handle<JSFunction> func, |
| 96 int estimate) { | 96 int estimate) { |
| 97 SetExpectedNofProperties( | 97 SetExpectedNofProperties( |
| 98 func, ExpectedNofPropertiesFromEstimate(estimate)); | 98 func, ExpectedNofPropertiesFromEstimate(estimate)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 | 101 |
| 102 void NormalizeProperties(Handle<JSObject> object) { | 102 void NormalizeProperties(Handle<JSObject> object, |
| 103 CALL_HEAP_FUNCTION_VOID(object->NormalizeProperties()); | 103 PropertyNormalizationMode mode) { |
| 104 CALL_HEAP_FUNCTION_VOID(object->NormalizeProperties(mode)); |
| 104 } | 105 } |
| 105 | 106 |
| 106 | 107 |
| 107 void NormalizeElements(Handle<JSObject> object) { | 108 void NormalizeElements(Handle<JSObject> object) { |
| 108 CALL_HEAP_FUNCTION_VOID(object->NormalizeElements()); | 109 CALL_HEAP_FUNCTION_VOID(object->NormalizeElements()); |
| 109 } | 110 } |
| 110 | 111 |
| 111 | 112 |
| 112 void TransformToFastProperties(Handle<JSObject> object, | 113 void TransformToFastProperties(Handle<JSObject> object, |
| 113 int unused_property_fields) { | 114 int unused_property_fields) { |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 } | 448 } |
| 448 | 449 |
| 449 OptimizedObjectForAddingMultipleProperties:: | 450 OptimizedObjectForAddingMultipleProperties:: |
| 450 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, | 451 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, |
| 451 bool condition) { | 452 bool condition) { |
| 452 object_ = object; | 453 object_ = object; |
| 453 if (condition && object_->HasFastProperties()) { | 454 if (condition && object_->HasFastProperties()) { |
| 454 // Normalize the properties of object to avoid n^2 behavior | 455 // Normalize the properties of object to avoid n^2 behavior |
| 455 // when extending the object multiple properties. | 456 // when extending the object multiple properties. |
| 456 unused_property_fields_ = object->map()->unused_property_fields(); | 457 unused_property_fields_ = object->map()->unused_property_fields(); |
| 457 NormalizeProperties(object_); | 458 NormalizeProperties(object_, KEEP_INOBJECT_PROPERTIES); |
| 458 has_been_transformed_ = true; | 459 has_been_transformed_ = true; |
| 459 | 460 |
| 460 } else { | 461 } else { |
| 461 has_been_transformed_ = false; | 462 has_been_transformed_ = false; |
| 462 } | 463 } |
| 463 } | 464 } |
| 464 | 465 |
| 465 | 466 |
| 466 OptimizedObjectForAddingMultipleProperties:: | 467 OptimizedObjectForAddingMultipleProperties:: |
| 467 ~OptimizedObjectForAddingMultipleProperties() { | 468 ~OptimizedObjectForAddingMultipleProperties() { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 Handle<Context> compile_context, | 535 Handle<Context> compile_context, |
| 535 Handle<Context> function_context) { | 536 Handle<Context> function_context) { |
| 536 Handle<FixedArray> arr = Factory::NewFixedArray(3); | 537 Handle<FixedArray> arr = Factory::NewFixedArray(3); |
| 537 arr->set(0, Smi::FromInt(index)); | 538 arr->set(0, Smi::FromInt(index)); |
| 538 arr->set(1, *compile_context); // Compile in this context | 539 arr->set(1, *compile_context); // Compile in this context |
| 539 arr->set(2, *function_context); // Set function context to this | 540 arr->set(2, *function_context); // Set function context to this |
| 540 fun->shared()->set_lazy_load_data(*arr); | 541 fun->shared()->set_lazy_load_data(*arr); |
| 541 } | 542 } |
| 542 | 543 |
| 543 } } // namespace v8::internal | 544 } } // namespace v8::internal |
| OLD | NEW |