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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 instr_(instr) {} | 278 instr_(instr) {} |
279 | 279 |
280 // TODO(eholk): Refactor this method to take the code generator as a | 280 // TODO(eholk): Refactor this method to take the code generator as a |
281 // parameter. | 281 // parameter. |
282 void Generate() final { | 282 void Generate() final { |
283 int current_pc = __ pc_offset(); | 283 int current_pc = __ pc_offset(); |
284 | 284 |
285 gen_->AddProtectedInstruction(pc_, current_pc); | 285 gen_->AddProtectedInstruction(pc_, current_pc); |
286 | 286 |
287 if (frame_elided_) { | 287 if (frame_elided_) { |
288 __ EnterFrame(StackFrame::WASM); | 288 __ EnterFrame(StackFrame::WASM_COMPILED); |
289 } | 289 } |
290 | 290 |
291 wasm::TrapReason trap_id = wasm::kTrapMemOutOfBounds; | 291 wasm::TrapReason trap_id = wasm::kTrapMemOutOfBounds; |
292 int trap_reason = wasm::WasmOpcodes::TrapReasonToMessageId(trap_id); | 292 int trap_reason = wasm::WasmOpcodes::TrapReasonToMessageId(trap_id); |
293 __ Push(Smi::FromInt(trap_reason)); | 293 __ Push(Smi::FromInt(trap_reason)); |
294 __ Push(Smi::FromInt(position_)); | 294 __ Push(Smi::FromInt(position_)); |
295 __ Move(rsi, gen_->isolate()->native_context()); | 295 __ Move(rsi, gen_->isolate()->native_context()); |
296 __ CallRuntime(Runtime::kThrowWasmError); | 296 __ CallRuntime(Runtime::kThrowWasmError); |
297 | 297 |
298 if (instr_->reference_map() != nullptr) { | 298 if (instr_->reference_map() != nullptr) { |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2314 gen_(gen) {} | 2314 gen_(gen) {} |
2315 | 2315 |
2316 void Generate() final { | 2316 void Generate() final { |
2317 X64OperandConverter i(gen_, instr_); | 2317 X64OperandConverter i(gen_, instr_); |
2318 | 2318 |
2319 Runtime::FunctionId trap_id = static_cast<Runtime::FunctionId>( | 2319 Runtime::FunctionId trap_id = static_cast<Runtime::FunctionId>( |
2320 i.InputInt32(instr_->InputCount() - 1)); | 2320 i.InputInt32(instr_->InputCount() - 1)); |
2321 bool old_has_frame = __ has_frame(); | 2321 bool old_has_frame = __ has_frame(); |
2322 if (frame_elided_) { | 2322 if (frame_elided_) { |
2323 __ set_has_frame(true); | 2323 __ set_has_frame(true); |
2324 __ EnterFrame(StackFrame::WASM); | 2324 __ EnterFrame(StackFrame::WASM_COMPILED); |
2325 } | 2325 } |
2326 GenerateCallToTrap(trap_id); | 2326 GenerateCallToTrap(trap_id); |
2327 if (frame_elided_) { | 2327 if (frame_elided_) { |
2328 __ set_has_frame(old_has_frame); | 2328 __ set_has_frame(old_has_frame); |
2329 } | 2329 } |
2330 if (FLAG_debug_code) { | 2330 if (FLAG_debug_code) { |
2331 __ ud2(); | 2331 __ ud2(); |
2332 } | 2332 } |
2333 } | 2333 } |
2334 | 2334 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2854 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2854 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2855 __ Nop(padding_size); | 2855 __ Nop(padding_size); |
2856 } | 2856 } |
2857 } | 2857 } |
2858 | 2858 |
2859 #undef __ | 2859 #undef __ |
2860 | 2860 |
2861 } // namespace compiler | 2861 } // namespace compiler |
2862 } // namespace internal | 2862 } // namespace internal |
2863 } // namespace v8 | 2863 } // namespace v8 |
OLD | NEW |