OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "api.h" | 8 #include "api.h" |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3614 // verification code has to cope with (temporarily) invalid objects. See | 3614 // verification code has to cope with (temporarily) invalid objects. See |
3615 // for example, JSArray::JSArrayVerify). | 3615 // for example, JSArray::JSArrayVerify). |
3616 Object* filler; | 3616 Object* filler; |
3617 // We cannot always fill with one_pointer_filler_map because objects | 3617 // We cannot always fill with one_pointer_filler_map because objects |
3618 // created from API functions expect their internal fields to be initialized | 3618 // created from API functions expect their internal fields to be initialized |
3619 // with undefined_value. | 3619 // with undefined_value. |
3620 // Pre-allocated fields need to be initialized with undefined_value as well | 3620 // Pre-allocated fields need to be initialized with undefined_value as well |
3621 // so that object accesses before the constructor completes (e.g. in the | 3621 // so that object accesses before the constructor completes (e.g. in the |
3622 // debugger) will not cause a crash. | 3622 // debugger) will not cause a crash. |
3623 if (map->constructor()->IsJSFunction() && | 3623 if (map->constructor()->IsJSFunction() && |
3624 JSFunction::cast(map->constructor())->shared()-> | 3624 JSFunction::cast(map->constructor())-> |
3625 IsInobjectSlackTrackingInProgress()) { | 3625 IsInobjectSlackTrackingInProgress()) { |
3626 // We might want to shrink the object later. | 3626 // We might want to shrink the object later. |
3627 ASSERT(obj->GetInternalFieldCount() == 0); | 3627 ASSERT(obj->GetInternalFieldCount() == 0); |
3628 filler = Heap::one_pointer_filler_map(); | 3628 filler = Heap::one_pointer_filler_map(); |
3629 } else { | 3629 } else { |
3630 filler = Heap::undefined_value(); | 3630 filler = Heap::undefined_value(); |
3631 } | 3631 } |
3632 obj->InitializeBody(map, Heap::undefined_value(), filler); | 3632 obj->InitializeBody(map, Heap::undefined_value(), filler); |
3633 } | 3633 } |
3634 | 3634 |
(...skipping 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6465 static_cast<int>(object_sizes_last_time_[index])); | 6465 static_cast<int>(object_sizes_last_time_[index])); |
6466 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6466 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6467 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6467 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6468 | 6468 |
6469 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6469 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6470 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6470 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6471 ClearObjectStats(); | 6471 ClearObjectStats(); |
6472 } | 6472 } |
6473 | 6473 |
6474 } } // namespace v8::internal | 6474 } } // namespace v8::internal |
OLD | NEW |