Commit 01ef9aef authored by plind44@gmail.com's avatar plind44@gmail.com

MIPS: CodeStubs contain their corresponding Isolate* now. (part 2)

Port r20940 (a5dde97)

Original commit message:
This CL mechanically removes all useless Isolate* parameters from code
stub functions, making things quite a bit simpler.

BUG=359977
LOG=y
R=plind44@gmail.com

Review URL: https://codereview.chromium.org/251473004

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20945 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bb1abb7f
This diff is collapsed.
...@@ -2364,7 +2364,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -2364,7 +2364,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
BinaryOpICStub stub(isolate(), op, mode); BinaryOpICStub stub(isolate(), op, mode);
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ jmp(&done); __ jmp(&done);
...@@ -2443,7 +2443,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, ...@@ -2443,7 +2443,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
__ pop(a1); __ pop(a1);
BinaryOpICStub stub(isolate(), op, mode); BinaryOpICStub stub(isolate(), op, mode);
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId()); CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(v0); context()->Plug(v0);
} }
...@@ -2957,7 +2957,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) { ...@@ -2957,7 +2957,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot()))); __ li(a3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CALL_TARGET); CallConstructStub stub(isolate(), RECORD_CALL_TARGET);
__ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL); __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG); PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(v0); context()->Plug(v0);
} }
...@@ -4467,7 +4467,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -4467,7 +4467,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetSourcePosition(expr->position()); SetSourcePosition(expr->position());
BinaryOpICStub stub(isolate(), Token::ADD, NO_OVERWRITE); BinaryOpICStub stub(isolate(), Token::ADD, NO_OVERWRITE);
CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId()); CallIC(stub.GetCode(), expr->CountBinOpFeedbackId());
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
......
...@@ -1047,17 +1047,17 @@ void LCodeGen::DoCallStub(LCallStub* instr) { ...@@ -1047,17 +1047,17 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
switch (instr->hydrogen()->major_key()) { switch (instr->hydrogen()->major_key()) {
case CodeStub::RegExpExec: { case CodeStub::RegExpExec: {
RegExpExecStub stub(isolate()); RegExpExecStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break; break;
} }
case CodeStub::SubString: { case CodeStub::SubString: {
SubStringStub stub(isolate()); SubStringStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break; break;
} }
case CodeStub::StringCompare: { case CodeStub::StringCompare: {
StringCompareStub stub(isolate()); StringCompareStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break; break;
} }
default: default:
...@@ -2012,7 +2012,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) { ...@@ -2012,7 +2012,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
ASSERT(ToRegister(instr->result()).is(v0)); ASSERT(ToRegister(instr->result()).is(v0));
BinaryOpICStub stub(isolate(), instr->op(), NO_OVERWRITE); BinaryOpICStub stub(isolate(), instr->op(), NO_OVERWRITE);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
// Other arch use a nop here, to signal that there is no inlined // Other arch use a nop here, to signal that there is no inlined
// patchable code. Mips does not need the nop, since our marker // patchable code. Mips does not need the nop, since our marker
// instruction (andi zero_reg) will never be used in normal code. // instruction (andi zero_reg) will never be used in normal code.
...@@ -2654,7 +2654,7 @@ void LCodeGen::DoInstanceOf(LInstanceOf* instr) { ...@@ -2654,7 +2654,7 @@ void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
ASSERT(result.is(v0)); ASSERT(result.is(v0));
InstanceofStub stub(isolate(), InstanceofStub::kArgsInRegisters); InstanceofStub stub(isolate(), InstanceofStub::kArgsInRegisters);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
__ Branch(&true_label, eq, result, Operand(zero_reg)); __ Branch(&true_label, eq, result, Operand(zero_reg));
__ li(result, Operand(factory()->false_value())); __ li(result, Operand(factory()->false_value()));
...@@ -2774,7 +2774,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, ...@@ -2774,7 +2774,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
__ li(temp, Operand(delta * kPointerSize), CONSTANT_SIZE); __ li(temp, Operand(delta * kPointerSize), CONSTANT_SIZE);
__ StoreToSafepointRegisterSlot(temp, temp); __ StoreToSafepointRegisterSlot(temp, temp);
} }
CallCodeGeneric(stub.GetCode(isolate()), CallCodeGeneric(stub.GetCode(),
RelocInfo::CODE_TARGET, RelocInfo::CODE_TARGET,
instr, instr,
RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
...@@ -3969,7 +3969,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) { ...@@ -3969,7 +3969,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
int arity = instr->arity(); int arity = instr->arity();
CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags()); CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
} }
...@@ -3982,7 +3982,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) { ...@@ -3982,7 +3982,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
// No cell in a2 for construct type feedback in optimized code // No cell in a2 for construct type feedback in optimized code
__ LoadRoot(a2, Heap::kUndefinedValueRootIndex); __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
CallConstructStub stub(isolate(), NO_CALL_FUNCTION_FLAGS); CallConstructStub stub(isolate(), NO_CALL_FUNCTION_FLAGS);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
} }
...@@ -4001,7 +4001,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { ...@@ -4001,7 +4001,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
if (instr->arity() == 0) { if (instr->arity() == 0) {
ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
} else if (instr->arity() == 1) { } else if (instr->arity() == 1) {
Label done; Label done;
if (IsFastPackedElementsKind(kind)) { if (IsFastPackedElementsKind(kind)) {
...@@ -4015,17 +4015,17 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) { ...@@ -4015,17 +4015,17 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
ArraySingleArgumentConstructorStub stub(isolate(), ArraySingleArgumentConstructorStub stub(isolate(),
holey_kind, holey_kind,
override_mode); override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ jmp(&done); __ jmp(&done);
__ bind(&packed_case); __ bind(&packed_case);
} }
ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ bind(&done); __ bind(&done);
} else { } else {
ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
} }
} }
...@@ -4459,7 +4459,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) { ...@@ -4459,7 +4459,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) {
StringAddStub stub(isolate(), StringAddStub stub(isolate(),
instr->hydrogen()->flags(), instr->hydrogen()->flags(),
instr->hydrogen()->pretenure_flag()); instr->hydrogen()->pretenure_flag());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
} }
...@@ -5459,7 +5459,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { ...@@ -5459,7 +5459,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
instr->hydrogen()->strict_mode(), instr->hydrogen()->strict_mode(),
instr->hydrogen()->is_generator()); instr->hydrogen()->is_generator());
__ li(a2, Operand(instr->hydrogen()->shared_info())); __ li(a2, Operand(instr->hydrogen()->shared_info()));
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
} else { } else {
__ li(a2, Operand(instr->hydrogen()->shared_info())); __ li(a2, Operand(instr->hydrogen()->shared_info()));
__ li(a1, Operand(pretenure ? factory()->true_value() __ li(a1, Operand(pretenure ? factory()->true_value()
......
...@@ -2365,7 +2365,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { ...@@ -2365,7 +2365,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
} else { } else {
ASSERT(info()->IsStub()); ASSERT(info()->IsStub());
CodeStubInterfaceDescriptor* descriptor = CodeStubInterfaceDescriptor* descriptor =
info()->code_stub()->GetInterfaceDescriptor(info()->isolate()); info()->code_stub()->GetInterfaceDescriptor();
int index = static_cast<int>(instr->index()); int index = static_cast<int>(instr->index());
Register reg = descriptor->GetParameterRegister(index); Register reg = descriptor->GetParameterRegister(index);
return DefineFixed(result, reg); return DefineFixed(result, reg);
......
...@@ -2695,7 +2695,7 @@ void MacroAssembler::DebugBreak() { ...@@ -2695,7 +2695,7 @@ void MacroAssembler::DebugBreak() {
PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate())); PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate()));
CEntryStub ces(isolate(), 1); CEntryStub ces(isolate(), 1);
ASSERT(AllowThisStubCall(&ces)); ASSERT(AllowThisStubCall(&ces));
Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
} }
#endif // ENABLE_DEBUGGER_SUPPORT #endif // ENABLE_DEBUGGER_SUPPORT
...@@ -3894,7 +3894,7 @@ void MacroAssembler::CallStub(CodeStub* stub, ...@@ -3894,7 +3894,7 @@ void MacroAssembler::CallStub(CodeStub* stub,
const Operand& r2, const Operand& r2,
BranchDelaySlot bd) { BranchDelaySlot bd) {
ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs.
Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id, Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id,
cond, r1, r2, bd); cond, r1, r2, bd);
} }
...@@ -3904,7 +3904,7 @@ void MacroAssembler::TailCallStub(CodeStub* stub, ...@@ -3904,7 +3904,7 @@ void MacroAssembler::TailCallStub(CodeStub* stub,
Register r1, Register r1,
const Operand& r2, const Operand& r2,
BranchDelaySlot bd) { BranchDelaySlot bd) {
Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, cond, r1, r2, bd); Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond, r1, r2, bd);
} }
...@@ -4259,7 +4259,7 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, ...@@ -4259,7 +4259,7 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
BranchDelaySlot bd) { BranchDelaySlot bd) {
PrepareCEntryFunction(builtin); PrepareCEntryFunction(builtin);
CEntryStub stub(isolate(), 1); CEntryStub stub(isolate(), 1);
Jump(stub.GetCode(isolate()), Jump(stub.GetCode(),
RelocInfo::CODE_TARGET, RelocInfo::CODE_TARGET,
al, al,
zero_reg, zero_reg,
......
...@@ -1028,13 +1028,13 @@ void LoadStubCompiler::GenerateLoadField(Register reg, ...@@ -1028,13 +1028,13 @@ void LoadStubCompiler::GenerateLoadField(Register reg,
field.is_inobject(holder), field.is_inobject(holder),
field.translate(holder), field.translate(holder),
representation); representation);
GenerateTailCall(masm(), stub.GetCode(isolate())); GenerateTailCall(masm(), stub.GetCode());
} else { } else {
KeyedLoadFieldStub stub(isolate(), KeyedLoadFieldStub stub(isolate(),
field.is_inobject(holder), field.is_inobject(holder),
field.translate(holder), field.translate(holder),
representation); representation);
GenerateTailCall(masm(), stub.GetCode(isolate())); GenerateTailCall(masm(), stub.GetCode());
} }
} }
......
...@@ -57,7 +57,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, ...@@ -57,7 +57,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
DoubleToIStub stub(isolate, source_reg, destination_reg, 0, true, DoubleToIStub stub(isolate, source_reg, destination_reg, 0, true,
inline_fastpath); inline_fastpath);
byte* start = stub.GetCode(isolate)->instruction_start(); byte* start = stub.GetCode()->instruction_start();
Label done; Label done;
// Save callee save registers. // Save callee save registers.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment