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, |