| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 3494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3505 | 3505 |
| 3506 // We are storing the new map using release store after creating a filler for | 3506 // We are storing the new map using release store after creating a filler for |
| 3507 // the left-over space to avoid races with the sweeper thread. | 3507 // the left-over space to avoid races with the sweeper thread. |
| 3508 object->synchronized_set_map(*new_map); | 3508 object->synchronized_set_map(*new_map); |
| 3509 | 3509 |
| 3510 object->set_properties(*dictionary); | 3510 object->set_properties(*dictionary); |
| 3511 | 3511 |
| 3512 // Ensure that in-object space of slow-mode object does not contain random | 3512 // Ensure that in-object space of slow-mode object does not contain random |
| 3513 // garbage. | 3513 // garbage. |
| 3514 int inobject_properties = new_map->GetInObjectProperties(); | 3514 int inobject_properties = new_map->GetInObjectProperties(); |
| 3515 for (int i = 0; i < inobject_properties; i++) { | 3515 if (inobject_properties) { |
| 3516 FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i); | 3516 Heap* heap = isolate->heap(); |
| 3517 object->RawFastPropertyAtPut(index, Smi::FromInt(0)); | 3517 heap->ClearRecordedSlotRange( |
| 3518 } | 3518 object->address() + map->GetInObjectPropertyOffset(0), |
| 3519 object->address() + new_instance_size); |
| 3520 |
| 3521 for (int i = 0; i < inobject_properties; i++) { |
| 3522 FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i); |
| 3523 object->RawFastPropertyAtPut(index, Smi::FromInt(0)); |
| 3524 } |
| 3525 } |
| 3519 | 3526 |
| 3520 isolate->counters()->props_to_dictionary()->Increment(); | 3527 isolate->counters()->props_to_dictionary()->Increment(); |
| 3521 | 3528 |
| 3522 #ifdef DEBUG | 3529 #ifdef DEBUG |
| 3523 if (FLAG_trace_normalization) { | 3530 if (FLAG_trace_normalization) { |
| 3524 OFStream os(stdout); | 3531 OFStream os(stdout); |
| 3525 os << "Object properties have been normalized:\n"; | 3532 os << "Object properties have been normalized:\n"; |
| 3526 object->Print(os); | 3533 object->Print(os); |
| 3527 } | 3534 } |
| 3528 #endif | 3535 #endif |
| (...skipping 16404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19933 } | 19940 } |
| 19934 | 19941 |
| 19935 // Evaluation of module body. | 19942 // Evaluation of module body. |
| 19936 Handle<JSFunction> resume( | 19943 Handle<JSFunction> resume( |
| 19937 isolate->native_context()->generator_next_internal(), isolate); | 19944 isolate->native_context()->generator_next_internal(), isolate); |
| 19938 return Execution::Call(isolate, resume, generator, 0, nullptr); | 19945 return Execution::Call(isolate, resume, generator, 0, nullptr); |
| 19939 } | 19946 } |
| 19940 | 19947 |
| 19941 } // namespace internal | 19948 } // namespace internal |
| 19942 } // namespace v8 | 19949 } // namespace v8 |
| OLD | NEW |