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

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

BUG=359977
LOG=y
R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
svenpanne@chromium.org 2014-04-24 12:07:40 +00:00
parent d699684beb
commit b8d27f9d38
38 changed files with 418 additions and 584 deletions

View File

@ -39,7 +39,6 @@ namespace internal {
void FastNewClosureStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r2 };
descriptor->register_param_count_ = 1;
@ -50,7 +49,6 @@ void FastNewClosureStub::InitializeInterfaceDescriptor(
void FastNewContextStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1 };
descriptor->register_param_count_ = 1;
@ -60,7 +58,6 @@ void FastNewContextStub::InitializeInterfaceDescriptor(
void ToNumberStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0 };
descriptor->register_param_count_ = 1;
@ -70,7 +67,6 @@ void ToNumberStub::InitializeInterfaceDescriptor(
void NumberToStringStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0 };
descriptor->register_param_count_ = 1;
@ -81,7 +77,6 @@ void NumberToStringStub::InitializeInterfaceDescriptor(
void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r3, r2, r1 };
descriptor->register_param_count_ = 3;
@ -93,7 +88,6 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r3, r2, r1, r0 };
descriptor->register_param_count_ = 4;
@ -104,7 +98,6 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r2, r3 };
descriptor->register_param_count_ = 2;
@ -114,7 +107,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1, r0 };
descriptor->register_param_count_ = 2;
@ -125,7 +117,6 @@ void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1, r0 };
descriptor->register_param_count_ = 2;
@ -136,7 +127,6 @@ void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
void RegExpConstructResultStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r2, r1, r0 };
descriptor->register_param_count_ = 3;
@ -147,7 +137,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor(
void LoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0 };
descriptor->register_param_count_ = 1;
@ -157,7 +146,6 @@ void LoadFieldStub::InitializeInterfaceDescriptor(
void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1 };
descriptor->register_param_count_ = 1;
@ -167,7 +155,6 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
void StringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0, r2 };
descriptor->register_param_count_ = 2;
@ -177,7 +164,6 @@ void StringLengthStub::InitializeInterfaceDescriptor(
void KeyedStringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1, r0 };
descriptor->register_param_count_ = 2;
@ -187,7 +173,6 @@ void KeyedStringLengthStub::InitializeInterfaceDescriptor(
void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r2, r1, r0 };
descriptor->register_param_count_ = 3;
@ -198,7 +183,6 @@ void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
void TransitionElementsKindStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0, r1 };
descriptor->register_param_count_ = 2;
@ -210,7 +194,6 @@ void TransitionElementsKindStub::InitializeInterfaceDescriptor(
void CompareNilICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0 };
descriptor->register_param_count_ = 1;
@ -218,12 +201,11 @@ void CompareNilICStub::InitializeInterfaceDescriptor(
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(CompareNilIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
}
static void InitializeArrayConstructorDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
// register state
@ -252,7 +234,6 @@ static void InitializeArrayConstructorDescriptor(
static void InitializeInternalArrayConstructorDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
// register state
@ -280,28 +261,24 @@ static void InitializeInternalArrayConstructorDescriptor(
void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeArrayConstructorDescriptor(descriptor, 0);
}
void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeArrayConstructorDescriptor(descriptor, 1);
}
void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeArrayConstructorDescriptor(descriptor, -1);
}
void ToBooleanStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0 };
descriptor->register_param_count_ = 1;
@ -309,33 +286,29 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(ToBooleanIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
}
void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeInternalArrayConstructorDescriptor(descriptor, 0);
}
void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeInternalArrayConstructorDescriptor(descriptor, 1);
}
void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeInternalArrayConstructorDescriptor(descriptor, -1);
}
void StoreGlobalStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1, r2, r0 };
descriptor->register_param_count_ = 3;
@ -346,7 +319,6 @@ void StoreGlobalStub::InitializeInterfaceDescriptor(
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r0, r3, r1, r2 };
descriptor->register_param_count_ = 4;
@ -357,19 +329,17 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
void BinaryOpICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1, r0 };
descriptor->register_param_count_ = 2;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
}
void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r2, r1, r0 };
descriptor->register_param_count_ = 3;
@ -380,7 +350,6 @@ void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
void StringAddStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { r1, r0 };
descriptor->register_param_count_ = 2;
@ -506,7 +475,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
// Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment();
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate());
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
int param_count = descriptor->register_param_count_;
{
// Call the runtime system in a fresh internal frame.
@ -729,8 +698,8 @@ void WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime(
Isolate* isolate) {
WriteInt32ToHeapNumberStub stub1(isolate, r1, r0, r2);
WriteInt32ToHeapNumberStub stub2(isolate, r2, r0, r3);
stub1.GetCode(isolate);
stub2.GetCode(isolate);
stub1.GetCode();
stub2.GetCode();
}
@ -1486,12 +1455,12 @@ void CodeStub::GenerateFPStubs(Isolate* isolate) {
// regenerate, which would lead to code stub initialization state being messed
// up.
Code* save_doubles_code;
if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) {
save_doubles_code = *save_doubles.GetCode(isolate);
if (!save_doubles.FindCodeInCache(&save_doubles_code)) {
save_doubles_code = *save_doubles.GetCode();
}
Code* store_buffer_overflow_code;
if (!stub.FindCodeInCache(&store_buffer_overflow_code, isolate)) {
store_buffer_overflow_code = *stub.GetCode(isolate);
if (!stub.FindCodeInCache(&store_buffer_overflow_code)) {
store_buffer_overflow_code = *stub.GetCode();
}
isolate->set_fp_stubs_generated(true);
}
@ -1499,7 +1468,7 @@ void CodeStub::GenerateFPStubs(Isolate* isolate) {
void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
CEntryStub stub(isolate, 1, kDontSaveFPRegs);
stub.GetCode(isolate);
stub.GetCode();
}
@ -3881,7 +3850,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ bind(&generic_stub);
ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC);
__ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
__ bind(&maybe_undefined1);
if (Token::IsOrderedRelationalCompareOp(op_)) {
@ -4136,7 +4105,7 @@ void DirectCEntryStub::Generate(MacroAssembler* masm) {
void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
Register target) {
intptr_t code =
reinterpret_cast<intptr_t>(GetCode(isolate()).location());
reinterpret_cast<intptr_t>(GetCode().location());
__ Move(ip, target);
__ mov(lr, Operand(code, RelocInfo::CODE_TARGET));
__ blx(lr); // Call the stub.
@ -4393,10 +4362,10 @@ void NameDictionaryLookupStub::Generate(MacroAssembler* masm) {
void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(
Isolate* isolate) {
StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs);
stub1.GetCode(isolate);
stub1.GetCode();
// Hydrogen code stubs need stub2 at snapshot time.
StoreBufferOverflowStub stub2(isolate, kSaveFPRegs);
stub2.GetCode(isolate);
stub2.GetCode();
}
@ -4661,7 +4630,7 @@ void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
__ Call(ces.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
int parameter_count_offset =
StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
__ ldr(r1, MemOperand(fp, parameter_count_offset));
@ -4858,10 +4827,10 @@ static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
for (int i = 0; i <= to_index; ++i) {
ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
T stub(isolate, kind);
stub.GetCode(isolate);
stub.GetCode();
if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
stub1.GetCode(isolate);
stub1.GetCode();
}
}
}
@ -4883,11 +4852,11 @@ void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(
for (int i = 0; i < 2; i++) {
// For internal arrays we only need a few things
InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
stubh1.GetCode(isolate);
stubh1.GetCode();
InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
stubh2.GetCode(isolate);
stubh2.GetCode();
InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]);
stubh3.GetCode(isolate);
stubh3.GetCode();
}
}

View File

@ -2354,7 +2354,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call);
BinaryOpICStub stub(isolate(), op, mode);
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
__ jmp(&done);
@ -2431,7 +2431,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
__ pop(r1);
BinaryOpICStub stub(isolate(), op, mode);
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
context()->Plug(r0);
}
@ -2945,7 +2945,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ mov(r3, Operand(Smi::FromInt(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CALL_TARGET);
__ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
__ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(r0);
}
@ -4418,7 +4418,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetSourcePosition(expr->position());
BinaryOpICStub stub(isolate(), Token::ADD, NO_OVERWRITE);
CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId());
CallIC(stub.GetCode(), expr->CountBinOpFeedbackId());
patch_site.EmitPatchInfo();
__ bind(&done);

View File

