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