OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/compilation-info.h" | 7 #include "src/compilation-info.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 // We use the context register as the scratch register, because we do | 2490 // We use the context register as the scratch register, because we do |
2491 // not have a context here. | 2491 // not have a context here. |
2492 __ PrepareCallCFunction(0, 0, cp); | 2492 __ PrepareCallCFunction(0, 0, cp); |
2493 __ CallCFunction( | 2493 __ CallCFunction( |
2494 ExternalReference::wasm_call_trap_callback_for_testing(isolate()), | 2494 ExternalReference::wasm_call_trap_callback_for_testing(isolate()), |
2495 0); | 2495 0); |
2496 __ LeaveFrame(StackFrame::WASM_COMPILED); | 2496 __ LeaveFrame(StackFrame::WASM_COMPILED); |
2497 __ Ret(); | 2497 __ Ret(); |
2498 } else { | 2498 } else { |
2499 gen_->AssembleSourcePosition(instr_); | 2499 gen_->AssembleSourcePosition(instr_); |
2500 __ Call(handle(isolate()->builtins()->builtin(trap_id), isolate()), | 2500 __ Call(isolate()->builtins()->builtin_handle(trap_id), |
2501 RelocInfo::CODE_TARGET); | 2501 RelocInfo::CODE_TARGET); |
2502 ReferenceMap* reference_map = | 2502 ReferenceMap* reference_map = |
2503 new (gen_->zone()) ReferenceMap(gen_->zone()); | 2503 new (gen_->zone()) ReferenceMap(gen_->zone()); |
2504 gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0, | 2504 gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0, |
2505 Safepoint::kNoLazyDeopt); | 2505 Safepoint::kNoLazyDeopt); |
2506 if (FLAG_debug_code) { | 2506 if (FLAG_debug_code) { |
2507 __ stop(GetBailoutReason(kUnexpectedReturnFromWasmTrap)); | 2507 __ stop(GetBailoutReason(kUnexpectedReturnFromWasmTrap)); |
2508 } | 2508 } |
2509 } | 2509 } |
2510 } | 2510 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2600 GetDeoptimizationReason(deoptimization_id); | 2600 GetDeoptimizationReason(deoptimization_id); |
2601 Deoptimizer::BailoutType bailout_type = | 2601 Deoptimizer::BailoutType bailout_type = |
2602 deoptimization_kind == DeoptimizeKind::kSoft ? Deoptimizer::SOFT | 2602 deoptimization_kind == DeoptimizeKind::kSoft ? Deoptimizer::SOFT |
2603 : Deoptimizer::EAGER; | 2603 : Deoptimizer::EAGER; |
2604 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 2604 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
2605 isolate(), deoptimization_id, bailout_type); | 2605 isolate(), deoptimization_id, bailout_type); |
2606 // TODO(turbofan): We should be able to generate better code by sharing the | 2606 // TODO(turbofan): We should be able to generate better code by sharing the |
2607 // actual final call site and just bl'ing to it here, similar to what we do | 2607 // actual final call site and just bl'ing to it here, similar to what we do |
2608 // in the lithium backend. | 2608 // in the lithium backend. |
2609 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; | 2609 if (deopt_entry == nullptr) return kTooManyDeoptimizationBailouts; |
2610 if (isolate()->NeedsSourcePositionsForProfiling()) { | 2610 if (info()->is_source_positions_enabled()) { |
2611 __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); | 2611 __ RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); |
2612 } | 2612 } |
2613 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 2613 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
2614 return kSuccess; | 2614 return kSuccess; |
2615 } | 2615 } |
2616 | 2616 |
2617 void CodeGenerator::FinishFrame(Frame* frame) { | 2617 void CodeGenerator::FinishFrame(Frame* frame) { |
2618 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 2618 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
2619 const RegList double_saves = descriptor->CalleeSavedFPRegisters(); | 2619 const RegList double_saves = descriptor->CalleeSavedFPRegisters(); |
2620 | 2620 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2965 padding_size -= 2; | 2965 padding_size -= 2; |
2966 } | 2966 } |
2967 } | 2967 } |
2968 } | 2968 } |
2969 | 2969 |
2970 #undef __ | 2970 #undef __ |
2971 | 2971 |
2972 } // namespace compiler | 2972 } // namespace compiler |
2973 } // namespace internal | 2973 } // namespace internal |
2974 } // namespace v8 | 2974 } // namespace v8 |
OLD | NEW |