Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Unified Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 2713433003: PPC/s390: [wasm] Use builtins wrappers for traps (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/s390/code-generator-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ppc/code-generator-ppc.cc
diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
index 1c2246a43e11701b4470547f64e54ea8dc1e6be2..455b0ae97e8c500049fe6ed0290127054474b31b 100644
--- a/src/compiler/ppc/code-generator-ppc.cc
+++ b/src/compiler/ppc/code-generator-ppc.cc
@@ -2028,8 +2028,8 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr,
void Generate() final {
PPCOperandConverter i(gen_, instr_);
- Runtime::FunctionId trap_id = static_cast<Runtime::FunctionId>(
- i.InputInt32(instr_->InputCount() - 1));
+ Builtins::Name trap_id =
+ static_cast<Builtins::Name>(i.InputInt32(instr_->InputCount() - 1));
bool old_has_frame = __ has_frame();
if (frame_elided_) {
__ set_has_frame(true);
@@ -2042,8 +2042,8 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr,
}
private:
- void GenerateCallToTrap(Runtime::FunctionId trap_id) {
- if (trap_id == Runtime::kNumFunctions) {
+ void GenerateCallToTrap(Builtins::Name trap_id) {
+ if (trap_id == Builtins::builtin_count) {
// We cannot test calls to the runtime in cctest/test-run-wasm.
// Therefore we emit a call to C here instead of a call to the runtime.
// We use the context register as the scratch register, because we do
@@ -2055,9 +2055,9 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr,
__ LeaveFrame(StackFrame::WASM_COMPILED);
__ Ret();
} else {
- __ Move(cp, Smi::kZero);
gen_->AssembleSourcePosition(instr_);
- __ CallRuntime(trap_id);
+ __ Call(handle(isolate()->builtins()->builtin(trap_id), isolate()),
+ RelocInfo::CODE_TARGET);
ReferenceMap* reference_map =
new (gen_->zone()) ReferenceMap(gen_->zone());
gen_->RecordSafepoint(reference_map, Safepoint::kSimple, 0,
« no previous file with comments | « no previous file | src/compiler/s390/code-generator-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698