@ -2414,7 +2414,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
} else {
ASSERT(info()->IsStub());
CodeStubInterfaceDescriptor* descriptor =
info()->code_stub()->GetInterfaceDescriptor(info()->isolate());
info()->code_stub()->GetInterfaceDescriptor();
int index = static_cast<int>(instr->index());
Register reg = descriptor->GetParameterRegister(index);
return DefineFixed(result, reg);

View File

@ -1107,17 +1107,17 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
switch (instr->hydrogen()->major_key()) {
case CodeStub::RegExpExec: {
RegExpExecStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::SubString: {
SubStringStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::StringCompare: {
StringCompareStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
default:
@ -2163,7 +2163,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
// Block literal pool emission to ensure nop indicating no inlined smi code
// is in the correct position.
Assembler::BlockConstPoolScope block_const_pool(masm());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -2755,7 +2755,7 @@ void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
ASSERT(ToRegister(instr->right()).is(r1)); // Function is in r1.
InstanceofStub stub(isolate(), InstanceofStub::kArgsInRegisters);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
__ cmp(r0, Operand::Zero());
__ mov(r0, Operand(factory()->false_value()), LeaveCC, ne);
@ -2873,7 +2873,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
ASSERT_EQ(1, masm_->InstructionsGeneratedSince(&before_push_delta));
__ nop();
}
CallCodeGeneric(stub.GetCode(isolate()),
CallCodeGeneric(stub.GetCode(),
RelocInfo::CODE_TARGET,
instr,
RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
@ -3995,7 +3995,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
int arity = instr->arity();
CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -4008,7 +4008,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
// No cell in r2 for construct type feedback in optimized code
__ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
CallConstructStub stub(isolate(), NO_CALL_FUNCTION_FLAGS);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
}
@ -4027,7 +4027,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
if (instr->arity() == 0) {
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) {
Label done;
if (IsFastPackedElementsKind(kind)) {
@ -4042,17 +4042,17 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
ArraySingleArgumentConstructorStub stub(isolate(),
holey_kind,
override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ jmp(&done);
__ bind(&packed_case);
}
ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ bind(&done);
} else {
ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
}
}
@ -4474,7 +4474,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) {
StringAddStub stub(isolate(),
instr->hydrogen()->flags(),
instr->hydrogen()->pretenure_flag());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -5454,7 +5454,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
instr->hydrogen()->strict_mode(),
instr->hydrogen()->is_generator());
__ mov(r2, Operand(instr->hydrogen()->shared_info()));
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
} else {
__ mov(r2, Operand(instr->hydrogen()->shared_info()));
__ mov(r1, Operand(pretenure ? factory()->true_value()

View File

@ -109,8 +109,7 @@ int MacroAssembler::CallSize(
int MacroAssembler::CallStubSize(
CodeStub* stub, TypeFeedbackId ast_id, Condition cond) {
return CallSize(
stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id, cond);
return CallSize(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id, cond);
}
@ -1342,7 +1341,7 @@ void MacroAssembler::DebugBreak() {
mov(r1, Operand(ExternalReference(Runtime::kDebugBreak, isolate())));
CEntryStub ces(isolate(), 1);
ASSERT(AllowThisStubCall(&ces));
Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK);
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
#endif
@ -2320,12 +2319,12 @@ void MacroAssembler::CallStub(CodeStub* stub,
TypeFeedbackId ast_id,
Condition cond) {
ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs.
Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id, cond);
Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id, cond);
}
void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, cond);
Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
}
@ -2727,7 +2726,7 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
#endif
mov(r1, Operand(builtin));
CEntryStub stub(isolate(), 1);
Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}

View File

@ -1037,13 +1037,13 @@ void LoadStubCompiler::GenerateLoadField(Register reg,
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
} else {
KeyedLoadFieldStub stub(isolate(),
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
}
}

View File

@ -39,7 +39,6 @@ namespace internal {
void FastNewClosureStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x2: function info
static Register registers[] = { x2 };
@ -51,7 +50,6 @@ void FastNewClosureStub::InitializeInterfaceDescriptor(
void FastNewContextStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x1: function
static Register registers[] = { x1 };
@ -62,7 +60,6 @@ void FastNewContextStub::InitializeInterfaceDescriptor(
void ToNumberStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x0: value
static Register registers[] = { x0 };
@ -73,7 +70,6 @@ void ToNumberStub::InitializeInterfaceDescriptor(
void NumberToStringStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x0: value
static Register registers[] = { x0 };
@ -85,7 +81,6 @@ void NumberToStringStub::InitializeInterfaceDescriptor(
void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x3: array literals array
// x2: array literal index
@ -100,7 +95,6 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x3: object literals array
// x2: object literal index
@ -115,7 +109,6 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x2: feedback vector
// x3: call feedback slot
@ -127,7 +120,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x1: receiver
// x0: key
@ -140,7 +132,6 @@ void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x1: receiver
// x0: key
@ -153,7 +144,6 @@ void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
void RegExpConstructResultStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x2: length
// x1: index (of last match)
@ -167,7 +157,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor(
void LoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x0: receiver
static Register registers[] = { x0 };
@ -178,7 +167,6 @@ void LoadFieldStub::InitializeInterfaceDescriptor(
void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x1: receiver
static Register registers[] = { x1 };
@ -189,7 +177,6 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
void StringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { x0, x2 };
descriptor->register_param_count_ = 2;
@ -199,7 +186,6 @@ void StringLengthStub::InitializeInterfaceDescriptor(
void KeyedStringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { x1, x0 };
descriptor->register_param_count_ = 2;
@ -209,7 +195,6 @@ void KeyedStringLengthStub::InitializeInterfaceDescriptor(
void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x2: receiver
// x1: key
@ -223,7 +208,6 @@ void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
void TransitionElementsKindStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x0: value (js_array)
// x1: to_map
@ -237,7 +221,6 @@ void TransitionElementsKindStub::InitializeInterfaceDescriptor(
void CompareNilICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x0: value to compare
static Register registers[] = { x0 };
@ -246,12 +229,11 @@ void CompareNilICStub::InitializeInterfaceDescriptor(
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(CompareNilIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
}
static void InitializeArrayConstructorDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
// x1: function
@ -281,28 +263,24 @@ static void InitializeArrayConstructorDescriptor(
void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeArrayConstructorDescriptor(descriptor, 0);
}
void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeArrayConstructorDescriptor(descriptor, 1);
}
void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeArrayConstructorDescriptor(descriptor, -1);
}
static void InitializeInternalArrayConstructorDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
// x1: constructor function
@ -331,28 +309,24 @@ static void InitializeInternalArrayConstructorDescriptor(
void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeInternalArrayConstructorDescriptor(descriptor, 0);
}
void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeInternalArrayConstructorDescriptor(descriptor, 1);
}
void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeInternalArrayConstructorDescriptor(descriptor, -1);
}
void ToBooleanStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x0: value
static Register registers[] = { x0 };
@ -360,12 +334,11 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ = FUNCTION_ADDR(ToBooleanIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
}
void StoreGlobalStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x1: receiver
// x2: key (unused)
@ -379,7 +352,6 @@ void StoreGlobalStub::InitializeInterfaceDescriptor(
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x0: value
// x3: target map
@ -394,7 +366,6 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
void BinaryOpICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x1: left operand
// x0: right operand
@ -403,12 +374,11 @@ void BinaryOpICStub::InitializeInterfaceDescriptor(
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
}
void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x2: allocation site
// x1: left operand
@ -422,7 +392,6 @@ void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
void StringAddStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
// x1: left operand
// x0: right operand
@ -536,7 +505,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
// Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment();
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate());
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
int param_count = descriptor->register_param_count_;
{
// Call the runtime system in a fresh internal frame.
@ -1125,9 +1094,9 @@ void StoreBufferOverflowStub::Generate(MacroAssembler* masm) {
void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(
Isolate* isolate) {
StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs);
stub1.GetCode(isolate);
stub1.GetCode();
StoreBufferOverflowStub stub2(isolate, kSaveFPRegs);
stub2.GetCode(isolate);
stub2.GetCode();
}
@ -1432,17 +1401,17 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
void StoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) {
StoreRegistersStateStub stub1(isolate, kDontSaveFPRegs);
stub1.GetCode(isolate);
stub1.GetCode();
StoreRegistersStateStub stub2(isolate, kSaveFPRegs);
stub2.GetCode(isolate);
stub2.GetCode();
}
void RestoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) {
RestoreRegistersStateStub stub1(isolate, kDontSaveFPRegs);
stub1.GetCode(isolate);
stub1.GetCode();
RestoreRegistersStateStub stub2(isolate, kSaveFPRegs);
stub2.GetCode(isolate);
stub2.GetCode();
}
@ -1468,9 +1437,9 @@ bool CEntryStub::NeedsImmovableCode() {
void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
CEntryStub stub(isolate, 1, kDontSaveFPRegs);
stub.GetCode(isolate);
stub.GetCode();
CEntryStub stub_fp(isolate, 1, kSaveFPRegs);
stub_fp.GetCode(isolate);
stub_fp.GetCode();
}
@ -3558,7 +3527,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ Bind(&unordered);
ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC);
__ Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
__ Bind(&maybe_undefined1);
if (Token::IsOrderedRelationalCompareOp(op_)) {
@ -4581,7 +4550,7 @@ void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
__ Call(ces.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
int parameter_count_offset =
StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
__ Ldr(x1, MemOperand(fp, parameter_count_offset));
@ -4687,7 +4656,7 @@ void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
ASSERT(csp.Is(__ StackPointer()));
intptr_t code =
reinterpret_cast<intptr_t>(GetCode(isolate()).location());
reinterpret_cast<intptr_t>(GetCode().location());
__ Mov(lr, Operand(code, RelocInfo::CODE_TARGET));
__ Mov(x10, target);
// Branch to the stub.
@ -5062,10 +5031,10 @@ static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
for (int i = 0; i <= to_index; ++i) {
ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
T stub(isolate, kind);
stub.GetCode(isolate);
stub.GetCode();
if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
stub1.GetCode(isolate);
stub1.GetCode();
}
}
}
@ -5087,11 +5056,11 @@ void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(
for (int i = 0; i < 2; i++) {
// For internal arrays we only need a few things
InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
stubh1.GetCode(isolate);
stubh1.GetCode();
InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
stubh2.GetCode(isolate);
stubh2.GetCode();
InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]);
stubh3.GetCode(isolate);
stubh3.GetCode();
}
}

View File

@ -2043,7 +2043,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
BinaryOpICStub stub(isolate(), op, mode);
{
Assembler::BlockPoolsScope scope(masm_);
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
}
__ B(&done);
@ -2129,7 +2129,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code.
{
Assembler::BlockPoolsScope scope(masm_);
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
}
context()->Plug(x0);
@ -2660,7 +2660,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ Mov(x3, Smi::FromInt(expr->CallNewFeedbackSlot()));
CallConstructStub stub(isolate(), RECORD_CALL_TARGET);
__ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
__ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(x0);
}
@ -4130,7 +4130,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
{
Assembler::BlockPoolsScope scope(masm_);
BinaryOpICStub stub(isolate(), Token::ADD, NO_OVERWRITE);
CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId());
CallIC(stub.GetCode(), expr->CountBinOpFeedbackId());
patch_site.EmitPatchInfo();
}
__ Bind(&done);

View File

@ -1963,7 +1963,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
} else {
ASSERT(info()->IsStub());
CodeStubInterfaceDescriptor* descriptor =
info()->code_stub()->GetInterfaceDescriptor(info()->isolate());
info()->code_stub()->GetInterfaceDescriptor();
int index = static_cast<int>(instr->index());
Register reg = descriptor->GetParameterRegister(index);
return DefineFixed(result, reg);

View File

@ -431,7 +431,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
int arity = instr->arity();
CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -445,7 +445,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
__ LoadRoot(x2, Heap::kUndefinedValueRootIndex);
CallConstructStub stub(isolate(), NO_CALL_FUNCTION_FLAGS);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
ASSERT(ToRegister(instr->result()).is(x0));
}
@ -467,7 +467,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
if (instr->arity() == 0) {
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) {
Label done;
if (IsFastPackedElementsKind(kind)) {
@ -481,17 +481,17 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
ArraySingleArgumentConstructorStub stub(isolate(),
holey_kind,
override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ B(&done);
__ Bind(&packed_case);
}
ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ Bind(&done);
} else {
ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
}
ASSERT(ToRegister(instr->result()).is(x0));
@ -1741,7 +1741,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
ASSERT(ToRegister(instr->result()).is(x0));
BinaryOpICStub stub(isolate(), instr->op(), NO_OVERWRITE);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -2052,17 +2052,17 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
switch (instr->hydrogen()->major_key()) {
case CodeStub::RegExpExec: {
RegExpExecStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::SubString: {
SubStringStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::StringCompare: {
StringCompareStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
default:
@ -2794,7 +2794,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
instr->hydrogen()->strict_mode(),
instr->hydrogen()->is_generator());
__ Mov(x2, Operand(instr->hydrogen()->shared_info()));
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
} else {
__ Mov(x2, Operand(instr->hydrogen()->shared_info()));
__ Mov(x1, Operand(pretenure ? factory()->true_value()
@ -2967,7 +2967,7 @@ void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
ASSERT(ToRegister(instr->right()).Is(InstanceofStub::right()));
InstanceofStub stub(isolate(), InstanceofStub::kArgsInRegisters);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
// InstanceofStub returns a result in x0:
// 0 => not an instance
@ -3082,7 +3082,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) {
__ LoadObject(InstanceofStub::right(), instr->function());
InstanceofStub stub(isolate(), flags);
CallCodeGeneric(stub.GetCode(isolate()),
CallCodeGeneric(stub.GetCode(),
RelocInfo::CODE_TARGET,
instr,
RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
@ -5318,7 +5318,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) {
StringAddStub stub(isolate(),
instr->hydrogen()->flags(),
instr->hydrogen()->pretenure_flag());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}

View File

@ -1621,12 +1621,12 @@ void MacroAssembler::AssertString(Register object) {
void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) {
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);
}
void MacroAssembler::TailCallStub(CodeStub* stub) {
Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET);
Jump(stub->GetCode(), RelocInfo::CODE_TARGET);
}
@ -1821,7 +1821,7 @@ void MacroAssembler::CallExternalReference(const ExternalReference& ext,
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
Mov(x1, builtin);
CEntryStub stub(isolate(), 1);
Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}
@ -3192,7 +3192,7 @@ void MacroAssembler::DebugBreak() {
Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate()));
CEntryStub ces(isolate(), 1);
ASSERT(AllowThisStubCall(&ces));
Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK);
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
#endif

View File

@ -998,13 +998,13 @@ void LoadStubCompiler::GenerateLoadField(Register reg,
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
} else {
KeyedLoadFieldStub stub(isolate(),
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
}
}

View File

@ -873,7 +873,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,
// Cache the array maps, needed by ArrayConstructorStub
CacheInitialJSArrayMaps(native_context(), initial_map);
ArrayConstructorStub array_constructor_stub(isolate);
Handle<Code> code = array_constructor_stub.GetCode(isolate);
Handle<Code> code = array_constructor_stub.GetCode();
array_function->shared()->set_construct_stub(*code);
}
@ -1598,7 +1598,7 @@ Handle<JSFunction> Genesis::InstallInternalArray(
Accessors::FunctionSetPrototype(array_function, prototype);
InternalArrayConstructorStub internal_array_constructor_stub(isolate());
Handle<Code> code = internal_array_constructor_stub.GetCode(isolate());
Handle<Code> code = internal_array_constructor_stub.GetCode();
array_function->shared()->set_construct_stub(*code);
array_function->shared()->DontAdaptArguments();

View File

@ -60,7 +60,7 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
arguments_length_(NULL),
info_(stub, isolate),
context_(NULL) {
descriptor_ = stub->GetInterfaceDescriptor(isolate);
descriptor_ = stub->GetInterfaceDescriptor();
parameters_.Reset(new HParameter*[descriptor_->register_param_count_]);
}
virtual bool BuildGraph();
@ -238,15 +238,15 @@ class CodeStubGraphBuilder: public CodeStubGraphBuilderBase {
};
Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode(Isolate* isolate) {
Factory* factory = isolate->factory();
Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode() {
Factory* factory = isolate()->factory();
// Generate the new code.
MacroAssembler masm(isolate, NULL, 256);
MacroAssembler masm(isolate(), NULL, 256);
{
// Update the static counter each time a new code stub is generated.
isolate->counters()->code_stubs()->Increment();
isolate()->counters()->code_stubs()->Increment();
// Generate the code for the stub.
masm.set_generating_stub(true);
@ -271,13 +271,14 @@ Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode(Isolate* isolate) {
template <class Stub>
static Handle<Code> DoGenerateCode(Isolate* isolate, Stub* stub) {
static Handle<Code> DoGenerateCode(Stub* stub) {
Isolate* isolate = stub->isolate();
CodeStub::Major major_key =
static_cast<HydrogenCodeStub*>(stub)->MajorKey();
CodeStubInterfaceDescriptor* descriptor =
isolate->code_stub_interface_descriptor(major_key);
if (descriptor->register_param_count_ < 0) {
stub->InitializeInterfaceDescriptor(isolate, descriptor);
stub->InitializeInterfaceDescriptor(descriptor);
}
// If we are uninitialized we can use a light-weight stub to enter
@ -285,7 +286,7 @@ static Handle<Code> DoGenerateCode(Isolate* isolate, Stub* stub) {
// stub-failure deopt mechanism.
if (stub->IsUninitialized() && descriptor->has_miss_handler()) {
ASSERT(!descriptor->stack_parameter_count_.is_valid());
return stub->GenerateLightweightMissCode(isolate);
return stub->GenerateLightweightMissCode();
}
ElapsedTimer timer;
if (FLAG_profile_hydrogen_code_stub_compilation) {
@ -329,8 +330,8 @@ HValue* CodeStubGraphBuilder<ToNumberStub>::BuildCodeStub() {
}
Handle<Code> ToNumberStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> ToNumberStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -342,8 +343,8 @@ HValue* CodeStubGraphBuilder<NumberToStringStub>::BuildCodeStub() {
}
Handle<Code> NumberToStringStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> NumberToStringStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -416,8 +417,8 @@ HValue* CodeStubGraphBuilder<FastCloneShallowArrayStub>::BuildCodeStub() {
}
Handle<Code> FastCloneShallowArrayStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> FastCloneShallowArrayStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -483,8 +484,8 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
}
Handle<Code> FastCloneShallowObjectStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> FastCloneShallowObjectStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -553,8 +554,8 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
}
Handle<Code> CreateAllocationSiteStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> CreateAllocationSiteStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -568,8 +569,8 @@ HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() {
}
Handle<Code> KeyedLoadFastElementStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> KeyedLoadFastElementStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -602,8 +603,8 @@ HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() {
}
Handle<Code> LoadFieldStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> LoadFieldStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -616,8 +617,8 @@ HValue* CodeStubGraphBuilder<StringLengthStub>::BuildCodeStub() {
}
Handle<Code> StringLengthStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> StringLengthStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -632,8 +633,8 @@ HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
}
Handle<Code> KeyedStoreFastElementStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> KeyedStoreFastElementStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -651,8 +652,8 @@ HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
}
Handle<Code> TransitionElementsKindStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> TransitionElementsKindStub::GenerateCode() {
return DoGenerateCode(this);
}
HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
@ -768,8 +769,8 @@ HValue* CodeStubGraphBuilder<ArrayNoArgumentConstructorStub>::BuildCodeStub() {
}
Handle<Code> ArrayNoArgumentConstructorStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> ArrayNoArgumentConstructorStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -782,9 +783,8 @@ HValue* CodeStubGraphBuilder<ArraySingleArgumentConstructorStub>::
}
Handle<Code> ArraySingleArgumentConstructorStub::GenerateCode(
Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> ArraySingleArgumentConstructorStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -796,8 +796,8 @@ HValue* CodeStubGraphBuilder<ArrayNArgumentsConstructorStub>::BuildCodeStub() {
}
Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -809,9 +809,8 @@ HValue* CodeStubGraphBuilder<InternalArrayNoArgumentConstructorStub>::
}
Handle<Code> InternalArrayNoArgumentConstructorStub::GenerateCode(
Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> InternalArrayNoArgumentConstructorStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -823,9 +822,8 @@ HValue* CodeStubGraphBuilder<InternalArraySingleArgumentConstructorStub>::
}
Handle<Code> InternalArraySingleArgumentConstructorStub::GenerateCode(
Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> InternalArraySingleArgumentConstructorStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -837,9 +835,8 @@ HValue* CodeStubGraphBuilder<InternalArrayNArgumentsConstructorStub>::
}
Handle<Code> InternalArrayNArgumentsConstructorStub::GenerateCode(
Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> InternalArrayNArgumentsConstructorStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -864,8 +861,8 @@ HValue* CodeStubGraphBuilder<CompareNilICStub>::BuildCodeInitializedStub() {
}
Handle<Code> CompareNilICStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> CompareNilICStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -977,8 +974,8 @@ HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
}
Handle<Code> BinaryOpICStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> BinaryOpICStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1002,8 +999,8 @@ HValue* CodeStubGraphBuilder<BinaryOpWithAllocationSiteStub>::BuildCodeStub() {
}
Handle<Code> BinaryOpWithAllocationSiteStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> BinaryOpWithAllocationSiteStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1028,8 +1025,8 @@ HValue* CodeStubGraphBuilder<StringAddStub>::BuildCodeInitializedStub() {
}
Handle<Code> StringAddStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> StringAddStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1047,8 +1044,8 @@ HValue* CodeStubGraphBuilder<ToBooleanStub>::BuildCodeInitializedStub() {
}
Handle<Code> ToBooleanStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> ToBooleanStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1100,8 +1097,8 @@ HValue* CodeStubGraphBuilder<StoreGlobalStub>::BuildCodeInitializedStub() {
}
Handle<Code> StoreGlobalStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> StoreGlobalStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1134,8 +1131,8 @@ HValue* CodeStubGraphBuilder<ElementsTransitionAndStoreStub>::BuildCodeStub() {
}
Handle<Code> ElementsTransitionAndStoreStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1344,8 +1341,8 @@ HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() {
}
Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> FastNewClosureStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1399,8 +1396,8 @@ HValue* CodeStubGraphBuilder<FastNewContextStub>::BuildCodeStub() {
}
Handle<Code> FastNewContextStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> FastNewContextStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1415,8 +1412,8 @@ HValue* CodeStubGraphBuilder<KeyedLoadDictionaryElementStub>::BuildCodeStub() {
}
Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> KeyedLoadDictionaryElementStub::GenerateCode() {
return DoGenerateCode(this);
}
@ -1431,8 +1428,8 @@ HValue* CodeStubGraphBuilder<RegExpConstructResultStub>::BuildCodeStub() {
}
Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) {
return DoGenerateCode(isolate, this);
Handle<Code> RegExpConstructResultStub::GenerateCode() {
return DoGenerateCode(this);
}

View File

@ -51,8 +51,8 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
has_miss_handler_(false) { }
bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) {
UnseededNumberDictionary* stubs = isolate->heap()->code_stubs();
bool CodeStub::FindCodeInCache(Code** code_out) {
UnseededNumberDictionary* stubs = isolate()->heap()->code_stubs();
int index = stubs->FindEntry(GetKey());
if (index != UnseededNumberDictionary::kNotFound) {
*code_out = Code::cast(stubs->ValueAt(index));
@ -72,12 +72,12 @@ SmartArrayPointer<const char> CodeStub::GetName() {
}
void CodeStub::RecordCodeGeneration(Handle<Code> code, Isolate* isolate) {
void CodeStub::RecordCodeGeneration(Handle<Code> code) {
IC::RegisterWeakMapDependency(code);
SmartArrayPointer<const char> name = GetName();
PROFILE(isolate, CodeCreateEvent(Logger::STUB_TAG, *code, name.get()));
PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, name.get()));
GDBJIT(AddCode(GDBJITInterface::STUB, name.get(), *code));
Counters* counters = isolate->counters();
Counters* counters = isolate()->counters();
counters->total_stubs_code_size()->Increment(code->instruction_size());
}
@ -87,25 +87,24 @@ Code::Kind CodeStub::GetCodeKind() const {
}
Handle<Code> CodeStub::GetCodeCopy(Isolate* isolate,
const Code::FindAndReplacePattern& pattern) {
Handle<Code> ic = GetCode(isolate);
ic = isolate->factory()->CopyCode(ic);
Handle<Code> CodeStub::GetCodeCopy(const Code::FindAndReplacePattern& pattern) {
Handle<Code> ic = GetCode();
ic = isolate()->factory()->CopyCode(ic);
ic->FindAndReplace(pattern);
RecordCodeGeneration(ic, isolate);
RecordCodeGeneration(ic);
return ic;
}
Handle<Code> PlatformCodeStub::GenerateCode(Isolate* isolate) {
Factory* factory = isolate->factory();
Handle<Code> PlatformCodeStub::GenerateCode() {
Factory* factory = isolate()->factory();
// Generate the new code.
MacroAssembler masm(isolate, NULL, 256);
MacroAssembler masm(isolate(), NULL, 256);
{
// Update the static counter each time a new code stub is generated.
isolate->counters()->code_stubs()->Increment();
isolate()->counters()->code_stubs()->Increment();
// Generate the code for the stub.
masm.set_generating_stub(true);
@ -129,36 +128,36 @@ Handle<Code> PlatformCodeStub::GenerateCode(Isolate* isolate) {
}
void CodeStub::VerifyPlatformFeatures(Isolate* isolate) {
void CodeStub::VerifyPlatformFeatures() {
ASSERT(CpuFeatures::VerifyCrossCompiling());
}
Handle<Code> CodeStub::GetCode(Isolate* isolate) {
Heap* heap = isolate->heap();
Handle<Code> CodeStub::GetCode() {
Heap* heap = isolate()->heap();
Code* code;
if (UseSpecialCache()
? FindCodeInSpecialCache(&code, isolate)
: FindCodeInCache(&code, isolate)) {
? FindCodeInSpecialCache(&code)
: FindCodeInCache(&code)) {
ASSERT(GetCodeKind() == code->kind());
return Handle<Code>(code);
}
#ifdef DEBUG
VerifyPlatformFeatures(isolate);
VerifyPlatformFeatures();
#endif
{
HandleScope scope(isolate);
HandleScope scope(isolate());
Handle<Code> new_object = GenerateCode(isolate);
Handle<Code> new_object = GenerateCode();
new_object->set_major_key(MajorKey());
FinishCode(new_object);
RecordCodeGeneration(new_object, isolate);
RecordCodeGeneration(new_object);
#ifdef ENABLE_DISASSEMBLER
if (FLAG_print_code_stubs) {
CodeTracer::Scope trace_scope(isolate->GetCodeTracer());
CodeTracer::Scope trace_scope(isolate()->GetCodeTracer());
new_object->Disassemble(GetName().get(), trace_scope.file());
PrintF(trace_scope.file(), "\n");
}
@ -182,7 +181,7 @@ Handle<Code> CodeStub::GetCode(Isolate* isolate) {
ASSERT(!NeedsImmovableCode() ||
heap->lo_space()->Contains(code) ||
heap->code_space()->FirstPage()->Contains(code->address()));
return Handle<Code>(code, isolate);
return Handle<Code>(code, isolate());
}
@ -221,7 +220,7 @@ void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate) {
BinaryOpICStub stub(isolate,
static_cast<Token::Value>(op),
static_cast<OverwriteMode>(mode));
stub.GetCode(isolate);
stub.GetCode();
}
}
@ -239,7 +238,7 @@ void BinaryOpICStub::PrintState(StringStream* stream) {
void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate,
const BinaryOpIC::State& state) {
BinaryOpICStub stub(isolate, state);
stub.GetCode(isolate);
stub.GetCode();
}
@ -260,7 +259,7 @@ void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(
Isolate* isolate, const BinaryOpIC::State& state) {
if (state.CouldCreateAllocationMementos()) {
BinaryOpICWithAllocationSiteStub stub(isolate, state);
stub.GetCode(isolate);
stub.GetCode();
}
}
@ -313,8 +312,8 @@ void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) {
}
bool ICCompareStub::FindCodeInSpecialCache(Code** code_out, Isolate* isolate) {
Factory* factory = isolate->factory();
bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) {
Factory* factory = isolate()->factory();
Code::Flags flags = Code::ComputeFlags(
GetCodeKind(),
UNINITIALIZED);
@ -325,7 +324,7 @@ bool ICCompareStub::FindCodeInSpecialCache(Code** code_out, Isolate* isolate) {
*factory->strict_compare_ic_string() :
*factory->compare_ic_string(),
flags),
isolate);
isolate());
if (probe->IsCode()) {
*code_out = Code::cast(*probe);
#ifdef DEBUG
@ -541,7 +540,7 @@ void KeyedLoadDictionaryElementPlatformStub::Generate(
void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
CreateAllocationSiteStub stub(isolate);
stub.GetCode(isolate);
stub.GetCode();
}
@ -698,8 +697,8 @@ bool ToBooleanStub::Types::CanBeUndetectable() const {
void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
StubFailureTrampolineStub stub1(isolate, NOT_JS_FUNCTION_STUB_MODE);
StubFailureTrampolineStub stub2(isolate, JS_FUNCTION_STUB_MODE);
stub1.GetCode(isolate);
stub2.GetCode(isolate);
stub1.GetCode();
stub2.GetCode();
}
@ -717,7 +716,7 @@ static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) {
CodeStubInterfaceDescriptor* descriptor =
isolate->code_stub_interface_descriptor(major_key);
if (!descriptor->initialized()) {
stub->InitializeInterfaceDescriptor(isolate, descriptor);
stub->InitializeInterfaceDescriptor(descriptor);
}
}

View File

@ -154,11 +154,10 @@ class CodeStub BASE_EMBEDDED {
};
// Retrieve the code for the stub. Generate the code if needed.
Handle<Code> GetCode(Isolate* isolate);
Handle<Code> GetCode();
// Retrieve the code for the stub, make and return a copy of the code.
Handle<Code> GetCodeCopy(
Isolate* isolate, const Code::FindAndReplacePattern& pattern);
Handle<Code> GetCodeCopy(const Code::FindAndReplacePattern& pattern);
static Major MajorKeyFromKey(uint32_t key) {
return static_cast<Major>(MajorKeyBits::decode(key));
@ -189,7 +188,7 @@ class CodeStub BASE_EMBEDDED {
virtual bool SometimesSetsUpAFrame() { return true; }
// Lookup the code in the (possibly custom) cache.
bool FindCodeInCache(Code** code_out, Isolate* isolate);
bool FindCodeInCache(Code** code_out);
// Returns information for computing the number key.
virtual Major MajorKey() = 0;
@ -216,9 +215,9 @@ class CodeStub BASE_EMBEDDED {
static bool CanUseFPRegisters();
// Generates the assembler code for the stub.
virtual Handle<Code> GenerateCode(Isolate* isolate) = 0;
virtual Handle<Code> GenerateCode() = 0;
virtual void VerifyPlatformFeatures(Isolate* isolate);
virtual void VerifyPlatformFeatures();
// Returns whether the code generated for this stub needs to be allocated as
// a fixed (non-moveable) code object.
@ -230,7 +229,7 @@ class CodeStub BASE_EMBEDDED {
private:
// Perform bookkeeping required after code generation when stub code is
// initially generated.
void RecordCodeGeneration(Handle<Code> code, Isolate* isolate);
void RecordCodeGeneration(Handle<Code> code);
// Finish the code object after it has been generated.
virtual void FinishCode(Handle<Code> code) { }
@ -248,7 +247,7 @@ class CodeStub BASE_EMBEDDED {
virtual void AddToSpecialCache(Handle<Code> new_object) { }
// Find code in a specialized cache, work is delegated to the specific stub.
virtual bool FindCodeInSpecialCache(Code** code_out, Isolate* isolate) {
virtual bool FindCodeInSpecialCache(Code** code_out) {
return false;
}
@ -278,7 +277,7 @@ class PlatformCodeStub : public CodeStub {
explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) { }
// Retrieve the code for the stub. Generate the code if needed.
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual Code::Kind GetCodeKind() const { return Code::STUB; }
@ -399,8 +398,8 @@ class HydrogenCodeStub : public CodeStub {
virtual Code::Kind GetCodeKind() const { return Code::STUB; }
CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate) {
return isolate->code_stub_interface_descriptor(MajorKey());
CodeStubInterfaceDescriptor* GetInterfaceDescriptor() {
return isolate()->code_stub_interface_descriptor(MajorKey());
}
bool IsUninitialized() { return is_uninitialized_; }
@ -412,15 +411,14 @@ class HydrogenCodeStub : public CodeStub {
}
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) = 0;
// Retrieve the code for the stub. Generate the code if needed.
virtual Handle<Code> GenerateCode(Isolate* isolate) = 0;
virtual Handle<Code> GenerateCode() = 0;
virtual int NotMissMinorKey() = 0;
Handle<Code> GenerateLightweightMissCode(Isolate* isolate);
Handle<Code> GenerateLightweightMissCode();
template<class StateType>
void TraceTransition(StateType from, StateType to);
@ -503,16 +501,14 @@ class ToNumberStub: public HydrogenCodeStub {
public:
explicit ToNumberStub(Isolate* isolate) : HydrogenCodeStub(isolate) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate) {
ToNumberStub stub(isolate);
stub.InitializeInterfaceDescriptor(
isolate,
isolate->code_stub_interface_descriptor(CodeStub::ToNumber));
}
@ -526,10 +522,9 @@ class NumberToStringStub V8_FINAL : public HydrogenCodeStub {
public:
explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate);
@ -552,11 +547,10 @@ class FastNewClosureStub : public HydrogenCodeStub {
strict_mode_(strict_mode),
is_generator_(is_generator) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate);
@ -587,11 +581,10 @@ class FastNewContextStub V8_FINAL : public HydrogenCodeStub {
ASSERT(slots_ > 0 && slots_ <= kMaximumSlots);
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate);
@ -654,11 +647,10 @@ class FastCloneShallowArrayStub : public HydrogenCodeStub {
return LAST_ELEMENTS_KIND;
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate);
@ -696,11 +688,10 @@ class FastCloneShallowObjectStub : public HydrogenCodeStub {
int length() const { return length_; }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
int length_;
@ -717,13 +708,12 @@ class CreateAllocationSiteStub : public HydrogenCodeStub {
explicit CreateAllocationSiteStub(Isolate* isolate)
: HydrogenCodeStub(isolate) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
static void GenerateAheadOfTime(Isolate* isolate);
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
Major MajorKey() { return CreateAllocationSite; }
@ -921,11 +911,10 @@ class LoadFieldStub: public HandlerStub {
Initialize(Code::LOAD_IC, inobject, index, representation);
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
Representation representation() {
if (unboxed_double()) return Representation::Double();
@ -980,10 +969,9 @@ class StringLengthStub: public HandlerStub {
explicit StringLengthStub(Isolate* isolate) : HandlerStub(isolate) {
Initialize(Code::LOAD_IC);
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
protected:
virtual Code::Kind kind() const {
@ -1005,8 +993,7 @@ class KeyedStringLengthStub: public StringLengthStub {
Initialize(Code::KEYED_LOAD_IC);
}
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
virtual CodeStub::Major MajorKey() { return KeyedStringLength; }
@ -1025,29 +1012,27 @@ class StoreGlobalStub : public HandlerStub {
return isolate->factory()->uninitialized_value();
}
Handle<Code> GetCodeCopyFromTemplate(Isolate* isolate,
Handle<GlobalObject> global,
Handle<Code> GetCodeCopyFromTemplate(Handle<GlobalObject> global,
Handle<PropertyCell> cell) {
if (check_global()) {
Code::FindAndReplacePattern pattern;
pattern.Add(Handle<Map>(global_placeholder(isolate)->map()), global);
pattern.Add(isolate->factory()->meta_map(), Handle<Map>(global->map()));
pattern.Add(isolate->factory()->global_property_cell_map(), cell);
return CodeStub::GetCodeCopy(isolate, pattern);
pattern.Add(Handle<Map>(global_placeholder(isolate())->map()), global);
pattern.Add(isolate()->factory()->meta_map(), Handle<Map>(global->map()));
pattern.Add(isolate()->factory()->global_property_cell_map(), cell);
return CodeStub::GetCodeCopy(pattern);
} else {
Code::FindAndReplacePattern pattern;
pattern.Add(isolate->factory()->global_property_cell_map(), cell);
return CodeStub::GetCodeCopy(isolate, pattern);
pattern.Add(isolate()->factory()->global_property_cell_map(), cell);
return CodeStub::GetCodeCopy(pattern);
}
}
virtual Code::Kind kind() const { return Code::STORE_IC; }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
bool is_constant() const {
return IsConstantBits::decode(bit_field_);
@ -1128,8 +1113,7 @@ class KeyedLoadFieldStub: public LoadFieldStub {
}
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
virtual CodeStub::Major MajorKey() { return KeyedLoadField; }
@ -1147,7 +1131,7 @@ class BinaryOpICStub : public HydrogenCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
virtual void InitializeInterfaceDescriptor(
Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate);
@ -1163,11 +1147,11 @@ class BinaryOpICStub : public HydrogenCodeStub {
return state_.GetExtraICState();
}
virtual void VerifyPlatformFeatures(Isolate* isolate) V8_FINAL V8_OVERRIDE {
virtual void VerifyPlatformFeatures() V8_FINAL V8_OVERRIDE {
ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
}
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
const BinaryOpIC::State& state() const { return state_; }
@ -1202,11 +1186,10 @@ class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
Handle<Code> GetCodeCopyFromTemplate(Isolate* isolate,
Handle<AllocationSite> allocation_site) {
Handle<Code> GetCodeCopyFromTemplate(Handle<AllocationSite> allocation_site) {
Code::FindAndReplacePattern pattern;
pattern.Add(isolate->factory()->undefined_map(), allocation_site);
return CodeStub::GetCodeCopy(isolate, pattern);
pattern.Add(isolate()->factory()->undefined_map(), allocation_site);
return CodeStub::GetCodeCopy(pattern);
}
virtual Code::Kind GetCodeKind() const V8_OVERRIDE {
@ -1221,7 +1204,7 @@ class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub {
return state_.GetExtraICState();
}
virtual void VerifyPlatformFeatures(Isolate* isolate) V8_OVERRIDE {
virtual void VerifyPlatformFeatures() V8_OVERRIDE {
ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
}
@ -1254,7 +1237,7 @@ class BinaryOpWithAllocationSiteStub V8_FINAL : public BinaryOpICStub {
: BinaryOpICStub(isolate, state) {}
virtual void InitializeInterfaceDescriptor(
Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate);
@ -1262,7 +1245,7 @@ class BinaryOpWithAllocationSiteStub V8_FINAL : public BinaryOpICStub {
return Code::STUB;
}
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual Major MajorKey() V8_OVERRIDE {
return BinaryOpWithAllocationSite;
@ -1304,14 +1287,13 @@ class StringAddStub V8_FINAL : public HydrogenCodeStub {
return PretenureFlagBits::decode(bit_field_);
}
virtual void VerifyPlatformFeatures(Isolate* isolate) V8_OVERRIDE {
virtual void VerifyPlatformFeatures() V8_OVERRIDE {
ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
}
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate);
@ -1390,7 +1372,7 @@ class ICCompareStub: public PlatformCodeStub {
Condition GetCondition() const { return CompareIC::ComputeCondition(op_); }
virtual void AddToSpecialCache(Handle<Code> new_object);
virtual bool FindCodeInSpecialCache(Code** code_out, Isolate* isolate);
virtual bool FindCodeInSpecialCache(Code** code_out);
virtual bool UseSpecialCache() { return state_ == CompareIC::KNOWN_OBJECT; }
Token::Value op_;
@ -1419,17 +1401,15 @@ class CompareNilICStub : public HydrogenCodeStub {
static Handle<Code> GetUninitialized(Isolate* isolate,
NilValue nil) {
return CompareNilICStub(isolate, nil, UNINITIALIZED).GetCode(isolate);
return CompareNilICStub(isolate, nil, UNINITIALIZED).GetCode();
}
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
static void InstallDescriptors(Isolate* isolate) {
CompareNilICStub compare_stub(isolate, kNullValue, UNINITIALIZED);
compare_stub.InitializeInterfaceDescriptor(
isolate,
isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC));
}
@ -1445,7 +1425,7 @@ class CompareNilICStub : public HydrogenCodeStub {
virtual Code::Kind GetCodeKind() const { return Code::COMPARE_NIL_IC; }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual ExtraICState GetExtraICState() {
return NilValueField::encode(nil_value_) |
@ -1521,13 +1501,12 @@ class CEntryStub : public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
protected:
virtual void VerifyPlatformFeatures(Isolate* isolate) V8_OVERRIDE {
virtual void VerifyPlatformFeatures() V8_OVERRIDE {
ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
};
private:
// Number of pointers/values returned.
Isolate* isolate_;
const int result_size_;
SaveFPRegsMode save_doubles_;
@ -1617,10 +1596,9 @@ class RegExpConstructResultStub V8_FINAL : public HydrogenCodeStub {
explicit RegExpConstructResultStub(Isolate* isolate)
: HydrogenCodeStub(isolate) { }
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
virtual Major MajorKey() V8_OVERRIDE { return RegExpConstructResult; }
@ -1891,10 +1869,9 @@ class KeyedLoadDictionaryElementStub : public HydrogenCodeStub {
explicit KeyedLoadDictionaryElementStub(Isolate* isolate)
: HydrogenCodeStub(isolate) {}
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
@ -1963,7 +1940,7 @@ class DoubleToIStub : public PlatformCodeStub {
virtual bool SometimesSetsUpAFrame() { return false; }
protected:
virtual void VerifyPlatformFeatures(Isolate* isolate) V8_OVERRIDE {
virtual void VerifyPlatformFeatures() V8_OVERRIDE {
ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
}
@ -2011,11 +1988,10 @@ class KeyedLoadFastElementStub : public HydrogenCodeStub {
return ElementsKindBits::decode(bit_field_);
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
@ -2053,11 +2029,10 @@ class KeyedStoreFastElementStub : public HydrogenCodeStub {
return StoreModeBits::decode(bit_field_);
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
@ -2095,11 +2070,10 @@ class TransitionElementsKindStub : public HydrogenCodeStub {
return IsJSArrayBits::decode(bit_field_);
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
class FromKindBits: public BitField<ElementsKind, 8, 8> {};
@ -2171,11 +2145,10 @@ class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase {
: ArrayConstructorStubBase(isolate, kind, override_mode) {
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
Major MajorKey() { return ArrayNoArgumentConstructor; }
@ -2197,11 +2170,10 @@ class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase {
: ArrayConstructorStubBase(isolate, kind, override_mode) {
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
Major MajorKey() { return ArraySingleArgumentConstructor; }
@ -2223,11 +2195,10 @@ class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
: ArrayConstructorStubBase(isolate, kind, override_mode) {
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
Major MajorKey() { return ArrayNArgumentsConstructor; }
@ -2271,11 +2242,10 @@ class InternalArrayNoArgumentConstructorStub : public
ElementsKind kind)
: InternalArrayConstructorStubBase(isolate, kind) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
Major MajorKey() { return InternalArrayNoArgumentConstructor; }
@ -2291,11 +2261,10 @@ class InternalArraySingleArgumentConstructorStub : public
ElementsKind kind)
: InternalArrayConstructorStubBase(isolate, kind) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
Major MajorKey() { return InternalArraySingleArgumentConstructor; }
@ -2310,11 +2279,10 @@ class InternalArrayNArgumentsConstructorStub : public
InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind)
: InternalArrayConstructorStubBase(isolate, kind) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
Major MajorKey() { return InternalArrayNArgumentsConstructor; }
@ -2401,10 +2369,9 @@ class ToBooleanStub: public HydrogenCodeStub {
bool UpdateStatus(Handle<Object> object);
Types GetTypes() { return types_; }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
virtual Code::Kind GetCodeKind() const { return Code::TO_BOOLEAN_IC; }
virtual void PrintState(StringStream* stream);
@ -2414,12 +2381,11 @@ class ToBooleanStub: public HydrogenCodeStub {
static void InstallDescriptors(Isolate* isolate) {
ToBooleanStub stub(isolate);
stub.InitializeInterfaceDescriptor(
isolate,
isolate->code_stub_interface_descriptor(CodeStub::ToBoolean));
}
static Handle<Code> GetUninitialized(Isolate* isolate) {
return ToBooleanStub(isolate, UNINITIALIZED).GetCode(isolate);
return ToBooleanStub(isolate, UNINITIALIZED).GetCode();
}
virtual ExtraICState GetExtraICState() {
@ -2463,11 +2429,10 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub {
bool is_jsarray() const { return is_jsarray_; }
KeyedAccessStoreMode store_mode() const { return store_mode_; }
virtual Handle<Code> GenerateCode(Isolate* isolate);
virtual Handle<Code> GenerateCode() V8_OVERRIDE;
void InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
virtual void InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
private:
class FromBits: public BitField<ElementsKind, 0, 8> {};

View File

@ -1781,8 +1781,7 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
Code* trampoline = NULL;
StubFunctionMode function_mode = descriptor->function_mode_;
StubFailureTrampolineStub(isolate_,
function_mode).FindCodeInCache(&trampoline,
isolate_);
function_mode).FindCodeInCache(&trampoline);
ASSERT(trampoline != NULL);
output_frame->SetPc(reinterpret_cast<intptr_t>(
trampoline->instruction_start()));

View File

@ -1404,13 +1404,13 @@ Address StubFailureTrampolineFrame::GetCallerStackPointer() const {
Code* StubFailureTrampolineFrame::unchecked_code() const {
Code* trampoline;
StubFailureTrampolineStub(isolate(), NOT_JS_FUNCTION_STUB_MODE).
FindCodeInCache(&trampoline, isolate());
FindCodeInCache(&trampoline);
if (trampoline->contains(pc())) {
return trampoline;
}
StubFailureTrampolineStub(isolate(), JS_FUNCTION_STUB_MODE).
FindCodeInCache(&trampoline, isolate());
FindCodeInCache(&trampoline);
if (trampoline->contains(pc())) {
return trampoline;
}

View File

@ -2780,13 +2780,13 @@ bool Heap::CreateApiObjects() {
void Heap::CreateJSEntryStub() {
JSEntryStub stub(isolate());
set_js_entry_code(*stub.GetCode(isolate()));
set_js_entry_code(*stub.GetCode());
}
void Heap::CreateJSConstructEntryStub() {
JSConstructEntryStub stub(isolate());
set_js_construct_entry_code(*stub.GetCode(isolate()));
set_js_construct_entry_code(*stub.GetCode());
}

View File

@ -3097,8 +3097,7 @@ HGraph::HGraph(CompilationInfo* info)
inlined_functions_(5, info->zone()) {
if (info->IsStub()) {
HydrogenCodeStub* stub = info->code_stub();
CodeStubInterfaceDescriptor* descriptor =
stub->GetInterfaceDescriptor(isolate_);
CodeStubInterfaceDescriptor* descriptor = stub->GetInterfaceDescriptor();
start_environment_ =
new(zone_) HEnvironment(zone_, descriptor->environment_length());
} else {
@ -8009,7 +8008,7 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function,
isolate()->call_descriptor(Isolate::ApiFunctionCall);
CallApiFunctionStub stub(isolate(), is_store, call_data_is_undefined, argc);
Handle<Code> code = stub.GetCode(isolate());
Handle<Code> code = stub.GetCode();
HConstant* code_value = Add<HConstant>(code);
ASSERT((sizeof(op_vals) / kPointerSize) ==

View File

@ -44,7 +44,6 @@ namespace internal {
void FastNewClosureStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { ebx };
descriptor->register_param_count_ = 1;
@ -55,7 +54,6 @@ void FastNewClosureStub::InitializeInterfaceDescriptor(
void FastNewContextStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edi };
descriptor->register_param_count_ = 1;
@ -65,7 +63,6 @@ void FastNewContextStub::InitializeInterfaceDescriptor(
void ToNumberStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax };
descriptor->register_param_count_ = 1;
@ -75,7 +72,6 @@ void ToNumberStub::InitializeInterfaceDescriptor(
void NumberToStringStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax };
descriptor->register_param_count_ = 1;
@ -86,7 +82,6 @@ void NumberToStringStub::InitializeInterfaceDescriptor(
void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax, ebx, ecx };
descriptor->register_param_count_ = 3;
@ -98,7 +93,6 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax, ebx, ecx, edx };
descriptor->register_param_count_ = 4;
@ -109,7 +103,6 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { ebx, edx };
descriptor->register_param_count_ = 2;
@ -119,7 +112,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, ecx };
descriptor->register_param_count_ = 2;
@ -130,7 +122,6 @@ void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, ecx };
descriptor->register_param_count_ = 2;
@ -141,7 +132,6 @@ void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
void RegExpConstructResultStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { ecx, ebx, eax };
descriptor->register_param_count_ = 3;
@ -152,7 +142,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor(
void LoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx };
descriptor->register_param_count_ = 1;
@ -162,7 +151,6 @@ void LoadFieldStub::InitializeInterfaceDescriptor(
void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx };
descriptor->register_param_count_ = 1;
@ -172,7 +160,6 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
void StringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, ecx };
descriptor->register_param_count_ = 2;
@ -182,7 +169,6 @@ void StringLengthStub::InitializeInterfaceDescriptor(
void KeyedStringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, ecx };
descriptor->register_param_count_ = 2;
@ -192,7 +178,6 @@ void KeyedStringLengthStub::InitializeInterfaceDescriptor(
void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, ecx, eax };
descriptor->register_param_count_ = 3;
@ -203,7 +188,6 @@ void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
void TransitionElementsKindStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax, ebx };
descriptor->register_param_count_ = 2;
@ -243,7 +227,6 @@ static void InitializeArrayConstructorDescriptor(
static void InitializeInternalArrayConstructorDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
// register state
@ -271,49 +254,42 @@ static void InitializeInternalArrayConstructorDescriptor(
void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeArrayConstructorDescriptor(isolate(), descriptor, 0);
}
void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeArrayConstructorDescriptor(isolate(), descriptor, 1);
}
void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeArrayConstructorDescriptor(isolate(), descriptor, -1);
}
void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeInternalArrayConstructorDescriptor(descriptor, 0);
}
void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeInternalArrayConstructorDescriptor(descriptor, 1);
}
void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeInternalArrayConstructorDescriptor(descriptor, -1);
}
void CompareNilICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax };
descriptor->register_param_count_ = 1;
@ -321,11 +297,10 @@ void CompareNilICStub::InitializeInterfaceDescriptor(
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(CompareNilIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
}
void ToBooleanStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax };
descriptor->register_param_count_ = 1;
@ -333,12 +308,11 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(ToBooleanIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
}
void StoreGlobalStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, ecx, eax };
descriptor->register_param_count_ = 3;
@ -349,7 +323,6 @@ void StoreGlobalStub::InitializeInterfaceDescriptor(
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { eax, ebx, ecx, edx };
descriptor->register_param_count_ = 4;
@ -360,19 +333,17 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
void BinaryOpICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, eax };
descriptor->register_param_count_ = 2;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
}
void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { ecx, edx, eax };
descriptor->register_param_count_ = 3;
@ -383,7 +354,6 @@ void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
void StringAddStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { edx, eax };
descriptor->register_param_count_ = 2;
@ -484,7 +454,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
// Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment();
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate());
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
int param_count = descriptor->register_param_count_;
{
// Call the runtime system in a fresh internal frame.
@ -2563,8 +2533,8 @@ void CodeStub::GenerateFPStubs(Isolate* isolate) {
// Stubs might already be in the snapshot, detect that and don't regenerate,
// which would lead to code stub initialization state being messed up.
Code* save_doubles_code;
if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) {
save_doubles_code = *(save_doubles.GetCode(isolate));
if (!save_doubles.FindCodeInCache(&save_doubles_code)) {
save_doubles_code = *(save_doubles.GetCode());
}
isolate->set_fp_stubs_generated(true);
}
@ -2573,7 +2543,7 @@ void CodeStub::GenerateFPStubs(Isolate* isolate) {
void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
CEntryStub stub(isolate, 1, kDontSaveFPRegs);
stub.GetCode(isolate);
stub.GetCode();
}
@ -3778,7 +3748,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ bind(&generic_stub);
ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC);
__ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
__ bind(&maybe_undefined1);
if (Token::IsOrderedRelationalCompareOp(op_)) {
@ -4263,10 +4233,10 @@ void NameDictionaryLookupStub::Generate(MacroAssembler* masm) {
void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(
Isolate* isolate) {
StoreBufferOverflowStub stub(isolate, kDontSaveFPRegs);
stub.GetCode(isolate);
stub.GetCode();
if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
StoreBufferOverflowStub stub2(isolate, kSaveFPRegs);
stub2.GetCode(isolate);
stub2.GetCode();
}
}
@ -4557,7 +4527,7 @@ void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
__ call(ces.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ call(ces.GetCode(), RelocInfo::CODE_TARGET);
int parameter_count_offset =
StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
__ mov(ebx, MemOperand(ebp, parameter_count_offset));
@ -4728,10 +4698,10 @@ static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
for (int i = 0; i <= to_index; ++i) {
ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
T stub(isolate, kind);
stub.GetCode(isolate);
stub.GetCode();
if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
stub1.GetCode(isolate);
stub1.GetCode();
}
}
}
@ -4753,11 +4723,11 @@ void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(
for (int i = 0; i < 2; i++) {
// For internal arrays we only need a few things
InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
stubh1.GetCode(isolate);
stubh1.GetCode();
InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
stubh2.GetCode(isolate);
stubh2.GetCode();
InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]);
stubh3.GetCode(isolate);
stubh3.GetCode();
}
}

View File

@ -2297,7 +2297,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call);
__ mov(eax, ecx);
BinaryOpICStub stub(isolate(), op, mode);
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
__ jmp(&done, Label::kNear);
@ -2381,7 +2381,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
__ pop(edx);
BinaryOpICStub stub(isolate(), op, mode);
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
context()->Plug(eax);
}
@ -2889,7 +2889,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ mov(edx, Immediate(Smi::FromInt(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CALL_TARGET);
__ call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
__ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(eax);
}
@ -4426,7 +4426,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ mov(edx, eax);
__ mov(eax, Immediate(Smi::FromInt(1)));
BinaryOpICStub stub(isolate(), expr->binary_op(), NO_OVERWRITE);
CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId());
CallIC(stub.GetCode(), expr->CountBinOpFeedbackId());
patch_site.EmitPatchInfo();
__ bind(&done);

View File

@ -1351,17 +1351,17 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
switch (instr->hydrogen()->major_key()) {
case CodeStub::RegExpExec: {
RegExpExecStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::SubString: {
SubStringStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::StringCompare: {
StringCompareStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
default:
@ -2358,7 +2358,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
ASSERT(ToRegister(instr->result()).is(eax));
BinaryOpICStub stub(isolate(), instr->op(), NO_OVERWRITE);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -2976,7 +2976,7 @@ void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
// Object and function are in fixed registers defined by the stub.
ASSERT(ToRegister(instr->context()).is(esi));
InstanceofStub stub(isolate(), InstanceofStub::kArgsInRegisters);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
Label true_value, done;
__ test(eax, Operand(eax));
@ -3077,7 +3077,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
int delta = masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalDelta;
__ mov(temp, Immediate(delta));
__ StoreToSafepointRegisterSlot(temp, temp);
CallCodeGeneric(stub.GetCode(isolate()),
CallCodeGeneric(stub.GetCode(),
RelocInfo::CODE_TARGET,
instr,
RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
@ -4276,7 +4276,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
int arity = instr->arity();
CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -4289,7 +4289,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
__ mov(ebx, isolate()->factory()->undefined_value());
CallConstructStub stub(isolate(), NO_CALL_FUNCTION_FLAGS);
__ Move(eax, Immediate(instr->arity()));
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
}
@ -4308,7 +4308,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
if (instr->arity() == 0) {
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) {
Label done;
if (IsFastPackedElementsKind(kind)) {
@ -4323,17 +4323,17 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
ArraySingleArgumentConstructorStub stub(isolate(),
holey_kind,
override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ jmp(&done, Label::kNear);
__ bind(&packed_case);
}
ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ bind(&done);
} else {
ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
}
}
@ -4912,7 +4912,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) {
StringAddStub stub(isolate(),
instr->hydrogen()->flags(),
instr->hydrogen()->pretenure_flag());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -6050,7 +6050,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
instr->hydrogen()->strict_mode(),
instr->hydrogen()->is_generator());
__ mov(ebx, Immediate(instr->hydrogen()->shared_info()));
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
} else {
__ push(esi);
__ push(Immediate(instr->hydrogen()->shared_info()));

View File

@ -2537,7 +2537,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
} else {
ASSERT(info()->IsStub());
CodeStubInterfaceDescriptor* descriptor =
info()->code_stub()->GetInterfaceDescriptor(info()->isolate());
info()->code_stub()->GetInterfaceDescriptor();
int index = static_cast<int>(instr->index());
Register reg = descriptor->GetParameterRegister(index);
return DefineFixed(result, reg);

View File

@ -248,7 +248,7 @@ void MacroAssembler::SlowTruncateToI(Register result_reg,
Register input_reg,
int offset) {
DoubleToIStub stub(isolate(), input_reg, result_reg, offset, true);
call(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
call(stub.GetCode(), RelocInfo::CODE_TARGET);
}
@ -720,7 +720,7 @@ void MacroAssembler::DebugBreak() {
Move(eax, Immediate(0));
mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate())));
CEntryStub ces(isolate(), 1);
call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK);
call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
#endif
@ -2184,12 +2184,12 @@ void MacroAssembler::TryGetFunctionPrototype(Register function,
void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) {
ASSERT(AllowThisStubCall(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);
}
void MacroAssembler::TailCallStub(CodeStub* stub) {
jmp(stub->GetCode(isolate()), RelocInfo::CODE_TARGET);
jmp(stub->GetCode(), RelocInfo::CODE_TARGET);
}
@ -2456,7 +2456,7 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) {
// Set the entry point and jump to the C entry runtime stub.
mov(ebx, Immediate(ext));
CEntryStub ces(isolate(), 1);
jmp(ces.GetCode(isolate()), RelocInfo::CODE_TARGET);
jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
}

View File

@ -1037,13 +1037,13 @@ void LoadStubCompiler::GenerateLoadField(Register reg,
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
} else {
KeyedLoadFieldStub stub(isolate(),
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
}
}

View File

@ -589,7 +589,7 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) {
stub = pre_monomorphic_stub();
} else if (state() == PREMONOMORPHIC) {
FunctionPrototypeStub function_prototype_stub(isolate(), kind());
stub = function_prototype_stub.GetCode(isolate());
stub = function_prototype_stub.GetCode();
} else if (state() != MEGAMORPHIC) {
ASSERT(state() != GENERIC);
stub = megamorphic_stub();
@ -852,10 +852,10 @@ Handle<Code> LoadIC::SimpleFieldLoad(int offset,
Representation representation) {
if (kind() == Code::LOAD_IC) {
LoadFieldStub stub(isolate(), inobject, offset, representation);
return stub.GetCode(isolate());
return stub.GetCode();
} else {
KeyedLoadFieldStub stub(isolate(), inobject, offset, representation);
return stub.GetCode(isolate());
return stub.GetCode();
}
}
@ -941,10 +941,10 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup,
String::Equals(isolate()->factory()->length_string(), name)) {
if (kind() == Code::LOAD_IC) {
StringLengthStub string_length_stub(isolate());
return string_length_stub.GetCode(isolate());
return string_length_stub.GetCode();
} else {
KeyedStringLengthStub string_length_stub(isolate());
return string_length_stub.GetCode(isolate());
return string_length_stub.GetCode();
}
}
@ -1425,8 +1425,7 @@ Handle<Code> StoreIC::CompileHandler(LookupResult* lookup,
Handle<HeapType> union_type = PropertyCell::UpdatedType(cell, value);
StoreGlobalStub stub(
isolate(), union_type->IsConstant(), receiver->IsJSGlobalProxy());
Handle<Code> code = stub.GetCodeCopyFromTemplate(
isolate(), global, cell);
Handle<Code> code = stub.GetCodeCopyFromTemplate(global, cell);
// TODO(verwaest): Move caching of these NORMAL stubs outside as well.
HeapObject::UpdateMapCodeCache(receiver, name, code);
return code;
@ -2513,14 +2512,14 @@ MaybeHandle<Object> BinaryOpIC::Transition(
// Install the stub with an allocation site.
BinaryOpICWithAllocationSiteStub stub(isolate(), state);
target = stub.GetCodeCopyFromTemplate(isolate(), allocation_site);
target = stub.GetCodeCopyFromTemplate(allocation_site);
// Sanity check the trampoline stub.
ASSERT_EQ(*allocation_site, target->FindFirstAllocationSite());
} else {
// Install the generic stub.
BinaryOpICStub stub(isolate(), state);
target = stub.GetCode(isolate());
target = stub.GetCode();
// Sanity check the generic stub.
ASSERT_EQ(NULL, target->FindFirstAllocationSite());
@ -2593,14 +2592,14 @@ RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite) {
Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op) {
ICCompareStub stub(isolate, op, UNINITIALIZED, UNINITIALIZED, UNINITIALIZED);
Code* code = NULL;
CHECK(stub.FindCodeInCache(&code, isolate));
CHECK(stub.FindCodeInCache(&code));
return code;
}
Handle<Code> CompareIC::GetUninitialized(Isolate* isolate, Token::Value op) {
ICCompareStub stub(isolate, op, UNINITIALIZED, UNINITIALIZED, UNINITIALIZED);
return stub.GetCode(isolate);
return stub.GetCode();
}
@ -2777,7 +2776,7 @@ Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
stub.set_known_map(
Handle<Map>(Handle<JSObject>::cast(x)->map(), isolate()));
}
Handle<Code> new_target = stub.GetCode(isolate());
Handle<Code> new_target = stub.GetCode();
set_target(*new_target);
if (FLAG_trace_ic) {
@ -2791,7 +2790,7 @@ Code* CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
GetStateName(new_right),
GetStateName(state),
Token::Name(op_),
static_cast<void*>(*stub.GetCode(isolate())));
static_cast<void*>(*stub.GetCode()));
}
// Activate inlined smi code.
@ -2824,7 +2823,7 @@ void CompareNilIC::Clear(Address address,
stub.ClearState();
Code* code = NULL;
CHECK(stub.FindCodeInCache(&code, target->GetIsolate()));
CHECK(stub.FindCodeInCache(&code));
SetTargetAtAddress(address, code, constant_pool);
}
@ -2861,7 +2860,7 @@ Handle<Object> CompareNilIC::CompareNil(Handle<Object> object) {
: HeapObject::cast(*object)->map());
code = isolate()->stub_cache()->ComputeCompareNil(monomorphic_map, stub);
} else {
code = stub.GetCode(isolate());
code = stub.GetCode();
}
set_target(*code);
return DoCompareNilSlow(isolate(), nil, object);
@ -2927,7 +2926,7 @@ Builtins::JavaScript BinaryOpIC::TokenToJSBuiltin(Token::Value op) {
Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) {
ToBooleanStub stub(isolate(), target()->extra_ic_state());
bool to_boolean_value = stub.UpdateStatus(object);
Handle<Code> code = stub.GetCode(isolate());
Handle<Code> code = stub.GetCode();
set_target(*code);
return handle(Smi::FromInt(to_boolean_value ? 1 : 0), isolate());
}

View File

@ -335,7 +335,7 @@ Handle<Code> StubCache::ComputeCompareNil(Handle<Map> receiver_map,
Code::FindAndReplacePattern pattern;
pattern.Add(isolate_->factory()->meta_map(), receiver_map);
Handle<Code> ic = stub.GetCodeCopy(isolate_, pattern);
Handle<Code> ic = stub.GetCodeCopy(pattern);
if (!receiver_map->is_shared()) {
Map::UpdateCodeCache(receiver_map, name, ic);
@ -1190,12 +1190,12 @@ Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(
Handle<Code> stub = KeyedLoadFastElementStub(
isolate(),
receiver_map->instance_type() == JS_ARRAY_TYPE,
elements_kind).GetCode(isolate());
elements_kind).GetCode();
__ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK);
} else {
Handle<Code> stub = FLAG_compiled_keyed_dictionary_loads
? KeyedLoadDictionaryElementStub(isolate()).GetCode(isolate())
: KeyedLoadDictionaryElementPlatformStub(isolate()).GetCode(isolate());
? KeyedLoadDictionaryElementStub(isolate()).GetCode()
: KeyedLoadDictionaryElementPlatformStub(isolate()).GetCode();
__ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK);
}
@ -1218,12 +1218,12 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(
isolate(),
is_jsarray,
elements_kind,
store_mode()).GetCode(isolate());
store_mode()).GetCode();
} else {
stub = KeyedStoreElementStub(isolate(),
is_jsarray,
elements_kind,
store_mode()).GetCode(isolate());
store_mode()).GetCode();
}
__ DispatchMap(receiver(), scratch1(), receiver_map, stub, DO_SMI_CHECK);
@ -1319,13 +1319,13 @@ void KeyedLoadStubCompiler::CompileElementHandlers(MapHandleList* receiver_maps,
cached_stub =
KeyedLoadFastElementStub(isolate(),
is_js_array,
elements_kind).GetCode(isolate());
elements_kind).GetCode();
} else if (elements_kind == SLOPPY_ARGUMENTS_ELEMENTS) {
cached_stub = isolate()->builtins()->KeyedLoadIC_SloppyArguments();
} else {
ASSERT(elements_kind == DICTIONARY_ELEMENTS);
cached_stub =
KeyedLoadDictionaryElementStub(isolate()).GetCode(isolate());
KeyedLoadDictionaryElementStub(isolate()).GetCode();
}
}
@ -1358,7 +1358,7 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElementPolymorphic(
elements_kind,
transitioned_map->elements_kind(),
is_js_array,
store_mode()).GetCode(isolate());
store_mode()).GetCode();
} else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) {
cached_stub = isolate()->builtins()->KeyedStoreIC_Slow();
} else {
@ -1369,13 +1369,13 @@ Handle<Code> KeyedStoreStubCompiler::CompileStoreElementPolymorphic(
isolate(),
is_js_array,
elements_kind,
store_mode()).GetCode(isolate());
store_mode()).GetCode();
} else {
cached_stub = KeyedStoreElementStub(
isolate(),
is_js_array,
elements_kind,
store_mode()).GetCode(isolate());
store_mode()).GetCode();
}
}
ASSERT(!cached_stub.is_null());

View File

@ -40,7 +40,6 @@ namespace internal {
void FastNewClosureStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rbx };
descriptor->register_param_count_ = 1;
@ -51,7 +50,6 @@ void FastNewClosureStub::InitializeInterfaceDescriptor(
void FastNewContextStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdi };
descriptor->register_param_count_ = 1;
@ -61,7 +59,6 @@ void FastNewContextStub::InitializeInterfaceDescriptor(
void ToNumberStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax };
descriptor->register_param_count_ = 1;
@ -71,7 +68,6 @@ void ToNumberStub::InitializeInterfaceDescriptor(
void NumberToStringStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax };
descriptor->register_param_count_ = 1;
@ -82,7 +78,6 @@ void NumberToStringStub::InitializeInterfaceDescriptor(
void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax, rbx, rcx };
descriptor->register_param_count_ = 3;
@ -94,7 +89,6 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor(
void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax, rbx, rcx, rdx };
descriptor->register_param_count_ = 4;
@ -105,7 +99,6 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor(
void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rbx, rdx };
descriptor->register_param_count_ = 2;
@ -115,7 +108,6 @@ void CreateAllocationSiteStub::InitializeInterfaceDescriptor(
void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx, rax };
descriptor->register_param_count_ = 2;
@ -126,7 +118,6 @@ void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx, rax };
descriptor->register_param_count_ = 2;
@ -137,7 +128,6 @@ void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
void RegExpConstructResultStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rcx, rbx, rax };
descriptor->register_param_count_ = 3;
@ -148,7 +138,6 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor(
void LoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax };
descriptor->register_param_count_ = 1;
@ -158,7 +147,6 @@ void LoadFieldStub::InitializeInterfaceDescriptor(
void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx };
descriptor->register_param_count_ = 1;
@ -168,7 +156,6 @@ void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
void StringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax, rcx };
descriptor->register_param_count_ = 2;
@ -178,7 +165,6 @@ void StringLengthStub::InitializeInterfaceDescriptor(
void KeyedStringLengthStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx, rax };
descriptor->register_param_count_ = 2;
@ -188,7 +174,6 @@ void KeyedStringLengthStub::InitializeInterfaceDescriptor(
void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx, rcx, rax };
descriptor->register_param_count_ = 3;
@ -199,7 +184,6 @@ void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
void TransitionElementsKindStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax, rbx };
descriptor->register_param_count_ = 2;
@ -210,7 +194,6 @@ void TransitionElementsKindStub::InitializeInterfaceDescriptor(
static void InitializeArrayConstructorDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
// register state
@ -239,7 +222,6 @@ static void InitializeArrayConstructorDescriptor(
static void InitializeInternalArrayConstructorDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor,
int constant_stack_parameter_count) {
// register state
@ -267,49 +249,42 @@ static void InitializeInternalArrayConstructorDescriptor(
void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeArrayConstructorDescriptor(descriptor, 0);
}
void ArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeArrayConstructorDescriptor(descriptor, 1);
}
void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeArrayConstructorDescriptor(descriptor, -1);
}
void InternalArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 0);
InitializeInternalArrayConstructorDescriptor(descriptor, 0);
}
void InternalArraySingleArgumentConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, 1);
InitializeInternalArrayConstructorDescriptor(descriptor, 1);
}
void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
InitializeInternalArrayConstructorDescriptor(isolate, descriptor, -1);
InitializeInternalArrayConstructorDescriptor(descriptor, -1);
}
void CompareNilICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax };
descriptor->register_param_count_ = 1;
@ -317,12 +292,11 @@ void CompareNilICStub::InitializeInterfaceDescriptor(
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(CompareNilIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
}
void ToBooleanStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax };
descriptor->register_param_count_ = 1;
@ -330,12 +304,11 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
descriptor->deoptimization_handler_ =
FUNCTION_ADDR(ToBooleanIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate()));
}
void StoreGlobalStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx, rcx, rax };
descriptor->register_param_count_ = 3;
@ -346,7 +319,6 @@ void StoreGlobalStub::InitializeInterfaceDescriptor(
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rax, rbx, rcx, rdx };
descriptor->register_param_count_ = 4;
@ -357,19 +329,17 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
void BinaryOpICStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx, rax };
descriptor->register_param_count_ = 2;
descriptor->register_params_ = registers;
descriptor->deoptimization_handler_ = FUNCTION_ADDR(BinaryOpIC_Miss);
descriptor->SetMissHandler(
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate));
ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate()));
}
void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rcx, rdx, rax };
descriptor->register_param_count_ = 3;
@ -380,7 +350,6 @@ void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor(
void StringAddStub::InitializeInterfaceDescriptor(
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { rdx, rax };
descriptor->register_param_count_ = 2;
@ -481,7 +450,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
// Update the static counter each time a new code stub is generated.
isolate()->counters()->code_stubs()->Increment();
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate());
CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
int param_count = descriptor->register_param_count_;
{
// Call the runtime system in a fresh internal frame.
@ -2399,9 +2368,9 @@ void CodeStub::GenerateFPStubs(Isolate* isolate) {
void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
CEntryStub stub(isolate, 1, kDontSaveFPRegs);
stub.GetCode(isolate);
stub.GetCode();
CEntryStub save_doubles(isolate, 1, kSaveFPRegs);
save_doubles.GetCode(isolate);
save_doubles.GetCode();
}
@ -3647,7 +3616,7 @@ void ICCompareStub::GenerateNumbers(MacroAssembler* masm) {
__ bind(&generic_stub);
ICCompareStub stub(isolate(), op_, CompareIC::GENERIC, CompareIC::GENERIC,
CompareIC::GENERIC);
__ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
__ bind(&maybe_undefined1);
if (Token::IsOrderedRelationalCompareOp(op_)) {
@ -4117,9 +4086,9 @@ void NameDictionaryLookupStub::Generate(MacroAssembler* masm) {
void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(
Isolate* isolate) {
StoreBufferOverflowStub stub1(isolate, kDontSaveFPRegs);
stub1.GetCode(isolate);
stub1.GetCode();
StoreBufferOverflowStub stub2(isolate, kSaveFPRegs);
stub2.GetCode(isolate);
stub2.GetCode();
}
@ -4403,7 +4372,7 @@ void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
__ Call(ces.GetCode(isolate()), RelocInfo::CODE_TARGET);
__ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
int parameter_count_offset =
StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
__ movp(rbx, MemOperand(rbp, parameter_count_offset));
@ -4582,10 +4551,10 @@ static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
for (int i = 0; i <= to_index; ++i) {
ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
T stub(isolate, kind);
stub.GetCode(isolate);
stub.GetCode();
if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
T stub1(isolate, kind, DISABLE_ALLOCATION_SITES);
stub1.GetCode(isolate);
stub1.GetCode();
}
}
}
@ -4607,11 +4576,11 @@ void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(
for (int i = 0; i < 2; i++) {
// For internal arrays we only need a few things
InternalArrayNoArgumentConstructorStub stubh1(isolate, kinds[i]);
stubh1.GetCode(isolate);
stubh1.GetCode();
InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
stubh2.GetCode(isolate);
stubh2.GetCode();
InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]);
stubh3.GetCode(isolate);
stubh3.GetCode();
}
}

View File

@ -2335,7 +2335,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call);
__ movp(rax, rcx);
BinaryOpICStub stub(isolate(), op, mode);
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
__ jmp(&done, Label::kNear);
@ -2384,7 +2384,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
__ Pop(rdx);
BinaryOpICStub stub(isolate(), op, mode);
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(stub.GetCode(isolate()), expr->BinaryOperationFeedbackId());
CallIC(stub.GetCode(), expr->BinaryOperationFeedbackId());
patch_site.EmitPatchInfo();
context()->Plug(rax);
}
@ -2882,7 +2882,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ Move(rdx, Smi::FromInt(expr->CallNewFeedbackSlot()));
CallConstructStub stub(isolate(), RECORD_CALL_TARGET);
__ Call(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL);
__ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(rax);
}
@ -4428,7 +4428,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ movp(rdx, rax);
__ Move(rax, Smi::FromInt(1));
BinaryOpICStub stub(isolate(), expr->binary_op(), NO_OVERWRITE);
CallIC(stub.GetCode(isolate()), expr->CountBinOpFeedbackId());
CallIC(stub.GetCode(), expr->CountBinOpFeedbackId());
patch_site.EmitPatchInfo();
__ bind(&done);

View File

@ -990,17 +990,17 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
switch (instr->hydrogen()->major_key()) {
case CodeStub::RegExpExec: {
RegExpExecStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::SubString: {
SubStringStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
case CodeStub::StringCompare: {
StringCompareStub stub(isolate());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
break;
}
default:
@ -2030,7 +2030,7 @@ void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
ASSERT(ToRegister(instr->result()).is(rax));
BinaryOpICStub stub(isolate(), instr->op(), NO_OVERWRITE);
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -2626,7 +2626,7 @@ void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
InstanceofStub stub(isolate(), InstanceofStub::kNoFlags);
__ Push(ToRegister(instr->left()));
__ Push(ToRegister(instr->right()));
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
Label true_value, done;
__ testp(rax, rax);
__ j(zero, &true_value, Label::kNear);
@ -2724,7 +2724,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
// safepoint with two arguments because stub is going to
// remove the third argument from the stack before jumping
// to instanceof builtin on the slow path.
CallCodeGeneric(stub.GetCode(isolate()),
CallCodeGeneric(stub.GetCode(),
RelocInfo::CODE_TARGET,
instr,
RECORD_SAFEPOINT_WITH_REGISTERS,
@ -3909,7 +3909,7 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) {
int arity = instr->arity();
CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -3922,7 +3922,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
// No cell in ebx for construct type feedback in optimized code
__ LoadRoot(rbx, Heap::kUndefinedValueRootIndex);
CallConstructStub stub(isolate(), NO_CALL_FUNCTION_FLAGS);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
}
@ -3941,7 +3941,7 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
if (instr->arity() == 0) {
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) {
Label done;
if (IsFastPackedElementsKind(kind)) {
@ -3956,17 +3956,17 @@ void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
ArraySingleArgumentConstructorStub stub(isolate(),
holey_kind,
override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ jmp(&done, Label::kNear);
__ bind(&packed_case);
}
ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
__ bind(&done);
} else {
ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode);
CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr);
}
}
@ -4438,7 +4438,7 @@ void LCodeGen::DoStringAdd(LStringAdd* instr) {
StringAddStub stub(isolate(),
instr->hydrogen()->flags(),
instr->hydrogen()->pretenure_flag());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
}
@ -5321,7 +5321,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
instr->hydrogen()->strict_mode(),
instr->hydrogen()->is_generator());
__ Move(rbx, instr->hydrogen()->shared_info());
CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
} else {
__ Push(rsi);
__ Push(instr->hydrogen()->shared_info());

View File

@ -2429,7 +2429,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
} else {
ASSERT(info()->IsStub());
CodeStubInterfaceDescriptor* descriptor =
info()->code_stub()->GetInterfaceDescriptor(info()->isolate());
info()->code_stub()->GetInterfaceDescriptor();
int index = static_cast<int>(instr->index());
Register reg = descriptor->GetParameterRegister(index);
return DefineFixed(result, reg);

View File

@ -545,12 +545,12 @@ void MacroAssembler::Abort(BailoutReason reason) {
void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) {
ASSERT(AllowThisStubCall(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);
}
void MacroAssembler::TailCallStub(CodeStub* stub) {
Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET);
Jump(stub->GetCode(), RelocInfo::CODE_TARGET);
}
@ -829,7 +829,7 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
// Set the entry point and jump to the C entry runtime stub.
LoadAddress(rbx, ext);
CEntryStub ces(isolate(), result_size);
jmp(ces.GetCode(isolate()), RelocInfo::CODE_TARGET);
jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
}
@ -3304,7 +3304,7 @@ void MacroAssembler::SlowTruncateToI(Register result_reg,
Register input_reg,
int offset) {
DoubleToIStub stub(isolate(), input_reg, result_reg, offset, true);
call(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
call(stub.GetCode(), RelocInfo::CODE_TARGET);
}
@ -3698,7 +3698,7 @@ void MacroAssembler::DebugBreak() {
LoadAddress(rbx, ExternalReference(Runtime::kDebugBreak, isolate()));
CEntryStub ces(isolate(), 1);
ASSERT(AllowThisStubCall(&ces));
Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK);
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
#endif // ENABLE_DEBUGGER_SUPPORT

View File

@ -944,13 +944,13 @@ void LoadStubCompiler::GenerateLoadField(Register reg,
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
} else {
KeyedLoadFieldStub stub(isolate(),
field.is_inobject(holder),
field.translate(holder),
representation);
GenerateTailCall(masm(), stub.GetCode(isolate()));
GenerateTailCall(masm(), stub.GetCode());
}
}

View File

@ -56,7 +56,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
DoubleToIStub stub(isolate, source_reg, destination_reg, 0, true,
inline_fastpath);
byte* start = stub.GetCode(isolate)->instruction_start();
byte* start = stub.GetCode()->instruction_start();
Label done;
// Save callee save registers.

View File

@ -56,7 +56,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
DoubleToIStub stub(isolate, source_reg, destination_reg, 0, true,
inline_fastpath);
byte* start = stub.GetCode(isolate)->instruction_start();
byte* start = stub.GetCode()->instruction_start();
Label done;
__ SetStackPointer(csp);

View File

@ -56,7 +56,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
int offset =
source_reg.is(esp) ? 0 : (HeapNumber::kValueOffset - kSmiTagSize);
DoubleToIStub stub(isolate, source_reg, destination_reg, offset, true);
byte* start = stub.GetCode(isolate)->instruction_start();
byte* start = stub.GetCode()->instruction_start();
__ push(ebx);
__ push(ecx);

View File

@ -55,7 +55,7 @@ ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate,
int offset =
source_reg.is(rsp) ? 0 : (HeapNumber::kValueOffset - kSmiTagSize);
DoubleToIStub stub(isolate, source_reg, destination_reg, offset, true);
byte* start = stub.GetCode(isolate)->instruction_start();
byte* start = stub.GetCode()->instruction_start();
__ pushq(rbx);
__ pushq(rcx);