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

Unified Diff: src/compiler/s390/code-generator-s390.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 | « src/compiler/ppc/code-generator-ppc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/s390/code-generator-s390.cc
diff --git a/src/compiler/s390/code-generator-s390.cc b/src/compiler/s390/code-generator-s390.cc
index c375c376f78a70c62b34690471d102b34d744bd5..8e9db3dcb01b3a9696207d421e6751e6c81721e2 100644
--- a/src/compiler/s390/code-generator-s390.cc
+++ b/src/compiler/s390/code-generator-s390.cc
@@ -2407,8 +2407,8 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr,
void Generate() final {
S390OperandConverter 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);
@@ -2421,8 +2421,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
@@ -2434,9 +2434,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 | « src/compiler/ppc/code-generator-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698