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/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 3020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3031 AllocationResult allocation = AllocateRaw(size, OLD_SPACE); | 3031 AllocationResult allocation = AllocateRaw(size, OLD_SPACE); |
3032 if (!allocation.To(&result)) return allocation; | 3032 if (!allocation.To(&result)) return allocation; |
3033 } | 3033 } |
3034 | 3034 |
3035 result->set_map_no_write_barrier(bytecode_array_map()); | 3035 result->set_map_no_write_barrier(bytecode_array_map()); |
3036 BytecodeArray* instance = BytecodeArray::cast(result); | 3036 BytecodeArray* instance = BytecodeArray::cast(result); |
3037 instance->set_length(length); | 3037 instance->set_length(length); |
3038 instance->set_frame_size(frame_size); | 3038 instance->set_frame_size(frame_size); |
3039 instance->set_parameter_count(parameter_count); | 3039 instance->set_parameter_count(parameter_count); |
3040 instance->set_interrupt_budget(interpreter::Interpreter::InterruptBudget()); | 3040 instance->set_interrupt_budget(interpreter::Interpreter::InterruptBudget()); |
| 3041 instance->set_osr_loop_nesting_level(0); |
3041 instance->set_constant_pool(constant_pool); | 3042 instance->set_constant_pool(constant_pool); |
3042 instance->set_handler_table(empty_fixed_array()); | 3043 instance->set_handler_table(empty_fixed_array()); |
3043 instance->set_source_position_table(empty_byte_array()); | 3044 instance->set_source_position_table(empty_byte_array()); |
3044 CopyBytes(instance->GetFirstBytecodeAddress(), raw_bytecodes, length); | 3045 CopyBytes(instance->GetFirstBytecodeAddress(), raw_bytecodes, length); |
3045 | 3046 |
3046 return result; | 3047 return result; |
3047 } | 3048 } |
3048 | 3049 |
3049 void Heap::CreateFillerObjectAt(Address addr, int size, | 3050 void Heap::CreateFillerObjectAt(Address addr, int size, |
3050 ClearRecordedSlots mode) { | 3051 ClearRecordedSlots mode) { |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3392 | 3393 |
3393 result->set_map_no_write_barrier(bytecode_array_map()); | 3394 result->set_map_no_write_barrier(bytecode_array_map()); |
3394 BytecodeArray* copy = BytecodeArray::cast(result); | 3395 BytecodeArray* copy = BytecodeArray::cast(result); |
3395 copy->set_length(bytecode_array->length()); | 3396 copy->set_length(bytecode_array->length()); |
3396 copy->set_frame_size(bytecode_array->frame_size()); | 3397 copy->set_frame_size(bytecode_array->frame_size()); |
3397 copy->set_parameter_count(bytecode_array->parameter_count()); | 3398 copy->set_parameter_count(bytecode_array->parameter_count()); |
3398 copy->set_constant_pool(bytecode_array->constant_pool()); | 3399 copy->set_constant_pool(bytecode_array->constant_pool()); |
3399 copy->set_handler_table(bytecode_array->handler_table()); | 3400 copy->set_handler_table(bytecode_array->handler_table()); |
3400 copy->set_source_position_table(bytecode_array->source_position_table()); | 3401 copy->set_source_position_table(bytecode_array->source_position_table()); |
3401 copy->set_interrupt_budget(bytecode_array->interrupt_budget()); | 3402 copy->set_interrupt_budget(bytecode_array->interrupt_budget()); |
| 3403 copy->set_osr_loop_nesting_level(bytecode_array->osr_loop_nesting_level()); |
3402 bytecode_array->CopyBytecodesTo(copy); | 3404 bytecode_array->CopyBytecodesTo(copy); |
3403 return copy; | 3405 return copy; |
3404 } | 3406 } |
3405 | 3407 |
3406 void Heap::InitializeAllocationMemento(AllocationMemento* memento, | 3408 void Heap::InitializeAllocationMemento(AllocationMemento* memento, |
3407 AllocationSite* allocation_site) { | 3409 AllocationSite* allocation_site) { |
3408 memento->set_map_no_write_barrier(allocation_memento_map()); | 3410 memento->set_map_no_write_barrier(allocation_memento_map()); |
3409 DCHECK(allocation_site->map() == allocation_site_map()); | 3411 DCHECK(allocation_site->map() == allocation_site_map()); |
3410 memento->set_allocation_site(allocation_site, SKIP_WRITE_BARRIER); | 3412 memento->set_allocation_site(allocation_site, SKIP_WRITE_BARRIER); |
3411 if (FLAG_allocation_site_pretenuring) { | 3413 if (FLAG_allocation_site_pretenuring) { |
(...skipping 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6448 } | 6450 } |
6449 | 6451 |
6450 | 6452 |
6451 // static | 6453 // static |
6452 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6454 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6453 return StaticVisitorBase::GetVisitorId(map); | 6455 return StaticVisitorBase::GetVisitorId(map); |
6454 } | 6456 } |
6455 | 6457 |
6456 } // namespace internal | 6458 } // namespace internal |
6457 } // namespace v8 | 6459 } // namespace v8 |
OLD | NEW |