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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3379 | 3380 |
3380 result->set_map_no_write_barrier(bytecode_array_map()); | 3381 result->set_map_no_write_barrier(bytecode_array_map()); |
3381 BytecodeArray* copy = BytecodeArray::cast(result); | 3382 BytecodeArray* copy = BytecodeArray::cast(result); |
3382 copy->set_length(bytecode_array->length()); | 3383 copy->set_length(bytecode_array->length()); |
3383 copy->set_frame_size(bytecode_array->frame_size()); | 3384 copy->set_frame_size(bytecode_array->frame_size()); |
3384 copy->set_parameter_count(bytecode_array->parameter_count()); | 3385 copy->set_parameter_count(bytecode_array->parameter_count()); |
3385 copy->set_constant_pool(bytecode_array->constant_pool()); | 3386 copy->set_constant_pool(bytecode_array->constant_pool()); |
3386 copy->set_handler_table(bytecode_array->handler_table()); | 3387 copy->set_handler_table(bytecode_array->handler_table()); |
3387 copy->set_source_position_table(bytecode_array->source_position_table()); | 3388 copy->set_source_position_table(bytecode_array->source_position_table()); |
3388 copy->set_interrupt_budget(bytecode_array->interrupt_budget()); | 3389 copy->set_interrupt_budget(bytecode_array->interrupt_budget()); |
| 3390 copy->set_osr_loop_nesting_level(bytecode_array->osr_loop_nesting_level()); |
3389 bytecode_array->CopyBytecodesTo(copy); | 3391 bytecode_array->CopyBytecodesTo(copy); |
3390 return copy; | 3392 return copy; |
3391 } | 3393 } |
3392 | 3394 |
3393 void Heap::InitializeAllocationMemento(AllocationMemento* memento, | 3395 void Heap::InitializeAllocationMemento(AllocationMemento* memento, |
3394 AllocationSite* allocation_site) { | 3396 AllocationSite* allocation_site) { |
3395 memento->set_map_no_write_barrier(allocation_memento_map()); | 3397 memento->set_map_no_write_barrier(allocation_memento_map()); |
3396 DCHECK(allocation_site->map() == allocation_site_map()); | 3398 DCHECK(allocation_site->map() == allocation_site_map()); |
3397 memento->set_allocation_site(allocation_site, SKIP_WRITE_BARRIER); | 3399 memento->set_allocation_site(allocation_site, SKIP_WRITE_BARRIER); |
3398 if (FLAG_allocation_site_pretenuring) { | 3400 if (FLAG_allocation_site_pretenuring) { |
(...skipping 3037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6436 } | 6438 } |
6437 | 6439 |
6438 | 6440 |
6439 // static | 6441 // static |
6440 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6442 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6441 return StaticVisitorBase::GetVisitorId(map); | 6443 return StaticVisitorBase::GetVisitorId(map); |
6442 } | 6444 } |
6443 | 6445 |
6444 } // namespace internal | 6446 } // namespace internal |
6445 } // namespace v8 | 6447 } // namespace v8 |
OLD | NEW |