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 "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 3023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3034 if (!allocation.To(&result)) return allocation; | 3034 if (!allocation.To(&result)) return allocation; |
3035 } | 3035 } |
3036 | 3036 |
3037 result->set_map_no_write_barrier(bytecode_array_map()); | 3037 result->set_map_no_write_barrier(bytecode_array_map()); |
3038 BytecodeArray* instance = BytecodeArray::cast(result); | 3038 BytecodeArray* instance = BytecodeArray::cast(result); |
3039 instance->set_length(length); | 3039 instance->set_length(length); |
3040 instance->set_frame_size(frame_size); | 3040 instance->set_frame_size(frame_size); |
3041 instance->set_parameter_count(parameter_count); | 3041 instance->set_parameter_count(parameter_count); |
3042 instance->set_interrupt_budget(interpreter::Interpreter::InterruptBudget()); | 3042 instance->set_interrupt_budget(interpreter::Interpreter::InterruptBudget()); |
3043 instance->set_osr_loop_nesting_level(0); | 3043 instance->set_osr_loop_nesting_level(0); |
| 3044 instance->set_bytecode_age(BytecodeArray::kNoAgeBytecodeAge); |
3044 instance->set_constant_pool(constant_pool); | 3045 instance->set_constant_pool(constant_pool); |
3045 instance->set_handler_table(empty_fixed_array()); | 3046 instance->set_handler_table(empty_fixed_array()); |
3046 instance->set_source_position_table(empty_byte_array()); | 3047 instance->set_source_position_table(empty_byte_array()); |
3047 CopyBytes(instance->GetFirstBytecodeAddress(), raw_bytecodes, length); | 3048 CopyBytes(instance->GetFirstBytecodeAddress(), raw_bytecodes, length); |
3048 | 3049 |
3049 return result; | 3050 return result; |
3050 } | 3051 } |
3051 | 3052 |
3052 void Heap::CreateFillerObjectAt(Address addr, int size, ClearRecordedSlots mode, | 3053 void Heap::CreateFillerObjectAt(Address addr, int size, ClearRecordedSlots mode, |
3053 ClearBlackArea black_area_mode) { | 3054 ClearBlackArea black_area_mode) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3384 result->set_map_no_write_barrier(bytecode_array_map()); | 3385 result->set_map_no_write_barrier(bytecode_array_map()); |
3385 BytecodeArray* copy = BytecodeArray::cast(result); | 3386 BytecodeArray* copy = BytecodeArray::cast(result); |
3386 copy->set_length(bytecode_array->length()); | 3387 copy->set_length(bytecode_array->length()); |
3387 copy->set_frame_size(bytecode_array->frame_size()); | 3388 copy->set_frame_size(bytecode_array->frame_size()); |
3388 copy->set_parameter_count(bytecode_array->parameter_count()); | 3389 copy->set_parameter_count(bytecode_array->parameter_count()); |
3389 copy->set_constant_pool(bytecode_array->constant_pool()); | 3390 copy->set_constant_pool(bytecode_array->constant_pool()); |
3390 copy->set_handler_table(bytecode_array->handler_table()); | 3391 copy->set_handler_table(bytecode_array->handler_table()); |
3391 copy->set_source_position_table(bytecode_array->source_position_table()); | 3392 copy->set_source_position_table(bytecode_array->source_position_table()); |
3392 copy->set_interrupt_budget(bytecode_array->interrupt_budget()); | 3393 copy->set_interrupt_budget(bytecode_array->interrupt_budget()); |
3393 copy->set_osr_loop_nesting_level(bytecode_array->osr_loop_nesting_level()); | 3394 copy->set_osr_loop_nesting_level(bytecode_array->osr_loop_nesting_level()); |
| 3395 copy->set_bytecode_age(bytecode_array->bytecode_age()); |
3394 bytecode_array->CopyBytecodesTo(copy); | 3396 bytecode_array->CopyBytecodesTo(copy); |
3395 return copy; | 3397 return copy; |
3396 } | 3398 } |
3397 | 3399 |
3398 void Heap::InitializeAllocationMemento(AllocationMemento* memento, | 3400 void Heap::InitializeAllocationMemento(AllocationMemento* memento, |
3399 AllocationSite* allocation_site) { | 3401 AllocationSite* allocation_site) { |
3400 memento->set_map_no_write_barrier(allocation_memento_map()); | 3402 memento->set_map_no_write_barrier(allocation_memento_map()); |
3401 DCHECK(allocation_site->map() == allocation_site_map()); | 3403 DCHECK(allocation_site->map() == allocation_site_map()); |
3402 memento->set_allocation_site(allocation_site, SKIP_WRITE_BARRIER); | 3404 memento->set_allocation_site(allocation_site, SKIP_WRITE_BARRIER); |
3403 if (FLAG_allocation_site_pretenuring) { | 3405 if (FLAG_allocation_site_pretenuring) { |
(...skipping 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6479 } | 6481 } |
6480 | 6482 |
6481 | 6483 |
6482 // static | 6484 // static |
6483 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6485 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6484 return StaticVisitorBase::GetVisitorId(map); | 6486 return StaticVisitorBase::GetVisitorId(map); |
6485 } | 6487 } |
6486 | 6488 |
6487 } // namespace internal | 6489 } // namespace internal |
6488 } // namespace v8 | 6490 } // namespace v8 |
OLD | NEW |