OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2799 MacroAssembler masm(isolate, NULL, 16 * KB); | 2799 MacroAssembler masm(isolate, NULL, 16 * KB); |
2800 masm.set_emit_debug_code(false); | 2800 masm.set_emit_debug_code(false); |
2801 GenerateDeoptimizationEntries(&masm, entry_count, type); | 2801 GenerateDeoptimizationEntries(&masm, entry_count, type); |
2802 CodeDesc desc; | 2802 CodeDesc desc; |
2803 masm.GetCode(&desc); | 2803 masm.GetCode(&desc); |
2804 DCHECK(!RelocInfo::RequiresRelocation(desc)); | 2804 DCHECK(!RelocInfo::RequiresRelocation(desc)); |
2805 | 2805 |
2806 MemoryChunk* chunk = data->deopt_entry_code_[type]; | 2806 MemoryChunk* chunk = data->deopt_entry_code_[type]; |
2807 CHECK(static_cast<int>(Deoptimizer::GetMaxDeoptTableSize()) >= | 2807 CHECK(static_cast<int>(Deoptimizer::GetMaxDeoptTableSize()) >= |
2808 desc.instr_size); | 2808 desc.instr_size); |
2809 chunk->CommitArea(desc.instr_size); | 2809 if (!chunk->CommitArea(desc.instr_size)) { |
| 2810 V8::FatalProcessOutOfMemory( |
| 2811 "Deoptimizer::EnsureCodeForDeoptimizationEntry"); |
| 2812 } |
2810 CopyBytes(chunk->area_start(), desc.buffer, | 2813 CopyBytes(chunk->area_start(), desc.buffer, |
2811 static_cast<size_t>(desc.instr_size)); | 2814 static_cast<size_t>(desc.instr_size)); |
2812 CpuFeatures::FlushICache(chunk->area_start(), desc.instr_size); | 2815 CpuFeatures::FlushICache(chunk->area_start(), desc.instr_size); |
2813 | 2816 |
2814 data->deopt_entry_code_entries_[type] = entry_count; | 2817 data->deopt_entry_code_entries_[type] = entry_count; |
2815 } | 2818 } |
2816 | 2819 |
2817 | 2820 |
2818 FrameDescription::FrameDescription(uint32_t frame_size, | 2821 FrameDescription::FrameDescription(uint32_t frame_size, |
2819 JSFunction* function) | 2822 JSFunction* function) |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3660 int raw_position = static_cast<int>(info->data()); | 3663 int raw_position = static_cast<int>(info->data()); |
3661 last_position = raw_position ? SourcePosition::FromRaw(raw_position) | 3664 last_position = raw_position ? SourcePosition::FromRaw(raw_position) |
3662 : SourcePosition::Unknown(); | 3665 : SourcePosition::Unknown(); |
3663 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { | 3666 } else if (info->rmode() == RelocInfo::DEOPT_REASON) { |
3664 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); | 3667 last_reason = static_cast<Deoptimizer::DeoptReason>(info->data()); |
3665 } | 3668 } |
3666 } | 3669 } |
3667 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason); | 3670 return DeoptInfo(SourcePosition::Unknown(), NULL, Deoptimizer::kNoReason); |
3668 } | 3671 } |
3669 } } // namespace v8::internal | 3672 } } // namespace v8::internal |
OLD | NEW |