From: mvstanton@chromium.org Date: Wed, 3 Sep 2014 10:51:51 +0000 (+0000) Subject: Make concrete classes for individual call descriptors. The ic-convention classes... X-Git-Tag: upstream/4.7.83~7178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2fe5b2b6853f6396558409fdaecd96717af0d41;p=platform%2Fupstream%2Fv8.git Make concrete classes for individual call descriptors. The ic-convention classes that hold register specifications are merged into these new call descriptor classes, which should represent a final home for that information. R=yangguo@chromium.org Review URL: https://codereview.chromium.org/527093002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23639 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/BUILD.gn b/BUILD.gn index f604a3b18..852ec2e2d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -730,7 +730,6 @@ source_set("v8_base") { "src/ic/ic.h", "src/ic/ic-compiler.cc", "src/ic/ic-compiler.h", - "src/ic/ic-conventions.h", "src/ic/stub-cache.cc", "src/ic/stub-cache.h", "src/interface.cc", @@ -910,7 +909,6 @@ source_set("v8_base") { "src/compiler/ia32/instruction-selector-ia32.cc", "src/compiler/ia32/linkage-ia32.cc", "src/ic/ia32/ic-ia32.cc", - "src/ic/ia32/ic-conventions-ia32.cc", "src/ic/ia32/handler-ia32.cc", "src/ic/ia32/stub-cache-ia32.cc", ] @@ -950,7 +948,6 @@ source_set("v8_base") { "src/ic/x64/handler-compiler-x64.cc", "src/ic/x64/ic-x64.cc", "src/ic/x64/ic-compiler-x64.cc", - "src/ic/x64/ic-conventions-x64.cc", "src/ic/x64/stub-cache-x64.cc", ] } else if (v8_target_arch == "arm") { @@ -993,7 +990,6 @@ source_set("v8_base") { "src/ic/arm/handler-compiler-arm.cc", "src/ic/arm/ic-arm.cc", "src/ic/arm/ic-compiler-arm.cc", - "src/ic/arm/ic-conventions-arm.cc", "src/ic/arm/stub-cache-arm.cc", ] } else if (v8_target_arch == "arm64") { @@ -1047,7 +1043,6 @@ source_set("v8_base") { "src/ic/arm64/handler-compiler-arm64.cc", "src/ic/arm64/ic-arm64.cc", "src/ic/arm64/ic-compiler-arm64.cc", - "src/ic/arm64/ic-conventions-arm64.cc", "src/ic/arm64/stub-cache-arm64.cc", ] } else if (v8_target_arch == "mipsel") { diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 3184c0f7e..4224cfe59 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -28,14 +28,12 @@ static void InitializeArrayConstructorDescriptor( Runtime::kArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); + ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); + ArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, r0, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -51,14 +49,12 @@ static void InitializeInternalArrayConstructorDescriptor( Runtime::kInternalArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); + InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); + InternalArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, r0, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -1615,7 +1611,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) { void FunctionPrototypeStub::Generate(MacroAssembler* masm) { Label miss; - Register receiver = LoadConvention::ReceiverRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r3, r4, &miss); @@ -4317,14 +4313,14 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { void LoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorLoadStub stub(isolate(), state()); __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); } void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorKeyedLoadStub stub(isolate()); __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); } diff --git a/src/arm/debug-arm.cc b/src/arm/debug-arm.cc index 43a87ae52..6d7d6b8ac 100644 --- a/src/arm/debug-arm.cc +++ b/src/arm/debug-arm.cc @@ -176,17 +176,17 @@ void DebugCodegen::GenerateCallICStubDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateLoadICDebugBreak(MacroAssembler* masm) { // Calling convention for IC load (from ic-arm.cc). - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); Generate_DebugBreakCallHelper(masm, receiver.bit() | name.bit(), 0); } void DebugCodegen::GenerateStoreICDebugBreak(MacroAssembler* masm) { // Calling convention for IC store (from ic-arm.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.bit() | name.bit() | value.bit(), 0); } @@ -200,9 +200,9 @@ void DebugCodegen::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { // Calling convention for IC keyed store call (from ic-arm.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.bit() | name.bit() | value.bit(), 0); } diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index e196a8ce2..f5dff15ec 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -1402,10 +1402,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, __ bind(&fast); } - __ ldr(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); - __ mov(LoadConvention::NameRegister(), Operand(proxy->var()->name())); + __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); + __ mov(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); } @@ -1491,10 +1491,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { switch (var->location()) { case Variable::UNALLOCATED: { Comment cmnt(masm_, "[ Global variable"); - __ ldr(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); - __ mov(LoadConvention::NameRegister(), Operand(var->name())); + __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); + __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); } CallLoadIC(CONTEXTUAL); @@ -1702,9 +1702,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (key->value()->IsInternalizedString()) { if (property->emit_store()) { VisitForAccumulatorValue(value); - DCHECK(StoreConvention::ValueRegister().is(r0)); - __ mov(StoreConvention::NameRegister(), Operand(key->value())); - __ ldr(StoreConvention::ReceiverRegister(), MemOperand(sp)); + DCHECK(StoreDescriptor::ValueRegister().is(r0)); + __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); + __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); CallStoreIC(key->LiteralFeedbackId()); PrepareForBailoutForId(key->id(), NO_REGISTERS); } else { @@ -1883,7 +1883,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { // We need the receiver both on the stack and in the register. VisitForStackValue(property->obj()); - __ ldr(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); + __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); } else { VisitForStackValue(property->obj()); } @@ -1892,9 +1892,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); - __ ldr(LoadConvention::ReceiverRegister(), + __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize)); - __ ldr(LoadConvention::NameRegister(), MemOperand(sp, 0)); + __ ldr(LoadDescriptor::NameRegister(), MemOperand(sp, 0)); } else { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); @@ -2033,8 +2033,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) { Label l_catch, l_try, l_suspend, l_continuation, l_resume; Label l_next, l_call, l_loop; - Register load_receiver = LoadConvention::ReceiverRegister(); - Register load_name = LoadConvention::NameRegister(); + Register load_receiver = LoadDescriptor::ReceiverRegister(); + Register load_name = LoadDescriptor::NameRegister(); // Initial send value is undefined. __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); @@ -2089,7 +2089,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ ldr(load_receiver, MemOperand(sp, kPointerSize)); __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); } Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); @@ -2109,7 +2109,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ push(load_receiver); // save result __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(expr->DoneFeedbackSlot()))); } CallLoadIC(NOT_CONTEXTUAL); // r0=result.done @@ -2122,7 +2122,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ pop(load_receiver); // result __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(expr->ValueFeedbackSlot()))); } CallLoadIC(NOT_CONTEXTUAL); // r0=result.value @@ -2299,9 +2299,9 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) { void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Literal* key = prop->key()->AsLiteral(); - __ mov(LoadConvention::NameRegister(), Operand(key->value())); + __ mov(LoadDescriptor::NameRegister(), Operand(key->value())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -2314,7 +2314,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(prop->PropertyFeedbackSlot()))); CallIC(ic); } else { @@ -2453,9 +2453,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { case NAMED_PROPERTY: { __ push(r0); // Preserve value. VisitForAccumulatorValue(prop->obj()); - __ Move(StoreConvention::ReceiverRegister(), r0); - __ pop(StoreConvention::ValueRegister()); // Restore value. - __ mov(StoreConvention::NameRegister(), + __ Move(StoreDescriptor::ReceiverRegister(), r0); + __ pop(StoreDescriptor::ValueRegister()); // Restore value. + __ mov(StoreDescriptor::NameRegister(), Operand(prop->key()->AsLiteral()->value())); CallStoreIC(); break; @@ -2464,9 +2464,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { __ push(r0); // Preserve value. VisitForStackValue(prop->obj()); VisitForAccumulatorValue(prop->key()); - __ Move(StoreConvention::NameRegister(), r0); - __ Pop(StoreConvention::ValueRegister(), - StoreConvention::ReceiverRegister()); + __ Move(StoreDescriptor::NameRegister(), r0); + __ Pop(StoreDescriptor::ValueRegister(), + StoreDescriptor::ReceiverRegister()); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -2494,8 +2494,8 @@ void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { if (var->IsUnallocated()) { // Global var, const, or let. - __ mov(StoreConvention::NameRegister(), Operand(var->name())); - __ ldr(StoreConvention::ReceiverRegister(), GlobalObjectOperand()); + __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); + __ ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); CallStoreIC(); } else if (op == Token::INIT_CONST_LEGACY) { @@ -2567,9 +2567,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { // Record source code position before IC call. SetSourcePosition(expr->position()); - __ mov(StoreConvention::NameRegister(), + __ mov(StoreDescriptor::NameRegister(), Operand(prop->key()->AsLiteral()->value())); - __ pop(StoreConvention::ReceiverRegister()); + __ pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->AssignmentFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); @@ -2582,8 +2582,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { // Record source code position before IC call. SetSourcePosition(expr->position()); - __ Pop(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister()); - DCHECK(StoreConvention::ValueRegister().is(r0)); + __ Pop(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister()); + DCHECK(StoreDescriptor::ValueRegister().is(r0)); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() @@ -2601,15 +2601,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) { if (key->IsPropertyName()) { VisitForAccumulatorValue(expr->obj()); - __ Move(LoadConvention::ReceiverRegister(), r0); + __ Move(LoadDescriptor::ReceiverRegister(), r0); EmitNamedPropertyLoad(expr); PrepareForBailoutForId(expr->LoadId(), TOS_REG); context()->Plug(r0); } else { VisitForStackValue(expr->obj()); VisitForAccumulatorValue(expr->key()); - __ Move(LoadConvention::NameRegister(), r0); - __ pop(LoadConvention::ReceiverRegister()); + __ Move(LoadDescriptor::NameRegister(), r0); + __ pop(LoadDescriptor::ReceiverRegister()); EmitKeyedPropertyLoad(expr); context()->Plug(r0); } @@ -2646,7 +2646,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { } else { // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ ldr(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); + __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); EmitNamedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); // Push the target function under the receiver. @@ -2669,8 +2669,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ ldr(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); - __ Move(LoadConvention::NameRegister(), r0); + __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); + __ Move(LoadDescriptor::NameRegister(), r0); EmitKeyedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); @@ -4083,15 +4083,15 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { if (expr->is_jsruntime()) { // Push the builtins object as the receiver. - Register receiver = LoadConvention::ReceiverRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); __ ldr(receiver, GlobalObjectOperand()); __ ldr(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); __ push(receiver); // Load the function from the receiver. - __ mov(LoadConvention::NameRegister(), Operand(expr->name())); + __ mov(LoadDescriptor::NameRegister(), Operand(expr->name())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -4274,14 +4274,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { if (assign_type == NAMED_PROPERTY) { // Put the object both on the stack and in the register. VisitForStackValue(prop->obj()); - __ ldr(LoadConvention::ReceiverRegister(), MemOperand(sp, 0)); + __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); EmitNamedPropertyLoad(prop); } else { VisitForStackValue(prop->obj()); VisitForStackValue(prop->key()); - __ ldr(LoadConvention::ReceiverRegister(), + __ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize)); - __ ldr(LoadConvention::NameRegister(), MemOperand(sp, 0)); + __ ldr(LoadDescriptor::NameRegister(), MemOperand(sp, 0)); EmitKeyedPropertyLoad(prop); } } @@ -4389,9 +4389,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ mov(StoreConvention::NameRegister(), + __ mov(StoreDescriptor::NameRegister(), Operand(prop->key()->AsLiteral()->value())); - __ pop(StoreConvention::ReceiverRegister()); + __ pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->CountStoreFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); if (expr->is_postfix()) { @@ -4404,8 +4404,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { break; } case KEYED_PROPERTY: { - __ Pop(StoreConvention::ReceiverRegister(), - StoreConvention::NameRegister()); + __ Pop(StoreDescriptor::ReceiverRegister(), + StoreDescriptor::NameRegister()); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -4430,10 +4430,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { VariableProxy* proxy = expr->AsVariableProxy(); if (proxy != NULL && proxy->var()->IsUnallocated()) { Comment cmnt(masm_, "[ Global variable"); - __ ldr(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); - __ mov(LoadConvention::NameRegister(), Operand(proxy->name())); + __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); + __ mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(proxy->VariableFeedbackSlot()))); } // Use a regular load, not a contextual load, to avoid a reference diff --git a/src/arm/interface-descriptors-arm.cc b/src/arm/interface-descriptors-arm.cc index 969d4ae95..4b3403c6d 100644 --- a/src/arm/interface-descriptors-arm.cc +++ b/src/arm/interface-descriptors-arm.cc @@ -14,243 +14,294 @@ namespace internal { const Register CallInterfaceDescriptor::ContextRegister() { return cp; } -void CallDescriptors::InitializeForIsolate(Isolate* isolate) { - static PlatformInterfaceDescriptor default_descriptor = - PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); +const Register LoadDescriptor::ReceiverRegister() { return r1; } +const Register LoadDescriptor::NameRegister() { return r2; } + + +const Register VectorLoadICDescriptor::ReceiverRegister() { + return LoadDescriptor::ReceiverRegister(); +} + + +const Register VectorLoadICDescriptor::NameRegister() { + return LoadDescriptor::NameRegister(); +} + + +const Register VectorLoadICDescriptor::SlotRegister() { return r0; } +const Register VectorLoadICDescriptor::VectorRegister() { return r3; } + + +const Register StoreDescriptor::ReceiverRegister() { return r1; } +const Register StoreDescriptor::NameRegister() { return r2; } +const Register StoreDescriptor::ValueRegister() { return r0; } + + +const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() { + return StoreDescriptor::ReceiverRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::NameRegister() { + return StoreDescriptor::NameRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::ValueRegister() { + return StoreDescriptor::ValueRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::MapRegister() { return r3; } + + +const Register InstanceofDescriptor::left() { return r0; } +const Register InstanceofDescriptor::right() { return r1; } + + +void FastNewClosureDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r2}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastNewContextDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToNumberDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void NumberToStringDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r3, r2, r1}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), Representation::Smi(), + Representation::Tagged()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r3, r2, r1, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r2, r3}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallFunctionDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallConstructDescriptor::Initialize(Isolate* isolate) { + // r0 : number of arguments + // r1 : the function to call + // r2 : feedback vector + // r3 : (only if r2 is not the megamorphic symbol) slot in feedback + // vector (Smi) + // TODO(turbofan): So far we don't gather type feedback and hence skip the + // slot parameter, but ArrayConstructStub needs the vector to be undefined. + Register registers[] = {cp, r0, r1, r2}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r2, r1, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + +void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r0, r1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) { + // register state + // cp -- context + // r0 -- number of arguments + // r1 -- function + // r2 -- allocation site with elements kind + Register registers[] = {cp, r1, r2}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {cp, r1, r2, r0}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), + Representation::Tagged(), Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void InternalArrayConstructorConstantArgCountDescriptor::Initialize( + Isolate* isolate) { + // register state + // cp -- context + // r0 -- number of arguments + // r1 -- constructor function + Register registers[] = {cp, r1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {cp, r1, r0}; + Representation representations[] = {Representation::Tagged(), + Representation::Tagged(), + Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void CompareNilDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToBooleanDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r1, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r2, r1, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void StringAddDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {cp, r1, r0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void KeyedDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor noInlineDescriptor = + PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + r2, // key + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // key + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &noInlineDescriptor); +} + + +void NamedDescriptor::Initialize(Isolate* isolate) { static PlatformInterfaceDescriptor noInlineDescriptor = PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); - InitializeForIsolateAllPlatforms(isolate); - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); - Register registers[] = {cp, r2}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); - Register registers[] = {cp, r1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToNumberCall); - Register registers[] = {cp, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); - Register registers[] = {cp, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); - Register registers[] = {cp, r3, r2, r1}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Smi(), Representation::Tagged()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); - Register registers[] = {cp, r3, r2, r1, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); - Register registers[] = {cp, r2, r3}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); - Register registers[] = {cp, r1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallConstructCall); - // r0 : number of arguments - // r1 : the function to call - // r2 : feedback vector - // r3 : (only if r2 is not the megamorphic symbol) slot in feedback - // vector (Smi) - // TODO(turbofan): So far we don't gather type feedback and hence skip the - // slot parameter, but ArrayConstructStub needs the vector to be undefined. - Register registers[] = {cp, r0, r1, r2}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); - Register registers[] = {cp, r2, r1, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); - Register registers[] = {cp, r0, r1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); - // register state - // cp -- context - // r0 -- number of arguments - // r1 -- function - // r2 -- allocation site with elements kind - Register registers[] = {cp, r1, r2}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {cp, r1, r2, r0}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Tagged(), Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); - // register state - // cp -- context - // r0 -- number of arguments - // r1 -- constructor function - Register registers[] = {cp, r1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {cp, r1, r0}; - Representation representations[] = {Representation::Tagged(), - Representation::Tagged(), - Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CompareNilCall); - Register registers[] = {cp, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); - Register registers[] = {cp, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); - Register registers[] = {cp, r1, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::BinaryOpWithAllocationSiteCall); - Register registers[] = {cp, r2, r1, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::StringAddCall); - Register registers[] = {cp, r1, r0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); - Register registers[] = { - cp, // context - r1, // JSFunction - r0, // actual number of arguments - r2, // expected number of arguments - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // JSFunction - Representation::Integer32(), // actual number of arguments - Representation::Integer32(), // expected number of arguments - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &default_descriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::KeyedCall); - Register registers[] = { - cp, // context - r2, // key - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // key - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &noInlineDescriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NamedCall); - Register registers[] = { - cp, // context - r2, // name - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // name - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &noInlineDescriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallHandler); - Register registers[] = { - cp, // context - r0, // receiver - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // receiver - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &default_descriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); - Register registers[] = { - cp, // context - r0, // callee - r4, // call_data - r2, // holder - r1, // api_function_address - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // callee - Representation::Tagged(), // call_data - Representation::Tagged(), // holder - Representation::External(), // api_function_address - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &default_descriptor); - } + Register registers[] = { + cp, // context + r2, // name + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // name + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &noInlineDescriptor); +} + + +void CallHandlerDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor default_descriptor = + PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + r0, // receiver + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // receiver + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &default_descriptor); +} + + +void ArgumentAdaptorDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor default_descriptor = + PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + r1, // JSFunction + r0, // actual number of arguments + r2, // expected number of arguments + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // JSFunction + Representation::Integer32(), // actual number of arguments + Representation::Integer32(), // expected number of arguments + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &default_descriptor); +} + + +void ApiFunctionDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor default_descriptor = + PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + r0, // callee + r4, // call_data + r2, // holder + r1, // api_function_address + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // callee + Representation::Tagged(), // call_data + Representation::Tagged(), // holder + Representation::External(), // api_function_address + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &default_descriptor); } } } // namespace v8::internal diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index 55b1a127e..2a5bf289f 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -1082,14 +1082,14 @@ LInstruction* LChunkBuilder::DoCallJSFunction( LInstruction* LChunkBuilder::DoCallWithDescriptor( HCallWithDescriptor* instr) { - const CallInterfaceDescriptor* descriptor = instr->descriptor(); + CallInterfaceDescriptor descriptor = instr->descriptor(); LOperand* target = UseRegisterOrConstantAtStart(instr->target()); ZoneList ops(instr->OperandCount(), zone()); ops.Add(target, zone()); for (int i = 1; i < instr->OperandCount(); i++) { - LOperand* op = UseFixed(instr->OperandAt(i), - descriptor->GetParameterRegister(i - 1)); + LOperand* op = + UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); ops.Add(op, zone()); } @@ -2103,10 +2103,10 @@ LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* global_object = - UseFixed(instr->global_object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadGlobalGeneric* result = new(zone()) LLoadGlobalGeneric(context, global_object, vector); @@ -2162,10 +2162,10 @@ LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LInstruction* result = @@ -2228,11 +2228,11 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), LoadConvention::NameRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LInstruction* result = @@ -2289,9 +2289,9 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* obj = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreConvention::NameRegister()); - LOperand* val = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); + LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); DCHECK(instr->object()->representation().IsTagged()); DCHECK(instr->key()->representation().IsTagged()); @@ -2366,8 +2366,8 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* obj = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* val = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); LInstruction* result = new(zone()) LStoreNamedGeneric(context, obj, val); return MarkAsCall(result, instr); diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index 13ec3fc94..3284d5401 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -1874,17 +1874,17 @@ class LCallJSFunction FINAL : public LTemplateInstruction<1, 1, 0> { class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { public: - LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, + LCallWithDescriptor(CallInterfaceDescriptor descriptor, const ZoneList& operands, Zone* zone) : descriptor_(descriptor), - inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { - DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); + inputs_(descriptor.GetRegisterParameterCount() + 1, zone) { + DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length()); inputs_.AddAll(operands, zone); } LOperand* target() const { return inputs_[0]; } - const CallInterfaceDescriptor* descriptor() { return descriptor_; } + const CallInterfaceDescriptor descriptor() { return descriptor_; } private: DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") @@ -1894,7 +1894,7 @@ class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { int arity() const { return hydrogen()->argument_count() - 1; } - const CallInterfaceDescriptor* descriptor_; + CallInterfaceDescriptor descriptor_; ZoneList inputs_; // Iterator support. diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 760773247..5668bcab6 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -2995,11 +2995,11 @@ template void LCodeGen::EmitVectorLoadICRegisters(T* instr) { DCHECK(FLAG_vector_ics); Register vector = ToRegister(instr->temp_vector()); - DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); + DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); __ Move(vector, instr->hydrogen()->feedback_vector()); // No need to allocate this register. - DCHECK(FullVectorLoadConvention::SlotRegister().is(r0)); - __ mov(FullVectorLoadConvention::SlotRegister(), + DCHECK(VectorLoadICDescriptor::SlotRegister().is(r0)); + __ mov(VectorLoadICDescriptor::SlotRegister(), Operand(Smi::FromInt(instr->hydrogen()->slot()))); } @@ -3007,10 +3007,10 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->global_object()) - .is(LoadConvention::ReceiverRegister())); + .is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->result()).is(r0)); - __ mov(LoadConvention::NameRegister(), Operand(instr->name())); + __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -3129,11 +3129,11 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->result()).is(r0)); // Name is always in r2. - __ mov(LoadConvention::NameRegister(), Operand(instr->name())); + __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -3421,8 +3421,8 @@ MemOperand LCodeGen::PrepareKeyedOperand(Register key, void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); @@ -3980,7 +3980,7 @@ void LCodeGen::DoCallWithDescriptor(LCallWithDescriptor* instr) { Handle code = Handle::cast(ToHandle(target)); generator.BeforeCall(__ CallSize(code, RelocInfo::CODE_TARGET)); PlatformInterfaceDescriptor* call_descriptor = - instr->descriptor()->platform_specific_descriptor(); + instr->descriptor().platform_specific_descriptor(); __ Call(code, RelocInfo::CODE_TARGET, TypeFeedbackId::None(), al, call_descriptor->storage_mode()); } else { @@ -4200,10 +4200,10 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - __ mov(StoreConvention::NameRegister(), Operand(instr->name())); + __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); Handle ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); } @@ -4421,9 +4421,9 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); Handle ic = instr->strict_mode() == STRICT ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc index 852707dc6..ee22f2729 100644 --- a/src/arm64/code-stubs-arm64.cc +++ b/src/arm64/code-stubs-arm64.cc @@ -31,14 +31,12 @@ static void InitializeArrayConstructorDescriptor( Runtime::kArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); + ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); + ArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, x0, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -72,14 +70,12 @@ static void InitializeInternalArrayConstructorDescriptor( Runtime::kInternalArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); + InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); + InternalArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, x0, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -1430,7 +1426,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { void FunctionPrototypeStub::Generate(MacroAssembler* masm) { Label miss; - Register receiver = LoadConvention::ReceiverRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10, x11, &miss); @@ -4294,14 +4290,14 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { void LoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorLoadStub stub(isolate(), state()); __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); } void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorKeyedLoadStub stub(isolate()); __ Jump(stub.GetCode(), RelocInfo::CODE_TARGET); } diff --git a/src/arm64/debug-arm64.cc b/src/arm64/debug-arm64.cc index 1cbd61298..f57d5b5ab 100644 --- a/src/arm64/debug-arm64.cc +++ b/src/arm64/debug-arm64.cc @@ -236,17 +236,17 @@ void DebugCodegen::GenerateCallICStubDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateLoadICDebugBreak(MacroAssembler* masm) { // Calling convention for IC load (from ic-arm.cc). - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); Generate_DebugBreakCallHelper(masm, receiver.Bit() | name.Bit(), 0, x10); } void DebugCodegen::GenerateStoreICDebugBreak(MacroAssembler* masm) { // Calling convention for IC store (from ic-arm64.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.Bit() | name.Bit() | value.Bit(), 0, x10); } @@ -260,9 +260,9 @@ void DebugCodegen::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { // Calling convention for IC keyed store call (from ic-arm64.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.Bit() | name.Bit() | value.Bit(), 0, x10); } diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc index 61e444699..75a6500ae 100644 --- a/src/arm64/full-codegen-arm64.cc +++ b/src/arm64/full-codegen-arm64.cc @@ -1383,10 +1383,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, __ Bind(&fast); } - __ Ldr(LoadConvention::ReceiverRegister(), GlobalObjectMemOperand()); - __ Mov(LoadConvention::NameRegister(), Operand(proxy->var()->name())); + __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); + __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->var()->name())); if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(proxy->VariableFeedbackSlot())); } @@ -1468,10 +1468,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { switch (var->location()) { case Variable::UNALLOCATED: { Comment cmnt(masm_, "Global variable"); - __ Ldr(LoadConvention::ReceiverRegister(), GlobalObjectMemOperand()); - __ Mov(LoadConvention::NameRegister(), Operand(var->name())); + __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); + __ Mov(LoadDescriptor::NameRegister(), Operand(var->name())); if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(proxy->VariableFeedbackSlot())); } CallLoadIC(CONTEXTUAL); @@ -1681,9 +1681,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (key->value()->IsInternalizedString()) { if (property->emit_store()) { VisitForAccumulatorValue(value); - DCHECK(StoreConvention::ValueRegister().is(x0)); - __ Mov(StoreConvention::NameRegister(), Operand(key->value())); - __ Peek(StoreConvention::ReceiverRegister(), 0); + DCHECK(StoreDescriptor::ValueRegister().is(x0)); + __ Mov(StoreDescriptor::NameRegister(), Operand(key->value())); + __ Peek(StoreDescriptor::ReceiverRegister(), 0); CallStoreIC(key->LiteralFeedbackId()); PrepareForBailoutForId(key->id(), NO_REGISTERS); } else { @@ -1861,7 +1861,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { // We need the receiver both on the stack and in the register. VisitForStackValue(property->obj()); - __ Peek(LoadConvention::ReceiverRegister(), 0); + __ Peek(LoadDescriptor::ReceiverRegister(), 0); } else { VisitForStackValue(property->obj()); } @@ -1870,8 +1870,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); - __ Peek(LoadConvention::ReceiverRegister(), 1 * kPointerSize); - __ Peek(LoadConvention::NameRegister(), 0); + __ Peek(LoadDescriptor::ReceiverRegister(), 1 * kPointerSize); + __ Peek(LoadDescriptor::NameRegister(), 0); } else { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); @@ -1948,9 +1948,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Literal* key = prop->key()->AsLiteral(); - __ Mov(LoadConvention::NameRegister(), Operand(key->value())); + __ Mov(LoadDescriptor::NameRegister(), Operand(key->value())); if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot())); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -1964,7 +1964,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { // Call keyed load IC. It has arguments key and receiver in r0 and r1. Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot())); CallIC(ic); } else { @@ -2113,9 +2113,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { VisitForAccumulatorValue(prop->obj()); // TODO(all): We could introduce a VisitForRegValue(reg, expr) to avoid // this copy. - __ Mov(StoreConvention::ReceiverRegister(), x0); - __ Pop(StoreConvention::ValueRegister()); // Restore value. - __ Mov(StoreConvention::NameRegister(), + __ Mov(StoreDescriptor::ReceiverRegister(), x0); + __ Pop(StoreDescriptor::ValueRegister()); // Restore value. + __ Mov(StoreDescriptor::NameRegister(), Operand(prop->key()->AsLiteral()->value())); CallStoreIC(); break; @@ -2124,9 +2124,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { __ Push(x0); // Preserve value. VisitForStackValue(prop->obj()); VisitForAccumulatorValue(prop->key()); - __ Mov(StoreConvention::NameRegister(), x0); - __ Pop(StoreConvention::ReceiverRegister(), - StoreConvention::ValueRegister()); + __ Mov(StoreDescriptor::NameRegister(), x0); + __ Pop(StoreDescriptor::ReceiverRegister(), + StoreDescriptor::ValueRegister()); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -2156,8 +2156,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); if (var->IsUnallocated()) { // Global var, const, or let. - __ Mov(StoreConvention::NameRegister(), Operand(var->name())); - __ Ldr(StoreConvention::ReceiverRegister(), GlobalObjectMemOperand()); + __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); + __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); CallStoreIC(); } else if (op == Token::INIT_CONST_LEGACY) { @@ -2229,9 +2229,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { // Record source code position before IC call. SetSourcePosition(expr->position()); - __ Mov(StoreConvention::NameRegister(), + __ Mov(StoreDescriptor::NameRegister(), Operand(prop->key()->AsLiteral()->value())); - __ Pop(StoreConvention::ReceiverRegister()); + __ Pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->AssignmentFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); @@ -2246,8 +2246,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { // Record source code position before IC call. SetSourcePosition(expr->position()); // TODO(all): Could we pass this in registers rather than on the stack? - __ Pop(StoreConvention::NameRegister(), StoreConvention::ReceiverRegister()); - DCHECK(StoreConvention::ValueRegister().is(x0)); + __ Pop(StoreDescriptor::NameRegister(), StoreDescriptor::ReceiverRegister()); + DCHECK(StoreDescriptor::ValueRegister().is(x0)); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() @@ -2265,15 +2265,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) { if (key->IsPropertyName()) { VisitForAccumulatorValue(expr->obj()); - __ Move(LoadConvention::ReceiverRegister(), x0); + __ Move(LoadDescriptor::ReceiverRegister(), x0); EmitNamedPropertyLoad(expr); PrepareForBailoutForId(expr->LoadId(), TOS_REG); context()->Plug(x0); } else { VisitForStackValue(expr->obj()); VisitForAccumulatorValue(expr->key()); - __ Move(LoadConvention::NameRegister(), x0); - __ Pop(LoadConvention::ReceiverRegister()); + __ Move(LoadDescriptor::NameRegister(), x0); + __ Pop(LoadDescriptor::ReceiverRegister()); EmitKeyedPropertyLoad(expr); context()->Plug(x0); } @@ -2309,7 +2309,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { } else { // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ Peek(LoadConvention::ReceiverRegister(), 0); + __ Peek(LoadDescriptor::ReceiverRegister(), 0); EmitNamedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); // Push the target function under the receiver. @@ -2331,8 +2331,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ Peek(LoadConvention::ReceiverRegister(), 0); - __ Move(LoadConvention::NameRegister(), x0); + __ Peek(LoadDescriptor::ReceiverRegister(), 0); + __ Move(LoadDescriptor::NameRegister(), x0); EmitKeyedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); @@ -3748,15 +3748,15 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { if (expr->is_jsruntime()) { // Push the builtins object as the receiver. __ Ldr(x10, GlobalObjectMemOperand()); - __ Ldr(LoadConvention::ReceiverRegister(), + __ Ldr(LoadDescriptor::ReceiverRegister(), FieldMemOperand(x10, GlobalObject::kBuiltinsOffset)); - __ Push(LoadConvention::ReceiverRegister()); + __ Push(LoadDescriptor::ReceiverRegister()); // Load the function from the receiver. Handle name = expr->name(); - __ Mov(LoadConvention::NameRegister(), Operand(name)); + __ Mov(LoadDescriptor::NameRegister(), Operand(name)); if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->CallRuntimeFeedbackSlot())); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -3936,14 +3936,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { if (assign_type == NAMED_PROPERTY) { // Put the object both on the stack and in the register. VisitForStackValue(prop->obj()); - __ Peek(LoadConvention::ReceiverRegister(), 0); + __ Peek(LoadDescriptor::ReceiverRegister(), 0); EmitNamedPropertyLoad(prop); } else { // KEYED_PROPERTY VisitForStackValue(prop->obj()); VisitForStackValue(prop->key()); - __ Peek(LoadConvention::ReceiverRegister(), 1 * kPointerSize); - __ Peek(LoadConvention::NameRegister(), 0); + __ Peek(LoadDescriptor::ReceiverRegister(), 1 * kPointerSize); + __ Peek(LoadDescriptor::NameRegister(), 0); EmitKeyedPropertyLoad(prop); } } @@ -4053,9 +4053,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ Mov(StoreConvention::NameRegister(), + __ Mov(StoreDescriptor::NameRegister(), Operand(prop->key()->AsLiteral()->value())); - __ Pop(StoreConvention::ReceiverRegister()); + __ Pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->CountStoreFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); if (expr->is_postfix()) { @@ -4068,8 +4068,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { break; } case KEYED_PROPERTY: { - __ Pop(StoreConvention::NameRegister()); - __ Pop(StoreConvention::ReceiverRegister()); + __ Pop(StoreDescriptor::NameRegister()); + __ Pop(StoreDescriptor::ReceiverRegister()); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -4094,10 +4094,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { VariableProxy* proxy = expr->AsVariableProxy(); if (proxy != NULL && proxy->var()->IsUnallocated()) { Comment cmnt(masm_, "Global variable"); - __ Ldr(LoadConvention::ReceiverRegister(), GlobalObjectMemOperand()); - __ Mov(LoadConvention::NameRegister(), Operand(proxy->name())); + __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); + __ Mov(LoadDescriptor::NameRegister(), Operand(proxy->name())); if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(proxy->VariableFeedbackSlot())); } // Use a regular load, not a contextual load, to avoid a reference @@ -4392,8 +4392,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) { Label l_catch, l_try, l_suspend, l_continuation, l_resume; Label l_next, l_call, l_loop; - Register load_receiver = LoadConvention::ReceiverRegister(); - Register load_name = LoadConvention::NameRegister(); + Register load_receiver = LoadDescriptor::ReceiverRegister(); + Register load_name = LoadDescriptor::NameRegister(); // Initial send value is undefined. __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); @@ -4453,7 +4453,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ Peek(load_receiver, 1 * kPointerSize); __ Peek(load_name, 2 * kPointerSize); if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->KeyedLoadFeedbackSlot())); } Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); @@ -4473,7 +4473,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ Push(load_receiver); // save result __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->DoneFeedbackSlot())); } CallLoadIC(NOT_CONTEXTUAL); // x0=result.done @@ -4486,7 +4486,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ Pop(load_receiver); // result __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" if (FLAG_vector_ics) { - __ Mov(VectorLoadConvention::SlotRegister(), + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->ValueFeedbackSlot())); } CallLoadIC(NOT_CONTEXTUAL); // x0=result.value diff --git a/src/arm64/interface-descriptors-arm64.cc b/src/arm64/interface-descriptors-arm64.cc index fb490a7d3..ed5ff34b3 100644 --- a/src/arm64/interface-descriptors-arm64.cc +++ b/src/arm64/interface-descriptors-arm64.cc @@ -14,282 +14,341 @@ namespace internal { const Register CallInterfaceDescriptor::ContextRegister() { return cp; } -void CallDescriptors::InitializeForIsolate(Isolate* isolate) { - static PlatformInterfaceDescriptor default_descriptor = - PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); +const Register LoadDescriptor::ReceiverRegister() { return x1; } +const Register LoadDescriptor::NameRegister() { return x2; } + + +const Register VectorLoadICDescriptor::ReceiverRegister() { + return LoadDescriptor::ReceiverRegister(); +} + + +const Register VectorLoadICDescriptor::NameRegister() { + return LoadDescriptor::NameRegister(); +} + + +const Register VectorLoadICDescriptor::SlotRegister() { return x0; } +const Register VectorLoadICDescriptor::VectorRegister() { return x3; } + + +const Register StoreDescriptor::ReceiverRegister() { return x1; } +const Register StoreDescriptor::NameRegister() { return x2; } +const Register StoreDescriptor::ValueRegister() { return x0; } + + +const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() { + return StoreDescriptor::ReceiverRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::NameRegister() { + return StoreDescriptor::NameRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::ValueRegister() { + return StoreDescriptor::ValueRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::MapRegister() { return x3; } + + +const Register InstanceofDescriptor::left() { + // Object to check (instanceof lhs). + return x11; +} + + +const Register InstanceofDescriptor::right() { + // Constructor function (instanceof rhs). + return x10; +} + + +void FastNewClosureDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x2: function info + Register registers[] = {cp, x2}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastNewContextDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x1: function + Register registers[] = {cp, x1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToNumberDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x0: value + Register registers[] = {cp, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void NumberToStringDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x0: value + Register registers[] = {cp, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x3: array literals array + // x2: array literal index + // x1: constant elements + Register registers[] = {cp, x3, x2, x1}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), Representation::Smi(), + Representation::Tagged()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x3: object literals array + // x2: object literal index + // x1: constant properties + // x0: object literal flags + Register registers[] = {cp, x3, x2, x1, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x2: feedback vector + // x3: call feedback slot + Register registers[] = {cp, x2, x3}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallFunctionDescriptor::Initialize(Isolate* isolate) { + // x1 function the function to call + Register registers[] = {cp, x1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallConstructDescriptor::Initialize(Isolate* isolate) { + // x0 : number of arguments + // x1 : the function to call + // x2 : feedback vector + // x3 : slot in feedback vector (smi) (if r2 is not the megamorphic symbol) + // TODO(turbofan): So far we don't gather type feedback and hence skip the + // slot parameter, but ArrayConstructStub needs the vector to be undefined. + Register registers[] = {cp, x0, x1, x2}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + +void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x2: length + // x1: index (of last match) + // x0: string + Register registers[] = {cp, x2, x1, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x0: value (js_array) + // x1: to_map + Register registers[] = {cp, x0, x1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x1: function + // x2: allocation site with elements kind + // x0: number of arguments to the constructor function + Register registers[] = {cp, x1, x2}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {cp, x1, x2, x0}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), + Representation::Tagged(), Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void InternalArrayConstructorConstantArgCountDescriptor::Initialize( + Isolate* isolate) { + // cp: context + // x1: constructor function + // x0: number of arguments to the constructor function + Register registers[] = {cp, x1}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {cp, x1, x0}; + Representation representations[] = {Representation::Tagged(), + Representation::Tagged(), + Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void CompareNilDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x0: value to compare + Register registers[] = {cp, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToBooleanDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x0: value + Register registers[] = {cp, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x1: left operand + // x0: right operand + Register registers[] = {cp, x1, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x2: allocation site + // x1: left operand + // x0: right operand + Register registers[] = {cp, x2, x1, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void StringAddDescriptor::Initialize(Isolate* isolate) { + // cp: context + // x1: left operand + // x0: right operand + Register registers[] = {cp, x1, x0}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void KeyedDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor noInlineDescriptor = + PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + x2, // key + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // key + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &noInlineDescriptor); +} + + +void NamedDescriptor::Initialize(Isolate* isolate) { static PlatformInterfaceDescriptor noInlineDescriptor = PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); - InitializeForIsolateAllPlatforms(isolate); - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); - // cp: context - // x2: function info - Register registers[] = {cp, x2}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); - // cp: context - // x1: function - Register registers[] = {cp, x1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToNumberCall); - // cp: context - // x0: value - Register registers[] = {cp, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); - // cp: context - // x0: value - Register registers[] = {cp, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); - // cp: context - // x3: array literals array - // x2: array literal index - // x1: constant elements - Register registers[] = {cp, x3, x2, x1}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Smi(), Representation::Tagged()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); - // cp: context - // x3: object literals array - // x2: object literal index - // x1: constant properties - // x0: object literal flags - Register registers[] = {cp, x3, x2, x1, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); - // cp: context - // x2: feedback vector - // x3: call feedback slot - Register registers[] = {cp, x2, x3}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); - // x1 function the function to call - Register registers[] = {cp, x1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallConstructCall); - // x0 : number of arguments - // x1 : the function to call - // x2 : feedback vector - // x3 : slot in feedback vector (smi) (if r2 is not the megamorphic symbol) - // TODO(turbofan): So far we don't gather type feedback and hence skip the - // slot parameter, but ArrayConstructStub needs the vector to be undefined. - Register registers[] = {cp, x0, x1, x2}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); - // cp: context - // x2: length - // x1: index (of last match) - // x0: string - Register registers[] = {cp, x2, x1, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); - // cp: context - // x0: value (js_array) - // x1: to_map - Register registers[] = {cp, x0, x1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); - // cp: context - // x1: function - // x2: allocation site with elements kind - // x0: number of arguments to the constructor function - Register registers[] = {cp, x1, x2}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {cp, x1, x2, x0}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Tagged(), Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); - // cp: context - // x1: constructor function - // x0: number of arguments to the constructor function - Register registers[] = {cp, x1}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {cp, x1, x0}; - Representation representations[] = {Representation::Tagged(), - Representation::Tagged(), - Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CompareNilCall); - // cp: context - // x0: value to compare - Register registers[] = {cp, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); - // cp: context - // x0: value - Register registers[] = {cp, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); - // cp: context - // x1: left operand - // x0: right operand - Register registers[] = {cp, x1, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::BinaryOpWithAllocationSiteCall); - // cp: context - // x2: allocation site - // x1: left operand - // x0: right operand - Register registers[] = {cp, x2, x1, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::StringAddCall); - // cp: context - // x1: left operand - // x0: right operand - Register registers[] = {cp, x1, x0}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); - Register registers[] = { - cp, // context - x1, // JSFunction - x0, // actual number of arguments - x2, // expected number of arguments - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // JSFunction - Representation::Integer32(), // actual number of arguments - Representation::Integer32(), // expected number of arguments - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &default_descriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::KeyedCall); - Register registers[] = { - cp, // context - x2, // key - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // key - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &noInlineDescriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NamedCall); - Register registers[] = { - cp, // context - x2, // name - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // name - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &noInlineDescriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallHandler); - Register registers[] = { - cp, // context - x0, // receiver - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // receiver - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &default_descriptor); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); - Register registers[] = { - cp, // context - x0, // callee - x4, // call_data - x2, // holder - x1, // api_function_address - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // callee - Representation::Tagged(), // call_data - Representation::Tagged(), // holder - Representation::External(), // api_function_address - }; - descriptor->Initialize(arraysize(registers), registers, representations, - &default_descriptor); - } + Register registers[] = { + cp, // context + x2, // name + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // name + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &noInlineDescriptor); +} + + +void CallHandlerDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor default_descriptor = + PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + x0, // receiver + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // receiver + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &default_descriptor); +} + + +void ArgumentAdaptorDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor default_descriptor = + PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + x1, // JSFunction + x0, // actual number of arguments + x2, // expected number of arguments + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // JSFunction + Representation::Integer32(), // actual number of arguments + Representation::Integer32(), // expected number of arguments + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &default_descriptor); +} + + +void ApiFunctionDescriptor::Initialize(Isolate* isolate) { + static PlatformInterfaceDescriptor default_descriptor = + PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); + + Register registers[] = { + cp, // context + x0, // callee + x4, // call_data + x2, // holder + x1, // api_function_address + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // callee + Representation::Tagged(), // call_data + Representation::Tagged(), // holder + Representation::External(), // api_function_address + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations, &default_descriptor); } } } // namespace v8::internal diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc index 28c618b74..bce4a6cdb 100644 --- a/src/arm64/lithium-arm64.cc +++ b/src/arm64/lithium-arm64.cc @@ -1036,14 +1036,14 @@ LInstruction* LChunkBuilder::DoCallJSFunction( LInstruction* LChunkBuilder::DoCallWithDescriptor( HCallWithDescriptor* instr) { - const CallInterfaceDescriptor* descriptor = instr->descriptor(); + CallInterfaceDescriptor descriptor = instr->descriptor(); LOperand* target = UseRegisterOrConstantAtStart(instr->target()); ZoneList ops(instr->OperandCount(), zone()); ops.Add(target, zone()); for (int i = 1; i < instr->OperandCount(); i++) { - LOperand* op = UseFixed(instr->OperandAt(i), - descriptor->GetParameterRegister(i - 1)); + LOperand* op = + UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); ops.Add(op, zone()); } @@ -1665,10 +1665,10 @@ LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* global_object = - UseFixed(instr->global_object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadGlobalGeneric* result = @@ -1727,11 +1727,11 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), LoadConvention::NameRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LInstruction* result = @@ -1750,10 +1750,10 @@ LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LInstruction* result = @@ -2370,9 +2370,9 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* object = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreConvention::NameRegister()); - LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); + LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); DCHECK(instr->object()->representation().IsTagged()); DCHECK(instr->key()->representation().IsTagged()); @@ -2415,8 +2415,8 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), cp); LOperand* object = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); LInstruction* result = new(zone()) LStoreNamedGeneric(context, object, value); return MarkAsCall(result, instr); diff --git a/src/arm64/lithium-arm64.h b/src/arm64/lithium-arm64.h index 8e7ef65b5..f8ba57014 100644 --- a/src/arm64/lithium-arm64.h +++ b/src/arm64/lithium-arm64.h @@ -1523,17 +1523,17 @@ class LInteger32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { public: - LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, + LCallWithDescriptor(CallInterfaceDescriptor descriptor, const ZoneList& operands, Zone* zone) : descriptor_(descriptor), - inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { - DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); + inputs_(descriptor.GetRegisterParameterCount() + 1, zone) { + DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length()); inputs_.AddAll(operands, zone); } LOperand* target() const { return inputs_[0]; } - const CallInterfaceDescriptor* descriptor() { return descriptor_; } + CallInterfaceDescriptor descriptor() { return descriptor_; } private: DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") @@ -1543,7 +1543,7 @@ class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { int arity() const { return hydrogen()->argument_count() - 1; } - const CallInterfaceDescriptor* descriptor_; + CallInterfaceDescriptor descriptor_; ZoneList inputs_; // Iterator support. diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc index 7d4f88dbf..8c9507c98 100644 --- a/src/arm64/lithium-codegen-arm64.cc +++ b/src/arm64/lithium-codegen-arm64.cc @@ -3349,11 +3349,11 @@ template void LCodeGen::EmitVectorLoadICRegisters(T* instr) { DCHECK(FLAG_vector_ics); Register vector = ToRegister(instr->temp_vector()); - DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); + DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); __ Mov(vector, instr->hydrogen()->feedback_vector()); // No need to allocate this register. - DCHECK(FullVectorLoadConvention::SlotRegister().is(x0)); - __ Mov(FullVectorLoadConvention::SlotRegister(), + DCHECK(VectorLoadICDescriptor::SlotRegister().is(x0)); + __ Mov(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot())); } @@ -3361,9 +3361,9 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); DCHECK(ToRegister(instr->global_object()) - .is(LoadConvention::ReceiverRegister())); + .is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->result()).Is(x0)); - __ Mov(LoadConvention::NameRegister(), Operand(instr->name())); + __ Mov(LoadDescriptor::NameRegister(), Operand(instr->name())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -3617,8 +3617,8 @@ void LCodeGen::DoLoadKeyedFixed(LLoadKeyedFixed* instr) { void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -3673,8 +3673,8 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); // LoadIC expects name and receiver in registers. - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); - __ Mov(LoadConvention::NameRegister(), Operand(instr->name())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); + __ Mov(LoadDescriptor::NameRegister(), Operand(instr->name())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -5310,9 +5310,9 @@ void LCodeGen::DoStoreKeyedFixed(LStoreKeyedFixed* instr) { void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); Handle ic = instr->strict_mode() == STRICT ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() @@ -5417,10 +5417,10 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(cp)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - __ Mov(StoreConvention::NameRegister(), Operand(instr->name())); + __ Mov(StoreDescriptor::NameRegister(), Operand(instr->name())); Handle ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); CallCode(ic, RelocInfo::CODE_TARGET, instr); } diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc index 27e7c3bc2..22fabbe5b 100644 --- a/src/code-stubs-hydrogen.cc +++ b/src/code-stubs-hydrogen.cc @@ -542,8 +542,8 @@ Handle CreateAllocationSiteStub::GenerateCode() { template <> HValue* CodeStubGraphBuilder::BuildCodeStub() { HInstruction* load = BuildUncheckedMonomorphicElementAccess( - GetParameter(LoadConvention::kReceiverIndex), - GetParameter(LoadConvention::kNameIndex), NULL, + GetParameter(LoadDescriptor::kReceiverIndex), + GetParameter(LoadDescriptor::kNameIndex), NULL, casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, NEVER_RETURN_HOLE, STANDARD_STORE); return load; @@ -657,9 +657,9 @@ Handle StringLengthStub::GenerateCode() { template <> HValue* CodeStubGraphBuilder::BuildCodeStub() { BuildUncheckedMonomorphicElementAccess( - GetParameter(StoreConvention::kReceiverIndex), - GetParameter(StoreConvention::kNameIndex), - GetParameter(StoreConvention::kValueIndex), casted_stub()->is_js_array(), + GetParameter(StoreDescriptor::kReceiverIndex), + GetParameter(StoreDescriptor::kNameIndex), + GetParameter(StoreDescriptor::kValueIndex), casted_stub()->is_js_array(), casted_stub()->elements_kind(), STORE, NEVER_RETURN_HOLE, casted_stub()->store_mode()); @@ -1101,7 +1101,7 @@ HValue* CodeStubGraphBuilder::BuildCodeInitializedStub() { Handle placeholder_cell = isolate()->factory()->NewPropertyCell(placeholer_value); - HParameter* value = GetParameter(StoreConvention::kValueIndex); + HParameter* value = GetParameter(StoreDescriptor::kValueIndex); if (stub->check_global()) { // Check that the map of the global has not changed: use a placeholder map @@ -1447,8 +1447,8 @@ Handle FastNewContextStub::GenerateCode() { template <> HValue* CodeStubGraphBuilder::BuildCodeStub() { - HValue* receiver = GetParameter(LoadConvention::kReceiverIndex); - HValue* key = GetParameter(LoadConvention::kNameIndex); + HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex); + HValue* key = GetParameter(LoadDescriptor::kNameIndex); Add(key); @@ -1568,8 +1568,8 @@ void CodeStubGraphBuilder::BuildExternalElementLoad( HValue* CodeStubGraphBuilder::BuildCodeStub() { - HValue* receiver = GetParameter(LoadConvention::kReceiverIndex); - HValue* key = GetParameter(LoadConvention::kNameIndex); + HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex); + HValue* key = GetParameter(LoadDescriptor::kNameIndex); // Split into a smi/integer case and unique string case. HIfContinuation index_name_split_continuation(graph()->CreateBasicBlock(), @@ -1792,7 +1792,7 @@ Handle KeyedLoadGenericStub::GenerateCode() { template <> HValue* CodeStubGraphBuilder::BuildCodeStub() { - HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex); + HValue* receiver = GetParameter(VectorLoadICDescriptor::kReceiverIndex); Add("Always deopt", Deoptimizer::EAGER); return receiver; } @@ -1803,7 +1803,7 @@ Handle VectorLoadStub::GenerateCode() { return DoGenerateCode(this); } template <> HValue* CodeStubGraphBuilder::BuildCodeStub() { - HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex); + HValue* receiver = GetParameter(VectorLoadICDescriptor::kReceiverIndex); Add("Always deopt", Deoptimizer::EAGER); return receiver; } diff --git a/src/code-stubs.cc b/src/code-stubs.cc index 0e8a93f66..b9f4e5299 100644 --- a/src/code-stubs.cc +++ b/src/code-stubs.cc @@ -17,8 +17,7 @@ namespace internal { CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() - : call_descriptor_(NULL), - stack_parameter_count_(no_reg), + : stack_parameter_count_(no_reg), hint_stack_parameter_count_(-1), function_mode_(NOT_JS_FUNCTION_STUB_MODE), deoptimization_handler_(NULL), @@ -28,7 +27,7 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() void CodeStubInterfaceDescriptor::Initialize( - CodeStub::Major major, CallInterfaceDescriptor* call_descriptor, + CodeStub::Major major, CallInterfaceDescriptor call_descriptor, Address deoptimization_handler, int hint_stack_parameter_count, StubFunctionMode function_mode) { call_descriptor_ = call_descriptor; @@ -40,7 +39,7 @@ void CodeStubInterfaceDescriptor::Initialize( void CodeStubInterfaceDescriptor::Initialize( - CodeStub::Major major, CallInterfaceDescriptor* call_descriptor, + CodeStub::Major major, CallInterfaceDescriptor call_descriptor, Register stack_parameter_count, Address deoptimization_handler, int hint_stack_parameter_count, StubFunctionMode function_mode, HandlerArgumentsMode handler_mode) { @@ -501,8 +500,7 @@ void JSEntryStub::FinishCode(Handle code) { void LoadFastElementStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::LoadICCall); + LoadDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); } @@ -510,8 +508,7 @@ void LoadFastElementStub::InitializeInterfaceDescriptor( void LoadDictionaryElementStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::LoadICCall); + LoadDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure)); } @@ -519,8 +516,7 @@ void LoadDictionaryElementStub::InitializeInterfaceDescriptor( void KeyedLoadGenericStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::LoadICCall); + LoadDescriptor call_descriptor(isolate()); descriptor->Initialize( MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry); @@ -530,13 +526,11 @@ void KeyedLoadGenericStub::InitializeInterfaceDescriptor( void HandlerStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { if (kind() == Code::LOAD_IC) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::LoadICCall); + LoadDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } else { DCHECK_EQ(Code::STORE_IC, kind()); - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::StoreICCall); + StoreDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(StoreIC_MissFromStubFailure)); } @@ -545,8 +539,7 @@ void HandlerStub::InitializeInterfaceDescriptor( void StoreFastElementStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::StoreICCall); + StoreDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure)); } @@ -554,8 +547,7 @@ void StoreFastElementStub::InitializeInterfaceDescriptor( void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = isolate()->call_descriptor( - CallDescriptorKey::ElementTransitionAndStoreCall); + ElementTransitionAndStoreDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); } @@ -563,8 +555,7 @@ void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( void InstanceofStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::InstanceofCall); + InstanceofDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } @@ -574,8 +565,7 @@ static void InitializeVectorLoadStub(Isolate* isolate, CodeStub::Major major, Address deoptimization_handler) { DCHECK(FLAG_vector_ics); - CallInterfaceDescriptor* call_descriptor = - isolate->call_descriptor(CallDescriptorKey::VectorLoadICCall); + VectorLoadICDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deoptimization_handler); } @@ -597,8 +587,7 @@ void VectorKeyedLoadStub::InitializeInterfaceDescriptor( void FastNewClosureStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::FastNewClosureCall); + FastNewClosureDescriptor call_descriptor(isolate()); descriptor->Initialize( MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); @@ -607,24 +596,21 @@ void FastNewClosureStub::InitializeInterfaceDescriptor( void FastNewContextStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::FastNewContextCall); + FastNewContextDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } void ToNumberStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::ToNumberCall); + ToNumberDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } void NumberToStringStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::NumberToStringCall); + NumberToStringDescriptor call_descriptor(isolate()); descriptor->Initialize( MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); @@ -633,8 +619,7 @@ void NumberToStringStub::InitializeInterfaceDescriptor( void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); + FastCloneShallowArrayDescriptor call_descriptor(isolate()); descriptor->Initialize( MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry); @@ -643,8 +628,7 @@ void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); + FastCloneShallowObjectDescriptor call_descriptor(isolate()); descriptor->Initialize( MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); @@ -653,32 +637,28 @@ void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( void CreateAllocationSiteStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); + CreateAllocationSiteDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } void CallFunctionStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::CallFunctionCall); + CallFunctionDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } void CallConstructStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::CallConstructCall); + CallConstructDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } void RegExpConstructResultStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); + RegExpConstructResultDescriptor call_descriptor(isolate()); descriptor->Initialize( MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); @@ -687,8 +667,7 @@ void RegExpConstructResultStub::InitializeInterfaceDescriptor( void TransitionElementsKindStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); + TransitionElementsKindDescriptor call_descriptor(isolate()); descriptor->Initialize( MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry); @@ -697,8 +676,7 @@ void TransitionElementsKindStub::InitializeInterfaceDescriptor( void CompareNilICStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::CompareNilCall); + CompareNilDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(CompareNilIC_Miss)); descriptor->SetMissHandler( @@ -707,8 +685,7 @@ void CompareNilICStub::InitializeInterfaceDescriptor( void ToBooleanStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::ToBooleanCall); + ToBooleanDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(ToBooleanIC_Miss)); descriptor->SetMissHandler( @@ -718,8 +695,7 @@ void ToBooleanStub::InitializeInterfaceDescriptor( void BinaryOpICStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::BinaryOpCall); + BinaryOpDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(BinaryOpIC_Miss)); descriptor->SetMissHandler( @@ -729,8 +705,7 @@ void BinaryOpICStub::InitializeInterfaceDescriptor( void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = isolate()->call_descriptor( - CallDescriptorKey::BinaryOpWithAllocationSiteCall); + BinaryOpWithAllocationSiteDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); } @@ -738,8 +713,7 @@ void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( void StringAddStub::InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::StringAddCall); + StringAddDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor, Runtime::FunctionForId(Runtime::kStringAdd)->entry); } diff --git a/src/code-stubs.h b/src/code-stubs.h index 57da5f3cf..b6ac808aa 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -10,7 +10,6 @@ #include "src/codegen.h" #include "src/globals.h" #include "src/ic/ic.h" -#include "src/ic/ic-conventions.h" #include "src/interface-descriptors.h" #include "src/macro-assembler.h" #include "src/ostreams.h" @@ -293,12 +292,12 @@ class CodeStubInterfaceDescriptor { CodeStubInterfaceDescriptor(); void Initialize(CodeStub::Major major, - CallInterfaceDescriptor* call_descriptor, + CallInterfaceDescriptor call_descriptor, Address deoptimization_handler = NULL, int hint_stack_parameter_count = -1, StubFunctionMode function_mode = NOT_JS_FUNCTION_STUB_MODE); void Initialize(CodeStub::Major major, - CallInterfaceDescriptor* call_descriptor, + CallInterfaceDescriptor call_descriptor, Register stack_parameter_count, Address deoptimization_handler = NULL, int hint_stack_parameter_count = -1, @@ -313,36 +312,36 @@ class CodeStubInterfaceDescriptor { DCHECK(!stack_parameter_count_.is_valid()); } - bool IsInitialized() const { return call_descriptor_ != NULL; } + bool IsInitialized() const { return call_descriptor_.IsInitialized(); } - CallInterfaceDescriptor* call_descriptor() const { return call_descriptor_; } + CallInterfaceDescriptor call_descriptor() const { return call_descriptor_; } int GetEnvironmentLength() const { - return call_descriptor()->GetEnvironmentLength(); + return call_descriptor().GetEnvironmentLength(); } int GetRegisterParameterCount() const { - return call_descriptor()->GetRegisterParameterCount(); + return call_descriptor().GetRegisterParameterCount(); } Register GetParameterRegister(int index) const { - return call_descriptor()->GetParameterRegister(index); + return call_descriptor().GetParameterRegister(index); } Representation GetParameterRepresentation(int index) const { - return call_descriptor()->GetParameterRepresentation(index); + return call_descriptor().GetParameterRepresentation(index); } int GetEnvironmentParameterCount() const { - return call_descriptor()->GetEnvironmentParameterCount(); + return call_descriptor().GetEnvironmentParameterCount(); } Register GetEnvironmentParameterRegister(int index) const { - return call_descriptor()->GetEnvironmentParameterRegister(index); + return call_descriptor().GetEnvironmentParameterRegister(index); } Representation GetEnvironmentParameterRepresentation(int index) const { - return call_descriptor()->GetEnvironmentParameterRepresentation(index); + return call_descriptor().GetEnvironmentParameterRepresentation(index); } ExternalReference miss_handler() const { @@ -355,12 +354,12 @@ class CodeStubInterfaceDescriptor { } bool IsEnvironmentParameterCountRegister(int index) const { - return call_descriptor()->GetEnvironmentParameterRegister(index).is( + return call_descriptor().GetEnvironmentParameterRegister(index).is( stack_parameter_count_); } int GetHandlerParameterCount() const { - int params = call_descriptor()->GetEnvironmentParameterCount(); + int params = call_descriptor().GetEnvironmentParameterCount(); if (handler_arguments_mode_ == PASS_ARGUMENTS) { params += 1; } @@ -374,7 +373,7 @@ class CodeStubInterfaceDescriptor { CodeStub::Major MajorKey() const { return major_; } private: - CallInterfaceDescriptor* call_descriptor_; + CallInterfaceDescriptor call_descriptor_; Register stack_parameter_count_; // If hint_stack_parameter_count_ > 0, the code stub can optimize the // return sequence. Default value is -1, which means it is ignored. @@ -702,8 +701,8 @@ class InstanceofStub: public PlatformCodeStub { void Generate(MacroAssembler* masm); - static Register left() { return InstanceofConvention::left(); } - static Register right() { return InstanceofConvention::right(); } + static Register left() { return InstanceofDescriptor::left(); } + static Register right() { return InstanceofDescriptor::right(); } virtual void InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor); @@ -2539,14 +2538,16 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub { }; static const Register ValueRegister() { - return StoreConvention::ValueRegister(); + return ElementTransitionAndStoreDescriptor::ValueRegister(); + } + static const Register MapRegister() { + return ElementTransitionAndStoreDescriptor::MapRegister(); } - static const Register MapRegister() { return StoreConvention::MapRegister(); } static const Register KeyRegister() { - return StoreConvention::NameRegister(); + return ElementTransitionAndStoreDescriptor::NameRegister(); } static const Register ObjectRegister() { - return StoreConvention::ReceiverRegister(); + return ElementTransitionAndStoreDescriptor::ReceiverRegister(); } private: diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc index 0cb410b7e..06b9b3d0f 100644 --- a/src/compiler/js-generic-lowering.cc +++ b/src/compiler/js-generic-lowering.cc @@ -46,8 +46,7 @@ class LoadICStubShim : public HydrogenCodeStub { virtual void InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) OVERRIDE { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::LoadICCall); + LoadDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } @@ -74,8 +73,7 @@ class KeyedLoadICStubShim : public HydrogenCodeStub { virtual void InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) OVERRIDE { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::LoadICCall); + LoadDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } @@ -101,8 +99,7 @@ class StoreICStubShim : public HydrogenCodeStub { virtual void InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) OVERRIDE { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::StoreICCall); + StoreDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } @@ -132,8 +129,7 @@ class KeyedStoreICStubShim : public HydrogenCodeStub { virtual void InitializeInterfaceDescriptor( CodeStubInterfaceDescriptor* descriptor) OVERRIDE { - CallInterfaceDescriptor* call_descriptor = - isolate()->call_descriptor(CallDescriptorKey::StoreICCall); + StoreDescriptor call_descriptor(isolate()); descriptor->Initialize(MajorKey(), call_descriptor); } diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index d866630b1..63e8eb89d 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -2321,9 +2321,9 @@ class HCallWithDescriptor FINAL : public HInstruction { public: static HCallWithDescriptor* New(Zone* zone, HValue* context, HValue* target, int argument_count, - const CallInterfaceDescriptor* descriptor, + CallInterfaceDescriptor descriptor, const Vector& operands) { - DCHECK(operands.length() == descriptor->GetEnvironmentLength()); + DCHECK(operands.length() == descriptor.GetEnvironmentLength()); HCallWithDescriptor* res = new(zone) HCallWithDescriptor(target, argument_count, descriptor, operands, zone); @@ -2343,8 +2343,8 @@ class HCallWithDescriptor FINAL : public HInstruction { return Representation::Tagged(); } else { int par_index = index - 1; - DCHECK(par_index < descriptor_->GetEnvironmentLength()); - return descriptor_->GetParameterRepresentation(par_index); + DCHECK(par_index < descriptor_.GetEnvironmentLength()); + return descriptor_.GetParameterRepresentation(par_index); } } @@ -2362,7 +2362,7 @@ class HCallWithDescriptor FINAL : public HInstruction { return -argument_count_; } - const CallInterfaceDescriptor* descriptor() const { return descriptor_; } + CallInterfaceDescriptor descriptor() const { return descriptor_; } HValue* target() { return OperandAt(0); @@ -2373,10 +2373,10 @@ class HCallWithDescriptor FINAL : public HInstruction { private: // The argument count includes the receiver. HCallWithDescriptor(HValue* target, int argument_count, - const CallInterfaceDescriptor* descriptor, + CallInterfaceDescriptor descriptor, const Vector& operands, Zone* zone) : descriptor_(descriptor), - values_(descriptor->GetEnvironmentLength() + 1, zone) { + values_(descriptor.GetEnvironmentLength() + 1, zone) { argument_count_ = argument_count; AddOperand(target, zone); for (int i = 0; i < operands.length(); i++) { @@ -2396,7 +2396,7 @@ class HCallWithDescriptor FINAL : public HInstruction { values_[index] = value; } - const CallInterfaceDescriptor* descriptor_; + CallInterfaceDescriptor descriptor_; ZoneList values_; int argument_count_; }; diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 169df22aa..e0fb78916 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -7394,9 +7394,7 @@ HInstruction* HOptimizedGraphBuilder::NewPlainFunctionCall( HInstruction* HOptimizedGraphBuilder::NewArgumentAdaptorCall( HValue* fun, HValue* context, int argument_count, HValue* expected_param_count) { - CallInterfaceDescriptor* descriptor = - isolate()->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); - + ArgumentAdaptorDescriptor descriptor(isolate()); HValue* arity = Add(argument_count - 1); HValue* op_vals[] = { context, fun, arity, expected_param_count }; @@ -7407,7 +7405,7 @@ HInstruction* HOptimizedGraphBuilder::NewArgumentAdaptorCall( return New( adaptor_value, argument_count, descriptor, - Vector(op_vals, descriptor->GetEnvironmentLength())); + Vector(op_vals, descriptor.GetEnvironmentLength())); } @@ -8644,19 +8642,16 @@ bool HOptimizedGraphBuilder::TryInlineApiCall(Handle function, api_function_address }; - CallInterfaceDescriptor* descriptor = - isolate()->call_descriptor(CallDescriptorKey::ApiFunctionCall); - + ApiFunctionDescriptor descriptor(isolate()); CallApiFunctionStub stub(isolate(), is_store, call_data_is_undefined, argc); Handle code = stub.GetCode(); HConstant* code_value = Add(code); - DCHECK((sizeof(op_vals) / kPointerSize) == - descriptor->GetEnvironmentLength()); + DCHECK((sizeof(op_vals) / kPointerSize) == descriptor.GetEnvironmentLength()); HInstruction* call = New( code_value, argc + 1, descriptor, - Vector(op_vals, descriptor->GetEnvironmentLength())); + Vector(op_vals, descriptor.GetEnvironmentLength())); if (drop_extra) Drop(1); // Drop function. ast_context()->ReturnInstruction(call, ast_id); diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc index 5980049a1..497159501 100644 --- a/src/ia32/builtins-ia32.cc +++ b/src/ia32/builtins-ia32.cc @@ -994,8 +994,8 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { // Copy all arguments from the array to the stack. Label entry, loop; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); __ mov(key, Operand(ebp, kIndexOffset)); __ jmp(&entry); __ bind(&loop); @@ -1003,7 +1003,8 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { // Use inline caching to speed up access to arguments. if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), Immediate(Smi::FromInt(0))); + __ mov(VectorLoadICDescriptor::SlotRegister(), + Immediate(Smi::FromInt(0))); } Handle ic = masm->isolate()->builtins()->KeyedLoadIC_Initialize(); __ call(ic, RelocInfo::CODE_TARGET); diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index c99094b00..35caa3e8e 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -32,14 +32,12 @@ static void InitializeArrayConstructorDescriptor( Runtime::kArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); + ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); + ArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, eax, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -58,14 +56,12 @@ static void InitializeInternalArrayConstructorDescriptor( Runtime::kInternalArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); + InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); + InternalArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, eax, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -665,7 +661,7 @@ void MathPowStub::Generate(MacroAssembler* masm) { void FunctionPrototypeStub::Generate(MacroAssembler* masm) { Label miss; - Register receiver = LoadConvention::ReceiverRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax, ebx, &miss); @@ -4248,14 +4244,14 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { void LoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorLoadStub stub(isolate(), state()); __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); } void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorKeyedLoadStub stub(isolate()); __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); } diff --git a/src/ia32/debug-ia32.cc b/src/ia32/debug-ia32.cc index 72978315e..4331b088f 100644 --- a/src/ia32/debug-ia32.cc +++ b/src/ia32/debug-ia32.cc @@ -180,17 +180,17 @@ void DebugCodegen::GenerateCallICStubDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateLoadICDebugBreak(MacroAssembler* masm) { // Register state for IC load call (from ic-ia32.cc). - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); Generate_DebugBreakCallHelper(masm, receiver.bit() | name.bit(), 0, false); } void DebugCodegen::GenerateStoreICDebugBreak(MacroAssembler* masm) { // Register state for IC store call (from ic-ia32.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.bit() | name.bit() | value.bit(), 0, false); } @@ -204,9 +204,9 @@ void DebugCodegen::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { // Register state for keyed IC store call (from ic-ia32.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.bit() | name.bit() | value.bit(), 0, false); } diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index 38405256e..04fc17d07 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -1327,10 +1327,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, // All extension objects were empty and it is safe to use a global // load IC call. - __ mov(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); - __ mov(LoadConvention::NameRegister(), proxy->var()->name()); + __ mov(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); + __ mov(LoadDescriptor::NameRegister(), proxy->var()->name()); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(proxy->VariableFeedbackSlot()))); } @@ -1414,10 +1414,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { switch (var->location()) { case Variable::UNALLOCATED: { Comment cmnt(masm_, "[ Global variable"); - __ mov(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); - __ mov(LoadConvention::NameRegister(), var->name()); + __ mov(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); + __ mov(LoadDescriptor::NameRegister(), var->name()); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(proxy->VariableFeedbackSlot()))); } CallLoadIC(CONTEXTUAL); @@ -1633,9 +1633,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (key->value()->IsInternalizedString()) { if (property->emit_store()) { VisitForAccumulatorValue(value); - DCHECK(StoreConvention::ValueRegister().is(eax)); - __ mov(StoreConvention::NameRegister(), Immediate(key->value())); - __ mov(StoreConvention::ReceiverRegister(), Operand(esp, 0)); + DCHECK(StoreDescriptor::ValueRegister().is(eax)); + __ mov(StoreDescriptor::NameRegister(), Immediate(key->value())); + __ mov(StoreDescriptor::ReceiverRegister(), Operand(esp, 0)); CallStoreIC(key->LiteralFeedbackId()); PrepareForBailoutForId(key->id(), NO_REGISTERS); } else { @@ -1814,7 +1814,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { // We need the receiver both on the stack and in the register. VisitForStackValue(property->obj()); - __ mov(LoadConvention::ReceiverRegister(), Operand(esp, 0)); + __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, 0)); } else { VisitForStackValue(property->obj()); } @@ -1823,8 +1823,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); - __ mov(LoadConvention::ReceiverRegister(), Operand(esp, kPointerSize)); - __ mov(LoadConvention::NameRegister(), Operand(esp, 0)); + __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, kPointerSize)); + __ mov(LoadDescriptor::NameRegister(), Operand(esp, 0)); } else { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); @@ -1965,8 +1965,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) { Label l_catch, l_try, l_suspend, l_continuation, l_resume; Label l_next, l_call, l_loop; - Register load_receiver = LoadConvention::ReceiverRegister(); - Register load_name = LoadConvention::NameRegister(); + Register load_receiver = LoadDescriptor::ReceiverRegister(); + Register load_name = LoadDescriptor::NameRegister(); // Initial send value is undefined. __ mov(eax, isolate()->factory()->undefined_value()); @@ -2023,7 +2023,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ bind(&l_call); __ mov(load_receiver, Operand(esp, kPointerSize)); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(expr->KeyedLoadFeedbackSlot()))); } Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); @@ -2043,7 +2043,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ mov(load_name, isolate()->factory()->done_string()); // "done" if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(expr->DoneFeedbackSlot()))); } CallLoadIC(NOT_CONTEXTUAL); // result.done in eax @@ -2057,7 +2057,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ mov(load_name, isolate()->factory()->value_string()); // "value" if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(expr->ValueFeedbackSlot()))); } CallLoadIC(NOT_CONTEXTUAL); // result.value in eax @@ -2219,9 +2219,9 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Literal* key = prop->key()->AsLiteral(); DCHECK(!key->value()->IsSmi()); - __ mov(LoadConvention::NameRegister(), Immediate(key->value())); + __ mov(LoadDescriptor::NameRegister(), Immediate(key->value())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(prop->PropertyFeedbackSlot()))); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -2234,7 +2234,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(prop->PropertyFeedbackSlot()))); CallIC(ic); } else { @@ -2374,9 +2374,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { case NAMED_PROPERTY: { __ push(eax); // Preserve value. VisitForAccumulatorValue(prop->obj()); - __ Move(StoreConvention::ReceiverRegister(), eax); - __ pop(StoreConvention::ValueRegister()); // Restore value. - __ mov(StoreConvention::NameRegister(), + __ Move(StoreDescriptor::ReceiverRegister(), eax); + __ pop(StoreDescriptor::ValueRegister()); // Restore value. + __ mov(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); CallStoreIC(); break; @@ -2385,9 +2385,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { __ push(eax); // Preserve value. VisitForStackValue(prop->obj()); VisitForAccumulatorValue(prop->key()); - __ Move(StoreConvention::NameRegister(), eax); - __ pop(StoreConvention::ReceiverRegister()); // Receiver. - __ pop(StoreConvention::ValueRegister()); // Restore value. + __ Move(StoreDescriptor::NameRegister(), eax); + __ pop(StoreDescriptor::ReceiverRegister()); // Receiver. + __ pop(StoreDescriptor::ValueRegister()); // Restore value. Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -2414,8 +2414,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { if (var->IsUnallocated()) { // Global var, const, or let. - __ mov(StoreConvention::NameRegister(), var->name()); - __ mov(StoreConvention::ReceiverRegister(), GlobalObjectOperand()); + __ mov(StoreDescriptor::NameRegister(), var->name()); + __ mov(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); CallStoreIC(); } else if (op == Token::INIT_CONST_LEGACY) { @@ -2488,8 +2488,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { // Record source code position before IC call. SetSourcePosition(expr->position()); - __ mov(StoreConvention::NameRegister(), prop->key()->AsLiteral()->value()); - __ pop(StoreConvention::ReceiverRegister()); + __ mov(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); + __ pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->AssignmentFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); context()->Plug(eax); @@ -2502,9 +2502,9 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { // esp[0] : key // esp[kPointerSize] : receiver - __ pop(StoreConvention::NameRegister()); // Key. - __ pop(StoreConvention::ReceiverRegister()); - DCHECK(StoreConvention::ValueRegister().is(eax)); + __ pop(StoreDescriptor::NameRegister()); // Key. + __ pop(StoreDescriptor::ReceiverRegister()); + DCHECK(StoreDescriptor::ValueRegister().is(eax)); // Record source code position before IC call. SetSourcePosition(expr->position()); Handle ic = strict_mode() == SLOPPY @@ -2523,15 +2523,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) { if (key->IsPropertyName()) { VisitForAccumulatorValue(expr->obj()); - __ Move(LoadConvention::ReceiverRegister(), result_register()); + __ Move(LoadDescriptor::ReceiverRegister(), result_register()); EmitNamedPropertyLoad(expr); PrepareForBailoutForId(expr->LoadId(), TOS_REG); context()->Plug(eax); } else { VisitForStackValue(expr->obj()); VisitForAccumulatorValue(expr->key()); - __ pop(LoadConvention::ReceiverRegister()); // Object. - __ Move(LoadConvention::NameRegister(), result_register()); // Key. + __ pop(LoadDescriptor::ReceiverRegister()); // Object. + __ Move(LoadDescriptor::NameRegister(), result_register()); // Key. EmitKeyedPropertyLoad(expr); context()->Plug(eax); } @@ -2564,7 +2564,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { } else { // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ mov(LoadConvention::ReceiverRegister(), Operand(esp, 0)); + __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, 0)); EmitNamedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); // Push the target function under the receiver. @@ -2586,8 +2586,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ mov(LoadConvention::ReceiverRegister(), Operand(esp, 0)); - __ mov(LoadConvention::NameRegister(), eax); + __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, 0)); + __ mov(LoadDescriptor::NameRegister(), eax); EmitKeyedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); @@ -4045,10 +4045,10 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { __ push(FieldOperand(eax, GlobalObject::kBuiltinsOffset)); // Load the function from the receiver. - __ mov(LoadConvention::ReceiverRegister(), Operand(esp, 0)); - __ mov(LoadConvention::NameRegister(), Immediate(expr->name())); + __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, 0)); + __ mov(LoadDescriptor::NameRegister(), Immediate(expr->name())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(expr->CallRuntimeFeedbackSlot()))); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -4235,14 +4235,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { if (assign_type == NAMED_PROPERTY) { // Put the object both on the stack and in the register. VisitForStackValue(prop->obj()); - __ mov(LoadConvention::ReceiverRegister(), Operand(esp, 0)); + __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, 0)); EmitNamedPropertyLoad(prop); } else { VisitForStackValue(prop->obj()); VisitForStackValue(prop->key()); - __ mov(LoadConvention::ReceiverRegister(), + __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, kPointerSize)); // Object. - __ mov(LoadConvention::NameRegister(), Operand(esp, 0)); // Key. + __ mov(LoadDescriptor::NameRegister(), Operand(esp, 0)); // Key. EmitKeyedPropertyLoad(prop); } } @@ -4357,9 +4357,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ mov(StoreConvention::NameRegister(), + __ mov(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); - __ pop(StoreConvention::ReceiverRegister()); + __ pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->CountStoreFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); if (expr->is_postfix()) { @@ -4372,8 +4372,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { break; } case KEYED_PROPERTY: { - __ pop(StoreConvention::NameRegister()); - __ pop(StoreConvention::ReceiverRegister()); + __ pop(StoreDescriptor::NameRegister()); + __ pop(StoreDescriptor::ReceiverRegister()); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -4400,10 +4400,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { if (proxy != NULL && proxy->var()->IsUnallocated()) { Comment cmnt(masm_, "[ Global variable"); - __ mov(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); - __ mov(LoadConvention::NameRegister(), Immediate(proxy->name())); + __ mov(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); + __ mov(LoadDescriptor::NameRegister(), Immediate(proxy->name())); if (FLAG_vector_ics) { - __ mov(VectorLoadConvention::SlotRegister(), + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(proxy->VariableFeedbackSlot()))); } // Use a regular load, not a contextual load, to avoid a reference diff --git a/src/ia32/interface-descriptors-ia32.cc b/src/ia32/interface-descriptors-ia32.cc index ca2c12616..504d4d558 100644 --- a/src/ia32/interface-descriptors-ia32.cc +++ b/src/ia32/interface-descriptors-ia32.cc @@ -6,7 +6,6 @@ #if V8_TARGET_ARCH_IA32 -#include "src/ic/ic-conventions.h" #include "src/interface-descriptors.h" namespace v8 { @@ -15,231 +14,280 @@ namespace internal { const Register CallInterfaceDescriptor::ContextRegister() { return esi; } -void CallDescriptors::InitializeForIsolate(Isolate* isolate) { - InitializeForIsolateAllPlatforms(isolate); - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); - Register registers[] = {esi, ebx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); - Register registers[] = {esi, edi}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToNumberCall); - // ToNumberStub invokes a function, and therefore needs a context. - Register registers[] = {esi, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); - Register registers[] = {esi, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); - Register registers[] = {esi, eax, ebx, ecx}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Smi(), Representation::Tagged()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); - Register registers[] = {esi, eax, ebx, ecx, edx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); - Register registers[] = {esi, ebx, edx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); - Register registers[] = {esi, edi}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallConstructCall); - // eax : number of arguments - // ebx : feedback vector - // edx : (only if ebx is not the megamorphic symbol) slot in feedback - // vector (Smi) - // edi : constructor function - // TODO(turbofan): So far we don't gather type feedback and hence skip the - // slot parameter, but ArrayConstructStub needs the vector to be undefined. - Register registers[] = {esi, eax, edi, ebx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); - Register registers[] = {esi, ecx, ebx, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); - Register registers[] = {esi, eax, ebx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); - // register state - // eax -- number of arguments - // edi -- function - // ebx -- allocation site with elements kind - Register registers[] = {esi, edi, ebx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {esi, edi, ebx, eax}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Tagged(), Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); - // register state - // eax -- number of arguments - // edi -- function - Register registers[] = {esi, edi}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {esi, edi, eax}; - Representation representations[] = {Representation::Tagged(), - Representation::Tagged(), - Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CompareNilCall); - Register registers[] = {esi, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); - Register registers[] = {esi, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); - Register registers[] = {esi, edx, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::BinaryOpWithAllocationSiteCall); - Register registers[] = {esi, ecx, edx, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::StringAddCall); - Register registers[] = {esi, edx, eax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); - Register registers[] = { - esi, // context - edi, // JSFunction - eax, // actual number of arguments - ebx, // expected number of arguments - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // JSFunction - Representation::Integer32(), // actual number of arguments - Representation::Integer32(), // expected number of arguments - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::KeyedCall); - Register registers[] = { - esi, // context - ecx, // key - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // key - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NamedCall); - Register registers[] = { - esi, // context - ecx, // name - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // name - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallHandler); - Register registers[] = { - esi, // context - edx, // name - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // receiver - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); - Register registers[] = { - esi, // context - eax, // callee - ebx, // call_data - ecx, // holder - edx, // api_function_address - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // callee - Representation::Tagged(), // call_data - Representation::Tagged(), // holder - Representation::External(), // api_function_address - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } +const Register LoadDescriptor::ReceiverRegister() { return edx; } +const Register LoadDescriptor::NameRegister() { return ecx; } + + +const Register VectorLoadICDescriptor::ReceiverRegister() { + return LoadDescriptor::ReceiverRegister(); +} + + +const Register VectorLoadICDescriptor::NameRegister() { + return LoadDescriptor::NameRegister(); +} + + +const Register VectorLoadICDescriptor::SlotRegister() { return eax; } +const Register VectorLoadICDescriptor::VectorRegister() { return ebx; } + + +const Register StoreDescriptor::ReceiverRegister() { return edx; } +const Register StoreDescriptor::NameRegister() { return ecx; } +const Register StoreDescriptor::ValueRegister() { return eax; } + + +const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() { + return StoreDescriptor::ReceiverRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::NameRegister() { + return StoreDescriptor::NameRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::ValueRegister() { + return StoreDescriptor::ValueRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::MapRegister() { + return ebx; +} + + +const Register InstanceofDescriptor::left() { return eax; } +const Register InstanceofDescriptor::right() { return edx; } + + +void FastNewClosureDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, ebx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastNewContextDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, edi}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToNumberDescriptor::Initialize(Isolate* isolate) { + // ToNumberStub invokes a function, and therefore needs a context. + Register registers[] = {esi, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void NumberToStringDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, eax, ebx, ecx}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), Representation::Smi(), + Representation::Tagged()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, eax, ebx, ecx, edx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, ebx, edx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallFunctionDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, edi}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallConstructDescriptor::Initialize(Isolate* isolate) { + // eax : number of arguments + // ebx : feedback vector + // edx : (only if ebx is not the megamorphic symbol) slot in feedback + // vector (Smi) + // edi : constructor function + // TODO(turbofan): So far we don't gather type feedback and hence skip the + // slot parameter, but ArrayConstructStub needs the vector to be undefined. + Register registers[] = {esi, eax, edi, ebx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, ecx, ebx, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, eax, ebx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) { + // register state + // eax -- number of arguments + // edi -- function + // ebx -- allocation site with elements kind + Register registers[] = {esi, edi, ebx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {esi, edi, ebx, eax}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), + Representation::Tagged(), Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void InternalArrayConstructorConstantArgCountDescriptor::Initialize( + Isolate* isolate) { + // register state + // eax -- number of arguments + // edi -- function + Register registers[] = {esi, edi}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {esi, edi, eax}; + Representation representations[] = {Representation::Tagged(), + Representation::Tagged(), + Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void CompareNilDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToBooleanDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, edx, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, ecx, edx, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void StringAddDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {esi, edx, eax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void KeyedDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + esi, // context + ecx, // key + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // key + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void NamedDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + esi, // context + ecx, // name + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // name + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void CallHandlerDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + esi, // context + edx, // name + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // receiver + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void ArgumentAdaptorDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + esi, // context + edi, // JSFunction + eax, // actual number of arguments + ebx, // expected number of arguments + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // JSFunction + Representation::Integer32(), // actual number of arguments + Representation::Integer32(), // expected number of arguments + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void ApiFunctionDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + esi, // context + eax, // callee + ebx, // call_data + ecx, // holder + edx, // api_function_address + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // callee + Representation::Tagged(), // call_data + Representation::Tagged(), // holder + Representation::External(), // api_function_address + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); } } } // namespace v8::internal diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 7556e6cf9..5bc2c3074 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -2833,11 +2833,11 @@ template void LCodeGen::EmitVectorLoadICRegisters(T* instr) { DCHECK(FLAG_vector_ics); Register vector = ToRegister(instr->temp_vector()); - DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); + DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); __ mov(vector, instr->hydrogen()->feedback_vector()); // No need to allocate this register. - DCHECK(FullVectorLoadConvention::SlotRegister().is(eax)); - __ mov(FullVectorLoadConvention::SlotRegister(), + DCHECK(VectorLoadICDescriptor::SlotRegister().is(eax)); + __ mov(VectorLoadICDescriptor::SlotRegister(), Immediate(Smi::FromInt(instr->hydrogen()->slot()))); } @@ -2845,10 +2845,10 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(esi)); DCHECK(ToRegister(instr->global_object()) - .is(LoadConvention::ReceiverRegister())); + .is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->result()).is(eax)); - __ mov(LoadConvention::NameRegister(), instr->name()); + __ mov(LoadDescriptor::NameRegister(), instr->name()); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -2982,10 +2982,10 @@ void LCodeGen::EmitPushTaggedOperand(LOperand* operand) { void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(esi)); - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->result()).is(eax)); - __ mov(LoadConvention::NameRegister(), instr->name()); + __ mov(LoadDescriptor::NameRegister(), instr->name()); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -3210,8 +3210,8 @@ Operand LCodeGen::BuildFastArrayOperand( void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(esi)); - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); @@ -4069,10 +4069,10 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(esi)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - __ mov(StoreConvention::NameRegister(), instr->name()); + __ mov(StoreDescriptor::NameRegister(), instr->name()); Handle ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); CallCode(ic, RelocInfo::CODE_TARGET, instr); } @@ -4251,9 +4251,9 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(esi)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); Handle ic = instr->strict_mode() == STRICT ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index d68524075..b99a3b1e5 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -1123,13 +1123,13 @@ LInstruction* LChunkBuilder::DoCallJSFunction( LInstruction* LChunkBuilder::DoCallWithDescriptor( HCallWithDescriptor* instr) { - const CallInterfaceDescriptor* descriptor = instr->descriptor(); + CallInterfaceDescriptor descriptor = instr->descriptor(); LOperand* target = UseRegisterOrConstantAtStart(instr->target()); ZoneList ops(instr->OperandCount(), zone()); ops.Add(target, zone()); for (int i = 1; i < instr->OperandCount(); i++) { - LOperand* op = UseFixed(instr->OperandAt(i), - descriptor->GetParameterRegister(i - 1)); + LOperand* op = + UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); ops.Add(op, zone()); } @@ -2107,10 +2107,10 @@ LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { LOperand* context = UseFixed(instr->context(), esi); LOperand* global_object = - UseFixed(instr->global_object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadGlobalGeneric* result = @@ -2168,10 +2168,10 @@ LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), esi); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric( context, object, vector); @@ -2232,11 +2232,11 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), esi); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), LoadConvention::NameRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadKeyedGeneric* result = new(zone()) LLoadKeyedGeneric(context, object, key, vector); @@ -2318,9 +2318,9 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), esi); LOperand* object = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreConvention::NameRegister()); - LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); + LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); DCHECK(instr->object()->representation().IsTagged()); DCHECK(instr->key()->representation().IsTagged()); @@ -2423,8 +2423,8 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), esi); LOperand* object = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); LStoreNamedGeneric* result = new(zone()) LStoreNamedGeneric(context, object, value); diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h index 1e7323228..1c24ae781 100644 --- a/src/ia32/lithium-ia32.h +++ b/src/ia32/lithium-ia32.h @@ -1891,10 +1891,10 @@ class LCallJSFunction FINAL : public LTemplateInstruction<1, 1, 0> { class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { public: - LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, + LCallWithDescriptor(CallInterfaceDescriptor descriptor, const ZoneList& operands, Zone* zone) - : inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { - DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); + : inputs_(descriptor.GetRegisterParameterCount() + 1, zone) { + DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length()); inputs_.AddAll(operands, zone); } diff --git a/src/ic/arm/access-compiler-arm.cc b/src/ic/arm/access-compiler-arm.cc index 08e53829f..4a4d688c0 100644 --- a/src/ic/arm/access-compiler-arm.cc +++ b/src/ic/arm/access-compiler-arm.cc @@ -22,8 +22,8 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, Register* PropertyAccessCompiler::load_calling_convention() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); static Register registers[] = {receiver, name, r3, r0, r4, r5}; return registers; } @@ -31,9 +31,9 @@ Register* PropertyAccessCompiler::load_calling_convention() { Register* PropertyAccessCompiler::store_calling_convention() { // receiver, name, scratch1, scratch2, scratch3. - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - DCHECK(r3.is(StoreConvention::MapRegister())); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + DCHECK(r3.is(ElementTransitionAndStoreDescriptor::MapRegister())); static Register registers[] = {receiver, name, r3, r4, r5}; return registers; } diff --git a/src/ic/arm/handler-compiler-arm.cc b/src/ic/arm/handler-compiler-arm.cc index 9efe9bcfd..719592652 100644 --- a/src/ic/arm/handler-compiler-arm.cc +++ b/src/ic/arm/handler-compiler-arm.cc @@ -291,8 +291,8 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement( // The return address is in lr. Label slow, miss; - Register key = LoadConvention::NameRegister(); - Register receiver = LoadConvention::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); DCHECK(receiver.is(r1)); DCHECK(key.is(r2)); @@ -316,8 +316,8 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement( void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { // Push receiver, key and value for runtime call. - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); // The slow case calls into the runtime to complete the store without causing // an IC miss that would otherwise cause a transition to the generic stub. @@ -329,8 +329,8 @@ void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { // Push receiver, key and value for runtime call. - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); // The slow case calls into the runtime to complete the store without causing // an IC miss that would otherwise cause a transition to the generic stub. @@ -829,7 +829,7 @@ Handle NamedStoreHandlerCompiler::CompileStoreInterceptor( Register NamedStoreHandlerCompiler::value() { - return StoreConvention::ValueRegister(); + return StoreDescriptor::ValueRegister(); } @@ -839,7 +839,7 @@ Handle NamedLoadHandlerCompiler::CompileLoadGlobal( FrontendHeader(receiver(), name, &miss); // Get the value from the cell. - Register result = StoreConvention::ValueRegister(); + Register result = StoreDescriptor::ValueRegister(); __ mov(result, Operand(cell)); __ ldr(result, FieldMemOperand(result, Cell::kValueOffset)); diff --git a/src/ic/arm/ic-arm.cc b/src/ic/arm/ic-arm.cc index 1da0f3cf9..76135ef56 100644 --- a/src/ic/arm/ic-arm.cc +++ b/src/ic/arm/ic-arm.cc @@ -244,8 +244,8 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is in lr. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); DCHECK(receiver.is(r1)); DCHECK(name.is(r2)); @@ -262,15 +262,15 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = r0; - DCHECK(!dictionary.is(LoadConvention::ReceiverRegister())); - DCHECK(!dictionary.is(LoadConvention::NameRegister())); + DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); + DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); Label slow; - __ ldr(dictionary, FieldMemOperand(LoadConvention::ReceiverRegister(), + __ ldr(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(), JSObject::kPropertiesOffset)); GenerateDictionaryLoad(masm, &slow, dictionary, - LoadConvention::NameRegister(), r0, r3, r4); + LoadDescriptor::NameRegister(), r0, r3, r4); __ Ret(); // Dictionary load failed, go slow (but don't miss). @@ -289,8 +289,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ IncrementCounter(isolate->counters()->load_miss(), 1, r3, r4); - __ mov(LoadIC_TempRegister(), LoadConvention::ReceiverRegister()); - __ Push(LoadIC_TempRegister(), LoadConvention::NameRegister()); + __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); + __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); // Perform tail call to the entry. ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); @@ -301,8 +301,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. - __ mov(LoadIC_TempRegister(), LoadConvention::ReceiverRegister()); - __ Push(LoadIC_TempRegister(), LoadConvention::NameRegister()); + __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); + __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); __ TailCallRuntime(Runtime::kGetProperty, 2, 1); } @@ -389,8 +389,8 @@ static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm, void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { // The return address is in lr. - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); DCHECK(receiver.is(r1)); DCHECK(key.is(r2)); @@ -414,9 +414,9 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register key = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register key = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(receiver.is(r1)); DCHECK(key.is(r2)); DCHECK(value.is(r0)); @@ -449,7 +449,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); - __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); + __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Perform tail call to the entry. ExternalReference ref = @@ -462,7 +462,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. - __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); + __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); } @@ -473,8 +473,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; - Register key = LoadConvention::NameRegister(); - Register receiver = LoadConvention::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); DCHECK(key.is(r2)); DCHECK(receiver.is(r1)); @@ -635,8 +635,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { // Return address is in lr. Label miss; - Register receiver = LoadConvention::ReceiverRegister(); - Register index = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register index = LoadDescriptor::NameRegister(); Register scratch = r3; Register result = r0; DCHECK(!scratch.is(receiver) && !scratch.is(index)); @@ -661,8 +661,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { // Return address is in lr. Label slow; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); Register scratch1 = r3; Register scratch2 = r4; DCHECK(!scratch1.is(receiver) && !scratch1.is(key)); @@ -701,8 +701,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { // Push receiver, key and value for runtime call. - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); @@ -864,9 +864,9 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, Label array, extra, check_if_double_array; // Register usage. - Register value = StoreConvention::ValueRegister(); - Register key = StoreConvention::NameRegister(); - Register receiver = StoreConvention::ReceiverRegister(); + Register value = StoreDescriptor::ValueRegister(); + Register key = StoreDescriptor::NameRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); DCHECK(receiver.is(r1)); DCHECK(key.is(r2)); DCHECK(value.is(r0)); @@ -953,11 +953,11 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); DCHECK(receiver.is(r1)); DCHECK(name.is(r2)); - DCHECK(StoreConvention::ValueRegister().is(r0)); + DCHECK(StoreDescriptor::ValueRegister().is(r0)); // Get the receiver from the stack and probe the stub cache. Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( @@ -972,8 +972,8 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { void StoreIC::GenerateMiss(MacroAssembler* masm) { - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); // Perform tail call to the entry. ExternalReference ref = @@ -984,9 +984,9 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) { void StoreIC::GenerateNormal(MacroAssembler* masm) { Label miss; - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Register dictionary = r3; DCHECK(receiver.is(r1)); DCHECK(name.is(r2)); diff --git a/src/ic/arm/ic-compiler-arm.cc b/src/ic/arm/ic-compiler-arm.cc index 024931162..c9ce6e3b1 100644 --- a/src/ic/arm/ic-compiler-arm.cc +++ b/src/ic/arm/ic-compiler-arm.cc @@ -16,8 +16,8 @@ namespace internal { void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, StrictMode strict_mode) { - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); __ mov(r0, Operand(Smi::FromInt(strict_mode))); __ Push(r0); @@ -57,7 +57,7 @@ Handle PropertyICCompiler::CompilePolymorphic(TypeHandleList* types, // Polymorphic keyed stores may use the map register Register map_reg = scratch1(); DCHECK(kind() != Code::KEYED_STORE_IC || - map_reg.is(StoreConvention::MapRegister())); + map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); int receiver_count = types->length(); int number_of_handled_maps = 0; diff --git a/src/ic/arm/ic-conventions-arm.cc b/src/ic/arm/ic-conventions-arm.cc deleted file mode 100644 index 6192cba20..000000000 --- a/src/ic/arm/ic-conventions-arm.cc +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2012 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "src/v8.h" - -#if V8_TARGET_ARCH_ARM - -#include "src/codegen.h" -#include "src/ic/ic-conventions.h" - -namespace v8 { -namespace internal { - -// IC register specifications -const Register LoadConvention::ReceiverRegister() { return r1; } -const Register LoadConvention::NameRegister() { return r2; } - - -const Register VectorLoadConvention::SlotRegister() { return r0; } - - -const Register FullVectorLoadConvention::VectorRegister() { return r3; } - - -const Register StoreConvention::ReceiverRegister() { return r1; } -const Register StoreConvention::NameRegister() { return r2; } -const Register StoreConvention::ValueRegister() { return r0; } -const Register StoreConvention::MapRegister() { return r3; } - - -const Register InstanceofConvention::left() { return r0; } -const Register InstanceofConvention::right() { return r1; } -} -} // namespace v8::internal - -#endif // V8_TARGET_ARCH_ARM diff --git a/src/ic/arm64/access-compiler-arm64.cc b/src/ic/arm64/access-compiler-arm64.cc index ff593b821..58e6099ae 100644 --- a/src/ic/arm64/access-compiler-arm64.cc +++ b/src/ic/arm64/access-compiler-arm64.cc @@ -29,8 +29,8 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, Register* PropertyAccessCompiler::load_calling_convention() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); static Register registers[] = {receiver, name, x3, x0, x4, x5}; return registers; } @@ -38,9 +38,9 @@ Register* PropertyAccessCompiler::load_calling_convention() { Register* PropertyAccessCompiler::store_calling_convention() { // receiver, value, scratch1, scratch2, scratch3. - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - DCHECK(x3.is(StoreConvention::MapRegister())); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + DCHECK(x3.is(ElementTransitionAndStoreDescriptor::MapRegister())); static Register registers[] = {receiver, name, x3, x4, x5}; return registers; } diff --git a/src/ic/arm64/handler-compiler-arm64.cc b/src/ic/arm64/handler-compiler-arm64.cc index e4f97bb63..1669abb0b 100644 --- a/src/ic/arm64/handler-compiler-arm64.cc +++ b/src/ic/arm64/handler-compiler-arm64.cc @@ -285,8 +285,8 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement( Label slow, miss; Register result = x0; - Register key = LoadConvention::NameRegister(); - Register receiver = LoadConvention::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); DCHECK(receiver.is(x1)); DCHECK(key.is(x2)); @@ -308,8 +308,8 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement( void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) { // Push receiver, name and value for runtime call. - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); // The slow case calls into the runtime to complete the store without causing // an IC miss that would otherwise cause a transition to the generic stub. @@ -323,8 +323,8 @@ void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) { ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow"); // Push receiver, key and value for runtime call. - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); // The slow case calls into the runtime to complete the store without causing // an IC miss that would otherwise cause a transition to the generic stub. @@ -344,7 +344,7 @@ Handle NamedLoadHandlerCompiler::CompileLoadGlobal( FrontendHeader(receiver(), name, &miss); // Get the value from the cell. - Register result = StoreConvention::ValueRegister(); + Register result = StoreDescriptor::ValueRegister(); __ Mov(result, Operand(cell)); __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); @@ -383,7 +383,7 @@ Handle NamedStoreHandlerCompiler::CompileStoreInterceptor( Register NamedStoreHandlerCompiler::value() { - return StoreConvention::ValueRegister(); + return StoreDescriptor::ValueRegister(); } diff --git a/src/ic/arm64/ic-arm64.cc b/src/ic/arm64/ic-arm64.cc index fc9c981b6..9ea622e9a 100644 --- a/src/ic/arm64/ic-arm64.cc +++ b/src/ic/arm64/ic-arm64.cc @@ -333,8 +333,8 @@ static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm, void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is in lr. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); DCHECK(receiver.is(x1)); DCHECK(name.is(x2)); @@ -351,14 +351,14 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = x0; - DCHECK(!dictionary.is(LoadConvention::ReceiverRegister())); - DCHECK(!dictionary.is(LoadConvention::NameRegister())); + DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); + DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); Label slow; - __ Ldr(dictionary, FieldMemOperand(LoadConvention::ReceiverRegister(), + __ Ldr(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(), JSObject::kPropertiesOffset)); GenerateDictionaryLoad(masm, &slow, dictionary, - LoadConvention::NameRegister(), x0, x3, x4); + LoadDescriptor::NameRegister(), x0, x3, x4); __ Ret(); // Dictionary load failed, go slow (but don't miss). @@ -375,7 +375,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ IncrementCounter(isolate->counters()->load_miss(), 1, x3, x4); // Perform tail call to the entry. - __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); + __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); __ TailCallExternalReference(ref, 2, 1); } @@ -383,7 +383,7 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. - __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); + __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); __ TailCallRuntime(Runtime::kGetProperty, 2, 1); } @@ -391,8 +391,8 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { // The return address is in lr. Register result = x0; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); DCHECK(receiver.is(x1)); DCHECK(key.is(x2)); @@ -420,9 +420,9 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { ASM_LOCATION("KeyedStoreIC::GenerateSloppyArguments"); Label slow, notin; - Register value = StoreConvention::ValueRegister(); - Register key = StoreConvention::NameRegister(); - Register receiver = StoreConvention::ReceiverRegister(); + Register value = StoreDescriptor::ValueRegister(); + Register key = StoreDescriptor::NameRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); DCHECK(receiver.is(x1)); DCHECK(key.is(x2)); DCHECK(value.is(x0)); @@ -469,7 +469,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, x10, x11); - __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); + __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); // Perform tail call to the entry. ExternalReference ref = @@ -481,7 +481,7 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is in lr. - __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister()); + __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); } @@ -645,8 +645,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { // The return address is in lr. Label slow, check_name, index_smi, index_name; - Register key = LoadConvention::NameRegister(); - Register receiver = LoadConvention::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); DCHECK(key.is(x2)); DCHECK(receiver.is(x1)); @@ -678,8 +678,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { // Return address is in lr. Label miss; - Register receiver = LoadConvention::ReceiverRegister(); - Register index = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register index = LoadDescriptor::NameRegister(); Register result = x0; Register scratch = x3; DCHECK(!scratch.is(receiver) && !scratch.is(index)); @@ -704,8 +704,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { // Return address is in lr. Label slow; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); Register scratch1 = x3; Register scratch2 = x4; DCHECK(!AreAliased(scratch1, scratch2, receiver, key)); @@ -744,8 +744,8 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ASM_LOCATION("KeyedStoreIC::GenerateMiss"); // Push receiver, key and value for runtime call. - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); @@ -896,9 +896,9 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, Label fast_double_grow; Label fast_double; - Register value = StoreConvention::ValueRegister(); - Register key = StoreConvention::NameRegister(); - Register receiver = StoreConvention::ReceiverRegister(); + Register value = StoreDescriptor::ValueRegister(); + Register key = StoreDescriptor::NameRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); DCHECK(receiver.is(x1)); DCHECK(key.is(x2)); DCHECK(value.is(x0)); @@ -986,9 +986,9 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - DCHECK(!AreAliased(receiver, name, StoreConvention::ValueRegister(), x3, x4, + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + DCHECK(!AreAliased(receiver, name, StoreDescriptor::ValueRegister(), x3, x4, x5, x6)); // Probe the stub cache. @@ -1003,8 +1003,8 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { void StoreIC::GenerateMiss(MacroAssembler* masm) { - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); // Tail call to the entry. ExternalReference ref = @@ -1015,9 +1015,9 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) { void StoreIC::GenerateNormal(MacroAssembler* masm) { Label miss; - Register value = StoreConvention::ValueRegister(); - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); Register dictionary = x3; DCHECK(!AreAliased(value, receiver, name, x3, x4, x5)); diff --git a/src/ic/arm64/ic-compiler-arm64.cc b/src/ic/arm64/ic-compiler-arm64.cc index 315ae34d1..f7e1036c7 100644 --- a/src/ic/arm64/ic-compiler-arm64.cc +++ b/src/ic/arm64/ic-compiler-arm64.cc @@ -17,8 +17,8 @@ void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, StrictMode strict_mode) { ASM_LOCATION("PropertyICCompiler::GenerateRuntimeSetProperty"); - __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(), - StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), + StoreDescriptor::ValueRegister()); __ Mov(x10, Smi::FromInt(strict_mode)); __ Push(x10); @@ -57,7 +57,7 @@ Handle PropertyICCompiler::CompilePolymorphic(TypeHandleList* types, // Polymorphic keyed stores may use the map register Register map_reg = scratch1(); DCHECK(kind() != Code::KEYED_STORE_IC || - map_reg.is(StoreConvention::MapRegister())); + map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); __ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset)); int receiver_count = types->length(); int number_of_handled_maps = 0; diff --git a/src/ic/arm64/ic-conventions-arm64.cc b/src/ic/arm64/ic-conventions-arm64.cc deleted file mode 100644 index 4de2a574e..000000000 --- a/src/ic/arm64/ic-conventions-arm64.cc +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2013 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "src/v8.h" - -#if V8_TARGET_ARCH_ARM64 - -#include "src/codegen.h" -#include "src/ic/ic-conventions.h" - -namespace v8 { -namespace internal { - -// IC register specifications -const Register LoadConvention::ReceiverRegister() { return x1; } -const Register LoadConvention::NameRegister() { return x2; } - - -const Register VectorLoadConvention::SlotRegister() { return x0; } - - -const Register FullVectorLoadConvention::VectorRegister() { return x3; } - - -const Register StoreConvention::ReceiverRegister() { return x1; } -const Register StoreConvention::NameRegister() { return x2; } -const Register StoreConvention::ValueRegister() { return x0; } - - -const Register StoreConvention::MapRegister() { return x3; } - - -const Register InstanceofConvention::left() { - // Object to check (instanceof lhs). - return x11; -} - - -const Register InstanceofConvention::right() { - // Constructor function (instanceof rhs). - return x10; -} -} -} // namespace v8::internal - -#endif // V8_TARGET_ARCH_ARM64 diff --git a/src/ic/ia32/access-compiler-ia32.cc b/src/ic/ia32/access-compiler-ia32.cc index d51c2162e..9bcbef0b6 100644 --- a/src/ic/ia32/access-compiler-ia32.cc +++ b/src/ic/ia32/access-compiler-ia32.cc @@ -21,8 +21,8 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, Register* PropertyAccessCompiler::load_calling_convention() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); static Register registers[] = {receiver, name, ebx, eax, edi, no_reg}; return registers; } @@ -30,9 +30,9 @@ Register* PropertyAccessCompiler::load_calling_convention() { Register* PropertyAccessCompiler::store_calling_convention() { // receiver, name, scratch1, scratch2, scratch3. - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - DCHECK(ebx.is(StoreConvention::MapRegister())); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + DCHECK(ebx.is(ElementTransitionAndStoreDescriptor::MapRegister())); static Register registers[] = {receiver, name, ebx, edi, no_reg}; return registers; } diff --git a/src/ic/ia32/handler-compiler-ia32.cc b/src/ic/ia32/handler-compiler-ia32.cc index 3cdf8a17f..e56eda152 100644 --- a/src/ic/ia32/handler-compiler-ia32.cc +++ b/src/ic/ia32/handler-compiler-ia32.cc @@ -22,8 +22,8 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement( // -- edx : receiver // -- esp[0] : return address // ----------------------------------- - DCHECK(edx.is(LoadConvention::ReceiverRegister())); - DCHECK(ecx.is(LoadConvention::NameRegister())); + DCHECK(edx.is(LoadDescriptor::ReceiverRegister())); + DCHECK(ecx.is(LoadDescriptor::NameRegister())); Label slow, miss; // This stub is meant to be tail-jumped to, the receiver must already @@ -327,9 +327,9 @@ static void CompileCallLoadPropertyWithInterceptor( static void StoreIC_PushArgs(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value)); @@ -853,7 +853,7 @@ Handle NamedStoreHandlerCompiler::CompileStoreInterceptor( Register NamedStoreHandlerCompiler::value() { - return StoreConvention::ValueRegister(); + return StoreDescriptor::ValueRegister(); } @@ -863,7 +863,7 @@ Handle NamedLoadHandlerCompiler::CompileLoadGlobal( FrontendHeader(receiver(), name, &miss); // Get the value from the cell. - Register result = StoreConvention::ValueRegister(); + Register result = StoreDescriptor::ValueRegister(); if (masm()->serializer_enabled()) { __ mov(result, Immediate(cell)); __ mov(result, FieldOperand(result, PropertyCell::kValueOffset)); diff --git a/src/ic/ia32/ic-compiler-ia32.cc b/src/ic/ia32/ic-compiler-ia32.cc index 7af370732..2f3c58b94 100644 --- a/src/ic/ia32/ic-compiler-ia32.cc +++ b/src/ic/ia32/ic-compiler-ia32.cc @@ -17,13 +17,13 @@ namespace internal { void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, StrictMode strict_mode) { // Return address is on the stack. - DCHECK(!ebx.is(StoreConvention::ReceiverRegister()) && - !ebx.is(StoreConvention::NameRegister()) && - !ebx.is(StoreConvention::ValueRegister())); + DCHECK(!ebx.is(StoreDescriptor::ReceiverRegister()) && + !ebx.is(StoreDescriptor::NameRegister()) && + !ebx.is(StoreDescriptor::ValueRegister())); __ pop(ebx); - __ push(StoreConvention::ReceiverRegister()); - __ push(StoreConvention::NameRegister()); - __ push(StoreConvention::ValueRegister()); + __ push(StoreDescriptor::ReceiverRegister()); + __ push(StoreDescriptor::NameRegister()); + __ push(StoreDescriptor::ValueRegister()); __ push(Immediate(Smi::FromInt(strict_mode))); __ push(ebx); // return address @@ -61,7 +61,7 @@ Handle PropertyICCompiler::CompilePolymorphic(TypeHandleList* types, // Polymorphic keyed stores may use the map register Register map_reg = scratch1(); DCHECK(kind() != Code::KEYED_STORE_IC || - map_reg.is(StoreConvention::MapRegister())); + map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); __ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); int receiver_count = types->length(); int number_of_handled_maps = 0; diff --git a/src/ic/ia32/ic-conventions-ia32.cc b/src/ic/ia32/ic-conventions-ia32.cc deleted file mode 100644 index cafd86d05..000000000 --- a/src/ic/ia32/ic-conventions-ia32.cc +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "src/v8.h" - -#if V8_TARGET_ARCH_IA32 - -#include "src/codegen.h" -#include "src/ic/ic-conventions.h" - -namespace v8 { -namespace internal { - -// IC register specifications - -const Register LoadConvention::ReceiverRegister() { return edx; } -const Register LoadConvention::NameRegister() { return ecx; } - - -const Register VectorLoadConvention::SlotRegister() { return eax; } - - -const Register FullVectorLoadConvention::VectorRegister() { return ebx; } - - -const Register StoreConvention::ReceiverRegister() { return edx; } -const Register StoreConvention::NameRegister() { return ecx; } -const Register StoreConvention::ValueRegister() { return eax; } -const Register StoreConvention::MapRegister() { return ebx; } - - -const Register InstanceofConvention::left() { return eax; } -const Register InstanceofConvention::right() { return edx; } -} -} // namespace v8::internal - -#endif // V8_TARGET_ARCH_IA32 diff --git a/src/ic/ia32/ic-ia32.cc b/src/ic/ia32/ic-ia32.cc index 38dda3cdc..d869e43cf 100644 --- a/src/ic/ia32/ic-ia32.cc +++ b/src/ic/ia32/ic-ia32.cc @@ -310,8 +310,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); DCHECK(receiver.is(edx)); DCHECK(key.is(ecx)); @@ -480,8 +480,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { // Return address is on the stack. Label miss; - Register receiver = LoadConvention::ReceiverRegister(); - Register index = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register index = LoadDescriptor::NameRegister(); Register scratch = ebx; DCHECK(!scratch.is(receiver) && !scratch.is(index)); Register result = eax; @@ -507,8 +507,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { // Return address is on the stack. Label slow; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); Register scratch = eax; DCHECK(!scratch.is(receiver) && !scratch.is(key)); @@ -547,8 +547,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { // The return address is on the stack. - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); DCHECK(receiver.is(edx)); DCHECK(key.is(ecx)); @@ -574,9 +574,9 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { // Return address is on the stack. Label slow, notin; - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(receiver.is(edx)); DCHECK(name.is(ecx)); DCHECK(value.is(eax)); @@ -608,9 +608,9 @@ static void KeyedStoreGenerateGenericHelper( Label transition_smi_elements; Label finish_object_store, non_double_value, transition_double_elements; Label fast_double_without_map_check; - Register receiver = StoreConvention::ReceiverRegister(); - Register key = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register key = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(receiver.is(edx)); DCHECK(key.is(ecx)); DCHECK(value.is(eax)); @@ -746,8 +746,8 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, Label slow, fast_object, fast_object_grow; Label fast_double, fast_double_grow; Label array, extra, check_if_double_array; - Register receiver = StoreConvention::ReceiverRegister(); - Register key = StoreConvention::NameRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register key = StoreDescriptor::NameRegister(); DCHECK(receiver.is(edx)); DCHECK(key.is(ecx)); @@ -826,8 +826,8 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is on the stack. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); DCHECK(receiver.is(edx)); DCHECK(name.is(ecx)); @@ -844,15 +844,15 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = eax; - DCHECK(!dictionary.is(LoadConvention::ReceiverRegister())); - DCHECK(!dictionary.is(LoadConvention::NameRegister())); + DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); + DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); Label slow; - __ mov(dictionary, FieldOperand(LoadConvention::ReceiverRegister(), + __ mov(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(), JSObject::kPropertiesOffset)); GenerateDictionaryLoad(masm, &slow, dictionary, - LoadConvention::NameRegister(), edi, ebx, eax); + LoadDescriptor::NameRegister(), edi, ebx, eax); __ ret(0); // Dictionary load failed, go slow (but don't miss). @@ -862,8 +862,8 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { static void LoadIC_PushArgs(MacroAssembler* masm) { - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); DCHECK(!ebx.is(receiver) && !ebx.is(name)); __ pop(ebx); @@ -922,8 +922,8 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( Code::ComputeHandlerFlags(Code::STORE_IC)); masm->isolate()->stub_cache()->GenerateProbe( - masm, flags, StoreConvention::ReceiverRegister(), - StoreConvention::NameRegister(), ebx, no_reg); + masm, flags, StoreDescriptor::ReceiverRegister(), + StoreDescriptor::NameRegister(), ebx, no_reg); // Cache miss: Jump to runtime. GenerateMiss(masm); @@ -931,9 +931,9 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { static void StoreIC_PushArgs(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value)); @@ -958,9 +958,9 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) { void StoreIC::GenerateNormal(MacroAssembler* masm) { Label restore_miss; - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Register dictionary = ebx; __ mov(dictionary, FieldOperand(receiver, JSObject::kPropertiesOffset)); diff --git a/src/ic/ic-conventions.h b/src/ic/ic-conventions.h deleted file mode 100644 index 28d4d66a0..000000000 --- a/src/ic/ic-conventions.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2014 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef V8_IC_CONVENTIONS_H_ -#define V8_IC_CONVENTIONS_H_ - -namespace v8 { -namespace internal { - -class LoadConvention { - public: - enum ParameterIndices { kReceiverIndex, kNameIndex, kParameterCount }; - static const Register ReceiverRegister(); - static const Register NameRegister(); -}; - - -class VectorLoadConvention : public LoadConvention { - public: - enum ParameterIndices { - kReceiverIndex, - kNameIndex, - kSlotIndex, - kParameterCount - }; - static const Register SlotRegister(); -}; - - -class FullVectorLoadConvention : public VectorLoadConvention { - public: - enum ParameterIndices { - kReceiverIndex, - kNameIndex, - kSlotIndex, - kVectorIndex, - kParameterCount - }; - static const Register VectorRegister(); -}; - - -class StoreConvention { - public: - enum ParameterIndices { - kReceiverIndex, - kNameIndex, - kValueIndex, - kParameterCount - }; - static const Register ReceiverRegister(); - static const Register NameRegister(); - static const Register ValueRegister(); - - // The map register isn't part of the normal call specification, but - // ElementsTransitionAndStoreStub, used in polymorphic keyed store - // stub implementations requires it to be initialized. - static const Register MapRegister(); -}; - - -class InstanceofConvention { - public: - enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount }; - static const Register left(); - static const Register right(); -}; -} -} // namespace v8::internal - -#endif // V8_IC_CONVENTIONS_H_ diff --git a/src/ic/x64/access-compiler-x64.cc b/src/ic/x64/access-compiler-x64.cc index bb96570b1..cd9196f52 100644 --- a/src/ic/x64/access-compiler-x64.cc +++ b/src/ic/x64/access-compiler-x64.cc @@ -22,8 +22,8 @@ void PropertyAccessCompiler::GenerateTailCall(MacroAssembler* masm, Register* PropertyAccessCompiler::load_calling_convention() { // receiver, name, scratch1, scratch2, scratch3, scratch4. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); static Register registers[] = {receiver, name, rax, rbx, rdi, r8}; return registers; } @@ -31,9 +31,9 @@ Register* PropertyAccessCompiler::load_calling_convention() { Register* PropertyAccessCompiler::store_calling_convention() { // receiver, name, scratch1, scratch2, scratch3. - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - DCHECK(rbx.is(StoreConvention::MapRegister())); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + DCHECK(rbx.is(ElementTransitionAndStoreDescriptor::MapRegister())); static Register registers[] = {receiver, name, rbx, rdi, r8}; return registers; } diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc index c67c04832..f4730f61f 100644 --- a/src/ic/x64/handler-compiler-x64.cc +++ b/src/ic/x64/handler-compiler-x64.cc @@ -283,8 +283,8 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement( // -- rdx : receiver // -- rsp[0] : return address // ----------------------------------- - DCHECK(rdx.is(LoadConvention::ReceiverRegister())); - DCHECK(rcx.is(LoadConvention::NameRegister())); + DCHECK(rdx.is(LoadDescriptor::ReceiverRegister())); + DCHECK(rcx.is(LoadDescriptor::NameRegister())); Label slow, miss; // This stub is meant to be tail-jumped to, the receiver must already @@ -321,9 +321,9 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement( static void StoreIC_PushArgs(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(!rbx.is(receiver) && !rbx.is(name) && !rbx.is(value)); @@ -839,7 +839,7 @@ Handle NamedStoreHandlerCompiler::CompileStoreInterceptor( Register NamedStoreHandlerCompiler::value() { - return StoreConvention::ValueRegister(); + return StoreDescriptor::ValueRegister(); } @@ -849,7 +849,7 @@ Handle NamedLoadHandlerCompiler::CompileLoadGlobal( FrontendHeader(receiver(), name, &miss); // Get the value from the cell. - Register result = StoreConvention::ValueRegister(); + Register result = StoreDescriptor::ValueRegister(); __ Move(result, cell); __ movp(result, FieldOperand(result, PropertyCell::kValueOffset)); diff --git a/src/ic/x64/ic-compiler-x64.cc b/src/ic/x64/ic-compiler-x64.cc index 8830009d8..4422f5093 100644 --- a/src/ic/x64/ic-compiler-x64.cc +++ b/src/ic/x64/ic-compiler-x64.cc @@ -17,14 +17,14 @@ namespace internal { void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm, StrictMode strict_mode) { // Return address is on the stack. - DCHECK(!rbx.is(StoreConvention::ReceiverRegister()) && - !rbx.is(StoreConvention::NameRegister()) && - !rbx.is(StoreConvention::ValueRegister())); + DCHECK(!rbx.is(StoreDescriptor::ReceiverRegister()) && + !rbx.is(StoreDescriptor::NameRegister()) && + !rbx.is(StoreDescriptor::ValueRegister())); __ PopReturnAddressTo(rbx); - __ Push(StoreConvention::ReceiverRegister()); - __ Push(StoreConvention::NameRegister()); - __ Push(StoreConvention::ValueRegister()); + __ Push(StoreDescriptor::ReceiverRegister()); + __ Push(StoreDescriptor::NameRegister()); + __ Push(StoreDescriptor::ValueRegister()); __ Push(Smi::FromInt(strict_mode)); __ PushReturnAddressFrom(rbx); @@ -95,7 +95,7 @@ Handle PropertyICCompiler::CompilePolymorphic(TypeHandleList* types, // Polymorphic keyed stores may use the map register Register map_reg = scratch1(); DCHECK(kind() != Code::KEYED_STORE_IC || - map_reg.is(StoreConvention::MapRegister())); + map_reg.is(ElementTransitionAndStoreDescriptor::MapRegister())); __ movp(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset)); int receiver_count = types->length(); int number_of_handled_maps = 0; diff --git a/src/ic/x64/ic-conventions-x64.cc b/src/ic/x64/ic-conventions-x64.cc deleted file mode 100644 index 0873da53c..000000000 --- a/src/ic/x64/ic-conventions-x64.cc +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2012 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "src/v8.h" - -#if V8_TARGET_ARCH_X64 - -#include "src/codegen.h" -#include "src/ic/ic-conventions.h" - -namespace v8 { -namespace internal { - -// IC register specifications -const Register LoadConvention::ReceiverRegister() { return rdx; } -const Register LoadConvention::NameRegister() { return rcx; } - - -const Register VectorLoadConvention::SlotRegister() { return rax; } - - -const Register FullVectorLoadConvention::VectorRegister() { return rbx; } - - -const Register StoreConvention::ReceiverRegister() { return rdx; } -const Register StoreConvention::NameRegister() { return rcx; } -const Register StoreConvention::ValueRegister() { return rax; } -const Register StoreConvention::MapRegister() { return rbx; } - - -// Passing arguments in registers is not supported. -const Register InstanceofConvention::left() { return rax; } -const Register InstanceofConvention::right() { return rdx; } -} -} // namespace v8::internal - -#endif // V8_TARGET_ARCH_X64 diff --git a/src/ic/x64/ic-x64.cc b/src/ic/x64/ic-x64.cc index eed9cf708..b242c1dbc 100644 --- a/src/ic/x64/ic-x64.cc +++ b/src/ic/x64/ic-x64.cc @@ -257,8 +257,8 @@ void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { Label slow, check_name, index_smi, index_name, property_array_property; Label probe_dictionary, check_number_dictionary; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); DCHECK(receiver.is(rdx)); DCHECK(key.is(rcx)); @@ -407,8 +407,8 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) { // Return address is on the stack. Label miss; - Register receiver = LoadConvention::ReceiverRegister(); - Register index = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register index = LoadDescriptor::NameRegister(); Register scratch = rbx; Register result = rax; DCHECK(!scratch.is(receiver) && !scratch.is(index)); @@ -433,8 +433,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { // Return address is on the stack. Label slow; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); Register scratch = rax; DCHECK(!scratch.is(receiver) && !scratch.is(key)); @@ -478,9 +478,9 @@ static void KeyedStoreGenerateGenericHelper( Label transition_smi_elements; Label finish_object_store, non_double_value, transition_double_elements; Label fast_double_without_map_check; - Register receiver = StoreConvention::ReceiverRegister(); - Register key = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register key = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(receiver.is(rdx)); DCHECK(key.is(rcx)); DCHECK(value.is(rax)); @@ -615,8 +615,8 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, Label slow, slow_with_tagged_index, fast_object, fast_object_grow; Label fast_double, fast_double_grow; Label array, extra, check_if_double_array; - Register receiver = StoreConvention::ReceiverRegister(); - Register key = StoreConvention::NameRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register key = StoreDescriptor::NameRegister(); DCHECK(receiver.is(rdx)); DCHECK(key.is(rcx)); @@ -767,8 +767,8 @@ static Operand GenerateUnmappedArgumentsLookup(MacroAssembler* masm, void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { // The return address is on the stack. - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); DCHECK(receiver.is(rdx)); DCHECK(key.is(rcx)); @@ -793,9 +793,9 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { // The return address is on the stack. Label slow, notin; - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(receiver.is(rdx)); DCHECK(name.is(rcx)); DCHECK(value.is(rax)); @@ -825,8 +825,8 @@ void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { // The return address is on the stack. - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); DCHECK(receiver.is(rdx)); DCHECK(name.is(rcx)); @@ -842,15 +842,15 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { void LoadIC::GenerateNormal(MacroAssembler* masm) { Register dictionary = rax; - DCHECK(!dictionary.is(LoadConvention::ReceiverRegister())); - DCHECK(!dictionary.is(LoadConvention::NameRegister())); + DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); + DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); Label slow; - __ movp(dictionary, FieldOperand(LoadConvention::ReceiverRegister(), + __ movp(dictionary, FieldOperand(LoadDescriptor::ReceiverRegister(), JSObject::kPropertiesOffset)); GenerateDictionaryLoad(masm, &slow, dictionary, - LoadConvention::NameRegister(), rbx, rdi, rax); + LoadDescriptor::NameRegister(), rbx, rdi, rax); __ ret(0); // Dictionary load failed, go slow (but don't miss). @@ -873,8 +873,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { __ IncrementCounter(counters->load_miss(), 1); __ PopReturnAddressTo(LoadIC_TempRegister()); - __ Push(LoadConvention::ReceiverRegister()); // receiver - __ Push(LoadConvention::NameRegister()); // name + __ Push(LoadDescriptor::ReceiverRegister()); // receiver + __ Push(LoadDescriptor::NameRegister()); // name __ PushReturnAddressFrom(LoadIC_TempRegister()); // Perform tail call to the entry. @@ -888,8 +888,8 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is on the stack. __ PopReturnAddressTo(LoadIC_TempRegister()); - __ Push(LoadConvention::ReceiverRegister()); // receiver - __ Push(LoadConvention::NameRegister()); // name + __ Push(LoadDescriptor::ReceiverRegister()); // receiver + __ Push(LoadDescriptor::NameRegister()); // name __ PushReturnAddressFrom(LoadIC_TempRegister()); // Perform tail call to the entry. @@ -903,8 +903,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { __ IncrementCounter(counters->keyed_load_miss(), 1); __ PopReturnAddressTo(KeyedLoadIC_TempRegister()); - __ Push(LoadConvention::ReceiverRegister()); // receiver - __ Push(LoadConvention::NameRegister()); // name + __ Push(LoadDescriptor::ReceiverRegister()); // receiver + __ Push(LoadDescriptor::NameRegister()); // name __ PushReturnAddressFrom(KeyedLoadIC_TempRegister()); // Perform tail call to the entry. @@ -918,8 +918,8 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { // The return address is on the stack. __ PopReturnAddressTo(KeyedLoadIC_TempRegister()); - __ Push(LoadConvention::ReceiverRegister()); // receiver - __ Push(LoadConvention::NameRegister()); // name + __ Push(LoadDescriptor::ReceiverRegister()); // receiver + __ Push(LoadDescriptor::NameRegister()); // name __ PushReturnAddressFrom(KeyedLoadIC_TempRegister()); // Perform tail call to the entry. @@ -934,8 +934,8 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( Code::ComputeHandlerFlags(Code::STORE_IC)); masm->isolate()->stub_cache()->GenerateProbe( - masm, flags, StoreConvention::ReceiverRegister(), - StoreConvention::NameRegister(), rbx, no_reg); + masm, flags, StoreDescriptor::ReceiverRegister(), + StoreDescriptor::NameRegister(), rbx, no_reg); // Cache miss: Jump to runtime. GenerateMiss(masm); @@ -943,9 +943,9 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { static void StoreIC_PushArgs(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); DCHECK(!rbx.is(receiver) && !rbx.is(name) && !rbx.is(value)); @@ -969,9 +969,9 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) { void StoreIC::GenerateNormal(MacroAssembler* masm) { - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Register dictionary = rbx; Label miss; diff --git a/src/interface-descriptors.cc b/src/interface-descriptors.cc index 2661b09bc..a953337c1 100644 --- a/src/interface-descriptors.cc +++ b/src/interface-descriptors.cc @@ -4,13 +4,12 @@ #include "src/v8.h" -#include "src/ic/ic-conventions.h" #include "src/interface-descriptors.h" namespace v8 { namespace internal { -void CallInterfaceDescriptor::Initialize( +void CallInterfaceDescriptorData::Initialize( int register_parameter_count, Register* registers, Representation* register_param_representations, PlatformInterfaceDescriptor* platform_descriptor) { @@ -18,7 +17,8 @@ void CallInterfaceDescriptor::Initialize( register_param_count_ = register_parameter_count; // An interface descriptor must have a context register. - DCHECK(register_parameter_count > 0 && registers[0].is(ContextRegister())); + DCHECK(register_parameter_count > 0 && + registers[0].is(CallInterfaceDescriptor::ContextRegister())); // InterfaceDescriptor owns a copy of the registers array. register_params_.Reset(NewArray(register_parameter_count)); @@ -42,51 +42,50 @@ void CallInterfaceDescriptor::Initialize( } -void CallDescriptors::InitializeForIsolateAllPlatforms(Isolate* isolate) { - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::LoadICCall); - Register registers[] = {CallInterfaceDescriptor::ContextRegister(), - LoadConvention::ReceiverRegister(), - LoadConvention::NameRegister()}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::StoreICCall); - Register registers[] = {CallInterfaceDescriptor::ContextRegister(), - StoreConvention::ReceiverRegister(), - StoreConvention::NameRegister(), - StoreConvention::ValueRegister()}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::ElementTransitionAndStoreCall); - Register registers[] = { - CallInterfaceDescriptor::ContextRegister(), - StoreConvention::ValueRegister(), StoreConvention::MapRegister(), - StoreConvention::NameRegister(), StoreConvention::ReceiverRegister()}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::InstanceofCall); - Register registers[] = {CallInterfaceDescriptor::ContextRegister(), - InstanceofConvention::left(), - InstanceofConvention::right()}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::VectorLoadICCall); - Register registers[] = {CallInterfaceDescriptor::ContextRegister(), - FullVectorLoadConvention::ReceiverRegister(), - FullVectorLoadConvention::NameRegister(), - FullVectorLoadConvention::SlotRegister(), - FullVectorLoadConvention::VectorRegister()}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } +void LoadDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {ContextRegister(), ReceiverRegister(), + NameRegister()}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void StoreDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), + ValueRegister()}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ElementTransitionAndStoreDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {ContextRegister(), ValueRegister(), MapRegister(), + NameRegister(), ReceiverRegister()}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void InstanceofDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {ContextRegister(), left(), right()}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void VectorLoadICDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {ContextRegister(), ReceiverRegister(), NameRegister(), + SlotRegister(), VectorRegister()}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallDescriptors::InitializeForIsolate(Isolate* isolate) { +// Mechanically initialize all descriptors. The DCHECK makes sure that the +// Initialize() method did what it is supposed to do. + +#define INITIALIZE_DESCRIPTOR(D) \ + D##Descriptor::Initialize(isolate); \ + DCHECK(D##Descriptor(isolate).IsInitialized()); + + INTERFACE_DESCRIPTOR_LIST(INITIALIZE_DESCRIPTOR) +#undef INITIALIZE_DESCRIPTOR } } } // namespace v8::internal diff --git a/src/interface-descriptors.h b/src/interface-descriptors.h index 5b552e892..7c5bb3ecd 100644 --- a/src/interface-descriptors.h +++ b/src/interface-descriptors.h @@ -13,12 +13,45 @@ namespace internal { class PlatformInterfaceDescriptor; -class CallInterfaceDescriptor { +#define INTERFACE_DESCRIPTOR_LIST(V) \ + V(Load) \ + V(Store) \ + V(ElementTransitionAndStore) \ + V(Instanceof) \ + V(VectorLoadIC) \ + V(FastNewClosure) \ + V(FastNewContext) \ + V(ToNumber) \ + V(NumberToString) \ + V(FastCloneShallowArray) \ + V(FastCloneShallowObject) \ + V(CreateAllocationSite) \ + V(CallFunction) \ + V(CallConstruct) \ + V(RegExpConstructResult) \ + V(TransitionElementsKind) \ + V(ArrayConstructorConstantArgCount) \ + V(ArrayConstructor) \ + V(InternalArrayConstructorConstantArgCount) \ + V(InternalArrayConstructor) \ + V(CompareNil) \ + V(ToBoolean) \ + V(BinaryOp) \ + V(BinaryOpWithAllocationSite) \ + V(StringAdd) \ + V(Keyed) \ + V(Named) \ + V(CallHandler) \ + V(ArgumentAdaptor) \ + V(ApiFunction) + + +class CallInterfaceDescriptorData { public: - CallInterfaceDescriptor() : register_param_count_(-1) {} + CallInterfaceDescriptorData() : register_param_count_(-1) {} // A copy of the passed in registers and param_representations is made - // and owned by the CallInterfaceDescriptor. + // and owned by the CallInterfaceDescriptorData. // TODO(mvstanton): Instead of taking parallel arrays register and // param_representations, how about a struct that puts the representation @@ -30,21 +63,80 @@ class CallInterfaceDescriptor { bool IsInitialized() const { return register_param_count_ >= 0; } - int GetEnvironmentLength() const { return register_param_count_; } + int register_param_count() const { return register_param_count_; } + Register register_param(int index) const { return register_params_[index]; } + Register* register_params() const { return register_params_.get(); } + Representation register_param_representation(int index) const { + return register_param_representations_[index]; + } + Representation* register_param_representations() const { + return register_param_representations_.get(); + } + PlatformInterfaceDescriptor* platform_specific_descriptor() const { + return platform_specific_descriptor_; + } + + private: + int register_param_count_; + + // The Register params are allocated dynamically by the + // InterfaceDescriptor, and freed on destruction. This is because static + // arrays of Registers cause creation of runtime static initializers + // which we don't want. + SmartArrayPointer register_params_; + // Specifies Representations for the stub's parameter. Points to an array of + // Representations of the same length of the numbers of parameters to the + // stub, or if NULL (the default value), Representation of each parameter + // assumed to be Tagged(). + SmartArrayPointer register_param_representations_; - int GetRegisterParameterCount() const { return register_param_count_; } + PlatformInterfaceDescriptor* platform_specific_descriptor_; + + DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptorData); +}; + + +class CallDescriptors { + public: + enum Key { +#define DEF_ENUM(name) name, + INTERFACE_DESCRIPTOR_LIST(DEF_ENUM) +#undef DEF_ENUM + NUMBER_OF_DESCRIPTORS + }; + + static void InitializeForIsolate(Isolate* isolate); +}; + + +class CallInterfaceDescriptor { + public: + CallInterfaceDescriptor() : data_(NULL) {} + + CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key) + : data_(isolate->call_descriptor_data(key)) {} + + bool IsInitialized() const { + return data() != NULL && data()->IsInitialized(); + } + + int GetEnvironmentLength() const { return data()->register_param_count(); } + + int GetRegisterParameterCount() const { + return data()->register_param_count(); + } Register GetParameterRegister(int index) const { - return register_params_[index]; + return data()->register_param(index); } Representation GetParameterRepresentation(int index) const { - DCHECK(index < register_param_count_); - if (register_param_representations_.get() == NULL) { + DCHECK(index < data()->register_param_count()); + if (data()->register_param_representations() == NULL) { return Representation::Tagged(); } - return register_param_representations_[index]; + return data()->register_param_representation(index); } // "Environment" versions of parameter functions. The first register @@ -63,76 +155,264 @@ class CallInterfaceDescriptor { // Some platforms have extra information to associate with the descriptor. PlatformInterfaceDescriptor* platform_specific_descriptor() const { - return platform_specific_descriptor_; + return data()->platform_specific_descriptor(); } static const Register ContextRegister(); + protected: + const CallInterfaceDescriptorData* data() const { return data_; } + + static void InitializeData( + Isolate* isolate, CallDescriptors::Key key, int register_parameter_count, + Register* registers, Representation* param_representations, + PlatformInterfaceDescriptor* platform_descriptor = NULL) { + isolate->call_descriptor_data(key) + ->Initialize(register_parameter_count, registers, param_representations, + platform_descriptor); + } + private: - int register_param_count_; + const CallInterfaceDescriptorData* data_; +}; - // The Register params are allocated dynamically by the - // InterfaceDescriptor, and freed on destruction. This is because static - // arrays of Registers cause creation of runtime static initializers - // which we don't want. - SmartArrayPointer register_params_; - // Specifies Representations for the stub's parameter. Points to an array of - // Representations of the same length of the numbers of parameters to the - // stub, or if NULL (the default value), Representation of each parameter - // assumed to be Tagged(). - SmartArrayPointer register_param_representations_; - PlatformInterfaceDescriptor* platform_specific_descriptor_; +#define DECLARE_DESCRIPTOR(name) \ + explicit name(Isolate* isolate) : CallInterfaceDescriptor(isolate, key()) {} \ + static inline CallDescriptors::Key key(); \ + static void Initialize(Isolate* isolate); + - DISALLOW_COPY_AND_ASSIGN(CallInterfaceDescriptor); -}; - - -enum CallDescriptorKey { - LoadICCall, - StoreICCall, - ElementTransitionAndStoreCall, - InstanceofCall, - VectorLoadICCall, - FastNewClosureCall, - FastNewContextCall, - ToNumberCall, - NumberToStringCall, - FastCloneShallowArrayCall, - FastCloneShallowObjectCall, - CreateAllocationSiteCall, - CallFunctionCall, - CallConstructCall, - RegExpConstructResultCall, - TransitionElementsKindCall, - ArrayConstructorConstantArgCountCall, - ArrayConstructorCall, - InternalArrayConstructorConstantArgCountCall, - InternalArrayConstructorCall, - CompareNilCall, - ToBooleanCall, - BinaryOpCall, - BinaryOpWithAllocationSiteCall, - StringAddCall, - KeyedCall, - NamedCall, - CallHandler, - ArgumentAdaptorCall, - ApiFunctionCall, - NUMBER_OF_CALL_DESCRIPTORS +class LoadDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(LoadDescriptor) + + enum ParameterIndices { kReceiverIndex, kNameIndex }; + static const Register ReceiverRegister(); + static const Register NameRegister(); }; -class CallDescriptors { +class StoreDescriptor : public CallInterfaceDescriptor { public: - static void InitializeForIsolate(Isolate* isolate); + DECLARE_DESCRIPTOR(StoreDescriptor) - private: - static void InitializeForIsolateAllPlatforms(Isolate* isolate); + enum ParameterIndices { + kReceiverIndex, + kNameIndex, + kValueIndex, + kParameterCount + }; + static const Register ReceiverRegister(); + static const Register NameRegister(); + static const Register ValueRegister(); }; + + +class ElementTransitionAndStoreDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(ElementTransitionAndStoreDescriptor) + + static const Register ReceiverRegister(); + static const Register NameRegister(); + static const Register ValueRegister(); + static const Register MapRegister(); +}; + + +class InstanceofDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(InstanceofDescriptor) + + enum ParameterIndices { kLeftIndex, kRightIndex, kParameterCount }; + static const Register left(); + static const Register right(); +}; + + +class VectorLoadICDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(VectorLoadICDescriptor) + + enum ParameterIndices { + kReceiverIndex, + kNameIndex, + kSlotIndex, + kVectorIndex, + kParameterCount + }; + + static const Register ReceiverRegister(); + static const Register NameRegister(); + static const Register SlotRegister(); + static const Register VectorRegister(); +}; + + +class FastNewClosureDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(FastNewClosureDescriptor) +}; + + +class FastNewContextDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(FastNewContextDescriptor) +}; + + +class ToNumberDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(ToNumberDescriptor) +}; + + +class NumberToStringDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(NumberToStringDescriptor) +}; + + +class FastCloneShallowArrayDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(FastCloneShallowArrayDescriptor) +}; + + +class FastCloneShallowObjectDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(FastCloneShallowObjectDescriptor) +}; + + +class CreateAllocationSiteDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(CreateAllocationSiteDescriptor) +}; + + +class CallFunctionDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(CallFunctionDescriptor) +}; + + +class CallConstructDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(CallConstructDescriptor) +}; + + +class RegExpConstructResultDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(RegExpConstructResultDescriptor) +}; + + +class TransitionElementsKindDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(TransitionElementsKindDescriptor) +}; + + +class ArrayConstructorConstantArgCountDescriptor + : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor) +}; + + +class ArrayConstructorDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(ArrayConstructorDescriptor) +}; + + +class InternalArrayConstructorConstantArgCountDescriptor + : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor) +}; + + +class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(InternalArrayConstructorDescriptor) +}; + + +class CompareNilDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(CompareNilDescriptor) +}; + + +class ToBooleanDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(ToBooleanDescriptor) +}; + + +class BinaryOpDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(BinaryOpDescriptor) +}; + + +class BinaryOpWithAllocationSiteDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(BinaryOpWithAllocationSiteDescriptor) +}; + + +class StringAddDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(StringAddDescriptor) +}; + + +class KeyedDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(KeyedDescriptor) +}; + + +class NamedDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(NamedDescriptor) +}; + + +class CallHandlerDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(CallHandlerDescriptor) +}; + + +class ArgumentAdaptorDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(ArgumentAdaptorDescriptor) +}; + + +class ApiFunctionDescriptor : public CallInterfaceDescriptor { + public: + DECLARE_DESCRIPTOR(ApiFunctionDescriptor) +}; + +#undef DECLARE_DESCRIPTOR + + +// We define the association between CallDescriptors::Key and the specialized +// descriptor here to reduce boilerplate and mistakes. +#define DEF_KEY(name) \ + CallDescriptors::Key name##Descriptor::key() { return CallDescriptors::name; } +INTERFACE_DESCRIPTOR_LIST(DEF_KEY) +#undef DEF_KEY } } // namespace v8::internal + #if V8_TARGET_ARCH_ARM64 #include "src/arm64/interface-descriptors-arm64.h" #elif V8_TARGET_ARCH_ARM diff --git a/src/isolate.cc b/src/isolate.cc index 2a8b7b20a..f894b4921 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -1505,7 +1505,7 @@ Isolate::Isolate() regexp_stack_(NULL), date_cache_(NULL), code_stub_interface_descriptors_(NULL), - call_descriptors_(NULL), + call_descriptor_data_(NULL), // TODO(bmeurer) Initialized lazily because it depends on flags; can // be fixed once the default isolate cleanup is done. random_number_generator_(NULL), @@ -1704,8 +1704,8 @@ Isolate::~Isolate() { delete[] code_stub_interface_descriptors_; code_stub_interface_descriptors_ = NULL; - delete[] call_descriptors_; - call_descriptors_ = NULL; + delete[] call_descriptor_data_; + call_descriptor_data_ = NULL; delete regexp_stack_; regexp_stack_ = NULL; @@ -1882,8 +1882,8 @@ bool Isolate::Init(Deserializer* des) { date_cache_ = new DateCache(); code_stub_interface_descriptors_ = new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; - call_descriptors_ = - new CallInterfaceDescriptor[NUMBER_OF_CALL_DESCRIPTORS]; + call_descriptor_data_ = + new CallInterfaceDescriptorData[CallDescriptors::NUMBER_OF_DESCRIPTORS]; cpu_profiler_ = new CpuProfiler(this); heap_profiler_ = new HeapProfiler(heap()); @@ -2239,9 +2239,9 @@ CodeStubInterfaceDescriptor* } -CallInterfaceDescriptor* Isolate::call_descriptor(int index) { - DCHECK(0 <= index && index < CallDescriptorKey::NUMBER_OF_CALL_DESCRIPTORS); - return &call_descriptors_[index]; +CallInterfaceDescriptorData* Isolate::call_descriptor_data(int index) { + DCHECK(0 <= index && index < CallDescriptors::NUMBER_OF_DESCRIPTORS); + return &call_descriptor_data_[index]; } diff --git a/src/isolate.h b/src/isolate.h index 43ba6c6eb..f3030a98c 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -33,7 +33,7 @@ class RandomNumberGenerator; namespace internal { class Bootstrapper; -class CallInterfaceDescriptor; +class CallInterfaceDescriptorData; class CodeGenerator; class CodeRange; class CodeStubInterfaceDescriptor; @@ -1037,7 +1037,7 @@ class Isolate { CodeStubInterfaceDescriptor* code_stub_interface_descriptor(int index); - CallInterfaceDescriptor* call_descriptor(int index); + CallInterfaceDescriptorData* call_descriptor_data(int index); void IterateDeferredHandles(ObjectVisitor* visitor); void LinkDeferredHandles(DeferredHandles* deferred_handles); @@ -1274,7 +1274,7 @@ class Isolate { DateCache* date_cache_; unibrow::Mapping interp_canonicalize_mapping_; CodeStubInterfaceDescriptor* code_stub_interface_descriptors_; - CallInterfaceDescriptor* call_descriptors_; + CallInterfaceDescriptorData* call_descriptor_data_; base::RandomNumberGenerator* random_number_generator_; // Whether the isolate has been created for snapshotting. diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc index 0cf3405b4..8c2f34767 100644 --- a/src/x64/builtins-x64.cc +++ b/src/x64/builtins-x64.cc @@ -1065,8 +1065,8 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { // Copy all arguments from the array to the stack. Label entry, loop; - Register receiver = LoadConvention::ReceiverRegister(); - Register key = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register key = LoadDescriptor::NameRegister(); __ movp(key, Operand(rbp, kIndexOffset)); __ jmp(&entry); __ bind(&loop); @@ -1074,7 +1074,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) { // Use inline caching to speed up access to arguments. if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), Smi::FromInt(0)); + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(0)); } Handle ic = masm->isolate()->builtins()->KeyedLoadIC_Initialize(); diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index f64644a0d..12f53b161 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -27,14 +27,12 @@ static void InitializeArrayConstructorDescriptor( Runtime::kArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); + ArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); + ArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, rax, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -46,22 +44,16 @@ static void InitializeInternalArrayConstructorDescriptor( Isolate* isolate, CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor, int constant_stack_parameter_count) { - // register state - // rsi -- context - // rax -- number of arguments - // rdi -- constructor function Address deopt_handler = Runtime::FunctionForId( Runtime::kInternalArrayConstructor)->entry; if (constant_stack_parameter_count == 0) { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); + InternalArrayConstructorConstantArgCountDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE); } else { - CallInterfaceDescriptor* call_descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); + InternalArrayConstructorDescriptor call_descriptor(isolate); descriptor->Initialize(major, call_descriptor, rax, deopt_handler, constant_stack_parameter_count, JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS); @@ -541,7 +533,7 @@ void MathPowStub::Generate(MacroAssembler* masm) { void FunctionPrototypeStub::Generate(MacroAssembler* masm) { Label miss; - Register receiver = LoadConvention::ReceiverRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8, r9, &miss); @@ -4181,14 +4173,14 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { void LoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorLoadStub stub(isolate(), state()); __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); } void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { - EmitLoadTypeFeedbackVector(masm, FullVectorLoadConvention::VectorRegister()); + EmitLoadTypeFeedbackVector(masm, VectorLoadICDescriptor::VectorRegister()); VectorKeyedLoadStub stub(isolate()); __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); } diff --git a/src/x64/debug-x64.cc b/src/x64/debug-x64.cc index 5ad5b5876..c8b7c2246 100644 --- a/src/x64/debug-x64.cc +++ b/src/x64/debug-x64.cc @@ -162,17 +162,17 @@ void DebugCodegen::GenerateCallICStubDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateLoadICDebugBreak(MacroAssembler* masm) { // Register state for IC load call (from ic-x64.cc). - Register receiver = LoadConvention::ReceiverRegister(); - Register name = LoadConvention::NameRegister(); + Register receiver = LoadDescriptor::ReceiverRegister(); + Register name = LoadDescriptor::NameRegister(); Generate_DebugBreakCallHelper(masm, receiver.bit() | name.bit(), 0, false); } void DebugCodegen::GenerateStoreICDebugBreak(MacroAssembler* masm) { // Register state for IC store call (from ic-x64.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.bit() | name.bit() | value.bit(), 0, false); } @@ -186,9 +186,9 @@ void DebugCodegen::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { void DebugCodegen::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { // Register state for keyed IC store call (from ic-x64.cc). - Register receiver = StoreConvention::ReceiverRegister(); - Register name = StoreConvention::NameRegister(); - Register value = StoreConvention::ValueRegister(); + Register receiver = StoreDescriptor::ReceiverRegister(); + Register name = StoreDescriptor::NameRegister(); + Register value = StoreDescriptor::ValueRegister(); Generate_DebugBreakCallHelper( masm, receiver.bit() | name.bit() | value.bit(), 0, false); } diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc index ee901f85c..7565ee9e7 100644 --- a/src/x64/full-codegen-x64.cc +++ b/src/x64/full-codegen-x64.cc @@ -1362,10 +1362,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, // All extension objects were empty and it is safe to use a global // load IC call. - __ movp(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); - __ Move(LoadConvention::NameRegister(), proxy->var()->name()); + __ movp(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); + __ Move(LoadDescriptor::NameRegister(), proxy->var()->name()); if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(proxy->VariableFeedbackSlot())); } @@ -1448,10 +1448,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { switch (var->location()) { case Variable::UNALLOCATED: { Comment cmnt(masm_, "[ Global variable"); - __ Move(LoadConvention::NameRegister(), var->name()); - __ movp(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); + __ Move(LoadDescriptor::NameRegister(), var->name()); + __ movp(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(proxy->VariableFeedbackSlot())); } CallLoadIC(CONTEXTUAL); @@ -1666,9 +1666,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { if (key->value()->IsInternalizedString()) { if (property->emit_store()) { VisitForAccumulatorValue(value); - DCHECK(StoreConvention::ValueRegister().is(rax)); - __ Move(StoreConvention::NameRegister(), key->value()); - __ movp(StoreConvention::ReceiverRegister(), Operand(rsp, 0)); + DCHECK(StoreDescriptor::ValueRegister().is(rax)); + __ Move(StoreDescriptor::NameRegister(), key->value()); + __ movp(StoreDescriptor::ReceiverRegister(), Operand(rsp, 0)); CallStoreIC(key->LiteralFeedbackId()); PrepareForBailoutForId(key->id(), NO_REGISTERS); } else { @@ -1847,7 +1847,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { // We need the receiver both on the stack and in the register. VisitForStackValue(property->obj()); - __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0)); + __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, 0)); } else { VisitForStackValue(property->obj()); } @@ -1856,8 +1856,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { if (expr->is_compound()) { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); - __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, kPointerSize)); - __ movp(LoadConvention::NameRegister(), Operand(rsp, 0)); + __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, kPointerSize)); + __ movp(LoadDescriptor::NameRegister(), Operand(rsp, 0)); } else { VisitForStackValue(property->obj()); VisitForStackValue(property->key()); @@ -1998,8 +1998,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) { Label l_catch, l_try, l_suspend, l_continuation, l_resume; Label l_next, l_call, l_loop; - Register load_receiver = LoadConvention::ReceiverRegister(); - Register load_name = LoadConvention::NameRegister(); + Register load_receiver = LoadDescriptor::ReceiverRegister(); + Register load_name = LoadDescriptor::NameRegister(); // Initial send value is undefined. __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); @@ -2056,7 +2056,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ bind(&l_call); __ movp(load_receiver, Operand(rsp, kPointerSize)); if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->KeyedLoadFeedbackSlot())); } Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); @@ -2075,7 +2075,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ Push(load_receiver); // save result __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->DoneFeedbackSlot())); } CallLoadIC(NOT_CONTEXTUAL); // rax=result.done @@ -2088,7 +2088,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { __ Pop(load_receiver); // result __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->ValueFeedbackSlot())); } CallLoadIC(NOT_CONTEXTUAL); // result.value in rax @@ -2251,9 +2251,9 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) { void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Literal* key = prop->key()->AsLiteral(); - __ Move(LoadConvention::NameRegister(), key->value()); + __ Move(LoadDescriptor::NameRegister(), key->value()); if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot())); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -2266,7 +2266,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { SetSourcePosition(prop->position()); Handle ic = isolate()->builtins()->KeyedLoadIC_Initialize(); if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot())); CallIC(ic); } else { @@ -2372,9 +2372,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { case NAMED_PROPERTY: { __ Push(rax); // Preserve value. VisitForAccumulatorValue(prop->obj()); - __ Move(StoreConvention::ReceiverRegister(), rax); - __ Pop(StoreConvention::ValueRegister()); // Restore value. - __ Move(StoreConvention::NameRegister(), + __ Move(StoreDescriptor::ReceiverRegister(), rax); + __ Pop(StoreDescriptor::ValueRegister()); // Restore value. + __ Move(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); CallStoreIC(); break; @@ -2383,9 +2383,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) { __ Push(rax); // Preserve value. VisitForStackValue(prop->obj()); VisitForAccumulatorValue(prop->key()); - __ Move(StoreConvention::NameRegister(), rax); - __ Pop(StoreConvention::ReceiverRegister()); - __ Pop(StoreConvention::ValueRegister()); // Restore value. + __ Move(StoreDescriptor::NameRegister(), rax); + __ Pop(StoreDescriptor::ReceiverRegister()); + __ Pop(StoreDescriptor::ValueRegister()); // Restore value. Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -2412,8 +2412,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { if (var->IsUnallocated()) { // Global var, const, or let. - __ Move(StoreConvention::NameRegister(), var->name()); - __ movp(StoreConvention::ReceiverRegister(), GlobalObjectOperand()); + __ Move(StoreDescriptor::NameRegister(), var->name()); + __ movp(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); CallStoreIC(); } else if (op == Token::INIT_CONST_LEGACY) { @@ -2483,8 +2483,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { // Record source code position before IC call. SetSourcePosition(expr->position()); - __ Move(StoreConvention::NameRegister(), prop->key()->AsLiteral()->value()); - __ Pop(StoreConvention::ReceiverRegister()); + __ Move(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); + __ Pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->AssignmentFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); @@ -2495,9 +2495,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) { // Assignment to a property, using a keyed store IC. - __ Pop(StoreConvention::NameRegister()); // Key. - __ Pop(StoreConvention::ReceiverRegister()); - DCHECK(StoreConvention::ValueRegister().is(rax)); + __ Pop(StoreDescriptor::NameRegister()); // Key. + __ Pop(StoreDescriptor::ReceiverRegister()); + DCHECK(StoreDescriptor::ValueRegister().is(rax)); // Record source code position before IC call. SetSourcePosition(expr->position()); Handle ic = strict_mode() == SLOPPY @@ -2516,16 +2516,16 @@ void FullCodeGenerator::VisitProperty(Property* expr) { if (key->IsPropertyName()) { VisitForAccumulatorValue(expr->obj()); - DCHECK(!rax.is(LoadConvention::ReceiverRegister())); - __ movp(LoadConvention::ReceiverRegister(), rax); + DCHECK(!rax.is(LoadDescriptor::ReceiverRegister())); + __ movp(LoadDescriptor::ReceiverRegister(), rax); EmitNamedPropertyLoad(expr); PrepareForBailoutForId(expr->LoadId(), TOS_REG); context()->Plug(rax); } else { VisitForStackValue(expr->obj()); VisitForAccumulatorValue(expr->key()); - __ Move(LoadConvention::NameRegister(), rax); - __ Pop(LoadConvention::ReceiverRegister()); + __ Move(LoadDescriptor::NameRegister(), rax); + __ Pop(LoadDescriptor::ReceiverRegister()); EmitKeyedPropertyLoad(expr); context()->Plug(rax); } @@ -2558,7 +2558,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { } else { // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0)); + __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, 0)); EmitNamedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); // Push the target function under the receiver. @@ -2580,8 +2580,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, // Load the function from the receiver. DCHECK(callee->IsProperty()); - __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0)); - __ Move(LoadConvention::NameRegister(), rax); + __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, 0)); + __ Move(LoadDescriptor::NameRegister(), rax); EmitKeyedPropertyLoad(callee->AsProperty()); PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); @@ -4059,10 +4059,10 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { __ Push(FieldOperand(rax, GlobalObject::kBuiltinsOffset)); // Load the function from the receiver. - __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0)); - __ Move(LoadConvention::NameRegister(), expr->name()); + __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, 0)); + __ Move(LoadDescriptor::NameRegister(), expr->name()); if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(expr->CallRuntimeFeedbackSlot())); CallLoadIC(NOT_CONTEXTUAL); } else { @@ -4245,15 +4245,15 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } if (assign_type == NAMED_PROPERTY) { VisitForStackValue(prop->obj()); - __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0)); + __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, 0)); EmitNamedPropertyLoad(prop); } else { VisitForStackValue(prop->obj()); VisitForStackValue(prop->key()); // Leave receiver on stack - __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, kPointerSize)); + __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, kPointerSize)); // Copy of key, needed for later store. - __ movp(LoadConvention::NameRegister(), Operand(rsp, 0)); + __ movp(LoadDescriptor::NameRegister(), Operand(rsp, 0)); EmitKeyedPropertyLoad(prop); } } @@ -4365,9 +4365,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { } break; case NAMED_PROPERTY: { - __ Move(StoreConvention::NameRegister(), + __ Move(StoreDescriptor::NameRegister(), prop->key()->AsLiteral()->value()); - __ Pop(StoreConvention::ReceiverRegister()); + __ Pop(StoreDescriptor::ReceiverRegister()); CallStoreIC(expr->CountStoreFeedbackId()); PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); if (expr->is_postfix()) { @@ -4380,8 +4380,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { break; } case KEYED_PROPERTY: { - __ Pop(StoreConvention::NameRegister()); - __ Pop(StoreConvention::ReceiverRegister()); + __ Pop(StoreDescriptor::NameRegister()); + __ Pop(StoreDescriptor::ReceiverRegister()); Handle ic = strict_mode() == SLOPPY ? isolate()->builtins()->KeyedStoreIC_Initialize() : isolate()->builtins()->KeyedStoreIC_Initialize_Strict(); @@ -4407,10 +4407,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { if (proxy != NULL && proxy->var()->IsUnallocated()) { Comment cmnt(masm_, "[ Global variable"); - __ Move(LoadConvention::NameRegister(), proxy->name()); - __ movp(LoadConvention::ReceiverRegister(), GlobalObjectOperand()); + __ Move(LoadDescriptor::NameRegister(), proxy->name()); + __ movp(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); if (FLAG_vector_ics) { - __ Move(VectorLoadConvention::SlotRegister(), + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(proxy->VariableFeedbackSlot())); } // Use a regular load, not a contextual load, to avoid a reference diff --git a/src/x64/interface-descriptors-x64.cc b/src/x64/interface-descriptors-x64.cc index e8908843b..2d18ade7e 100644 --- a/src/x64/interface-descriptors-x64.cc +++ b/src/x64/interface-descriptors-x64.cc @@ -14,232 +14,281 @@ namespace internal { const Register CallInterfaceDescriptor::ContextRegister() { return rsi; } -void CallDescriptors::InitializeForIsolate(Isolate* isolate) { - InitializeForIsolateAllPlatforms(isolate); - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); - Register registers[] = {rsi, rbx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); - Register registers[] = {rsi, rdi}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToNumberCall); - // ToNumberStub invokes a function, and therefore needs a context. - Register registers[] = {rsi, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); - Register registers[] = {rsi, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); - Register registers[] = {rsi, rax, rbx, rcx}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Smi(), Representation::Tagged()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); - Register registers[] = {rsi, rax, rbx, rcx, rdx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); - Register registers[] = {rsi, rbx, rdx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); - Register registers[] = {rsi, rdi}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallConstructCall); - // rax : number of arguments - // rbx : feedback vector - // rdx : (only if rbx is not the megamorphic symbol) slot in feedback - // vector (Smi) - // rdi : constructor function - // TODO(turbofan): So far we don't gather type feedback and hence skip the - // slot parameter, but ArrayConstructStub needs the vector to be undefined. - Register registers[] = {rsi, rax, rdi, rbx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); - Register registers[] = {rsi, rcx, rbx, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); - Register registers[] = {rsi, rax, rbx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::ArrayConstructorConstantArgCountCall); - // register state - // rax -- number of arguments - // rdi -- function - // rbx -- allocation site with elements kind - Register registers[] = {rsi, rdi, rbx}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {rsi, rdi, rbx, rax}; - Representation representations[] = { - Representation::Tagged(), Representation::Tagged(), - Representation::Tagged(), Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); - // register state - // rsi -- context - // rax -- number of arguments - // rdi -- constructor function - Register registers[] = {rsi, rdi}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::InternalArrayConstructorCall); - // stack param count needs (constructor pointer, and single argument) - Register registers[] = {rsi, rdi, rax}; - Representation representations[] = {Representation::Tagged(), - Representation::Tagged(), - Representation::Integer32()}; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CompareNilCall); - Register registers[] = {rsi, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); - Register registers[] = {rsi, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); - Register registers[] = {rsi, rdx, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = isolate->call_descriptor( - CallDescriptorKey::BinaryOpWithAllocationSiteCall); - Register registers[] = {rsi, rcx, rdx, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::StringAddCall); - Register registers[] = {rsi, rdx, rax}; - descriptor->Initialize(arraysize(registers), registers, NULL); - } - - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); - Register registers[] = { - rsi, // context - rdi, // JSFunction - rax, // actual number of arguments - rbx, // expected number of arguments - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // JSFunction - Representation::Integer32(), // actual number of arguments - Representation::Integer32(), // expected number of arguments - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::KeyedCall); - Register registers[] = { - rsi, // context - rcx, // key - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // key - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::NamedCall); - Register registers[] = { - rsi, // context - rcx, // name - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // name - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::CallHandler); - Register registers[] = { - rsi, // context - rdx, // receiver - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // receiver - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } - { - CallInterfaceDescriptor* descriptor = - isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); - Register registers[] = { - rsi, // context - rax, // callee - rbx, // call_data - rcx, // holder - rdx, // api_function_address - }; - Representation representations[] = { - Representation::Tagged(), // context - Representation::Tagged(), // callee - Representation::Tagged(), // call_data - Representation::Tagged(), // holder - Representation::External(), // api_function_address - }; - descriptor->Initialize(arraysize(registers), registers, representations); - } +const Register LoadDescriptor::ReceiverRegister() { return rdx; } +const Register LoadDescriptor::NameRegister() { return rcx; } + + +const Register VectorLoadICDescriptor::ReceiverRegister() { + return LoadDescriptor::ReceiverRegister(); +} + + +const Register VectorLoadICDescriptor::NameRegister() { + return LoadDescriptor::NameRegister(); +} + + +const Register VectorLoadICDescriptor::SlotRegister() { return rax; } +const Register VectorLoadICDescriptor::VectorRegister() { return rbx; } + + +const Register StoreDescriptor::ReceiverRegister() { return rdx; } +const Register StoreDescriptor::NameRegister() { return rcx; } +const Register StoreDescriptor::ValueRegister() { return rax; } + + +const Register ElementTransitionAndStoreDescriptor::ReceiverRegister() { + return StoreDescriptor::ReceiverRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::NameRegister() { + return StoreDescriptor::NameRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::ValueRegister() { + return StoreDescriptor::ValueRegister(); +} + + +const Register ElementTransitionAndStoreDescriptor::MapRegister() { + return rbx; +} + + +const Register InstanceofDescriptor::left() { return rax; } +const Register InstanceofDescriptor::right() { return rdx; } + + +void FastNewClosureDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rbx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastNewContextDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rdi}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToNumberDescriptor::Initialize(Isolate* isolate) { + // ToNumberStub invokes a function, and therefore needs a context. + Register registers[] = {rsi, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void NumberToStringDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void FastCloneShallowArrayDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rax, rbx, rcx}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), Representation::Smi(), + Representation::Tagged()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void FastCloneShallowObjectDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rax, rbx, rcx, rdx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CreateAllocationSiteDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rbx, rdx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallFunctionDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rdi}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void CallConstructDescriptor::Initialize(Isolate* isolate) { + // rax : number of arguments + // rbx : feedback vector + // rdx : (only if rbx is not the megamorphic symbol) slot in feedback + // vector (Smi) + // rdi : constructor function + // TODO(turbofan): So far we don't gather type feedback and hence skip the + // slot parameter, but ArrayConstructStub needs the vector to be undefined. + Register registers[] = {rsi, rax, rdi, rbx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void RegExpConstructResultDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rcx, rbx, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void TransitionElementsKindDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rax, rbx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorConstantArgCountDescriptor::Initialize(Isolate* isolate) { + // register state + // rax -- number of arguments + // rdi -- function + // rbx -- allocation site with elements kind + Register registers[] = {rsi, rdi, rbx}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {rsi, rdi, rbx, rax}; + Representation representations[] = { + Representation::Tagged(), Representation::Tagged(), + Representation::Tagged(), Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void InternalArrayConstructorConstantArgCountDescriptor::Initialize( + Isolate* isolate) { + // register state + // rsi -- context + // rax -- number of arguments + // rdi -- constructor function + Register registers[] = {rsi, rdi}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void InternalArrayConstructorDescriptor::Initialize(Isolate* isolate) { + // stack param count needs (constructor pointer, and single argument) + Register registers[] = {rsi, rdi, rax}; + Representation representations[] = {Representation::Tagged(), + Representation::Tagged(), + Representation::Integer32()}; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void CompareNilDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void ToBooleanDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rdx, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void BinaryOpWithAllocationSiteDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rcx, rdx, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void StringAddDescriptor::Initialize(Isolate* isolate) { + Register registers[] = {rsi, rdx, rax}; + InitializeData(isolate, key(), arraysize(registers), registers, NULL); +} + + +void KeyedDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + rsi, // context + rcx, // key + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // key + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void NamedDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + rsi, // context + rcx, // name + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // name + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void CallHandlerDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + rsi, // context + rdx, // receiver + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // receiver + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void ArgumentAdaptorDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + rsi, // context + rdi, // JSFunction + rax, // actual number of arguments + rbx, // expected number of arguments + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // JSFunction + Representation::Integer32(), // actual number of arguments + Representation::Integer32(), // expected number of arguments + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); +} + + +void ApiFunctionDescriptor::Initialize(Isolate* isolate) { + Register registers[] = { + rsi, // context + rax, // callee + rbx, // call_data + rcx, // holder + rdx, // api_function_address + }; + Representation representations[] = { + Representation::Tagged(), // context + Representation::Tagged(), // callee + Representation::Tagged(), // call_data + Representation::Tagged(), // holder + Representation::External(), // api_function_address + }; + InitializeData(isolate, key(), arraysize(registers), registers, + representations); } } } // namespace v8::internal diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 479c10127..a081a53d5 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -2851,11 +2851,11 @@ template void LCodeGen::EmitVectorLoadICRegisters(T* instr) { DCHECK(FLAG_vector_ics); Register vector = ToRegister(instr->temp_vector()); - DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); + DCHECK(vector.is(VectorLoadICDescriptor::VectorRegister())); __ Move(vector, instr->hydrogen()->feedback_vector()); // No need to allocate this register. - DCHECK(VectorLoadConvention::SlotRegister().is(rax)); - __ Move(VectorLoadConvention::SlotRegister(), + DCHECK(VectorLoadICDescriptor::SlotRegister().is(rax)); + __ Move(VectorLoadICDescriptor::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot())); } @@ -2863,10 +2863,10 @@ void LCodeGen::EmitVectorLoadICRegisters(T* instr) { void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { DCHECK(ToRegister(instr->context()).is(rsi)); DCHECK(ToRegister(instr->global_object()) - .is(LoadConvention::ReceiverRegister())); + .is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->result()).is(rax)); - __ Move(LoadConvention::NameRegister(), instr->name()); + __ Move(LoadDescriptor::NameRegister(), instr->name()); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -3006,10 +3006,10 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(rsi)); - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); DCHECK(ToRegister(instr->result()).is(rax)); - __ Move(LoadConvention::NameRegister(), instr->name()); + __ Move(LoadDescriptor::NameRegister(), instr->name()); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); } @@ -3290,8 +3290,8 @@ Operand LCodeGen::BuildFastArrayOperand( void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(rsi)); - DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); + DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); if (FLAG_vector_ics) { EmitVectorLoadICRegisters(instr); @@ -4190,10 +4190,10 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(rsi)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); - __ Move(StoreConvention::NameRegister(), instr->hydrogen()->name()); + __ Move(StoreDescriptor::NameRegister(), instr->hydrogen()->name()); Handle ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); CallCode(ic, RelocInfo::CODE_TARGET, instr); } @@ -4455,9 +4455,9 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { DCHECK(ToRegister(instr->context()).is(rsi)); - DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); - DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); - DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); + DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); + DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); + DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); Handle ic = instr->strict_mode() == STRICT ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 2bcb49133..6b123e630 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -1102,14 +1102,14 @@ LInstruction* LChunkBuilder::DoCallJSFunction( LInstruction* LChunkBuilder::DoCallWithDescriptor( HCallWithDescriptor* instr) { - const CallInterfaceDescriptor* descriptor = instr->descriptor(); + CallInterfaceDescriptor descriptor = instr->descriptor(); LOperand* target = UseRegisterOrConstantAtStart(instr->target()); ZoneList ops(instr->OperandCount(), zone()); ops.Add(target, zone()); for (int i = 1; i < instr->OperandCount(); i++) { - LOperand* op = UseFixed(instr->OperandAt(i), - descriptor->GetParameterRegister(i - 1)); + LOperand* op = + UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); ops.Add(op, zone()); } @@ -2058,10 +2058,10 @@ LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { LOperand* context = UseFixed(instr->context(), rsi); LOperand* global_object = - UseFixed(instr->global_object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadGlobalGeneric* result = @@ -2131,10 +2131,10 @@ LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), rsi); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric( context, object, vector); @@ -2223,11 +2223,11 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), rsi); LOperand* object = - UseFixed(instr->object(), LoadConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), LoadConvention::NameRegister()); + UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); LOperand* vector = NULL; if (FLAG_vector_ics) { - vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); + vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); } LLoadKeyedGeneric* result = @@ -2305,9 +2305,9 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { LOperand* context = UseFixed(instr->context(), rsi); LOperand* object = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* key = UseFixed(instr->key(), StoreConvention::NameRegister()); - LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); + LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); DCHECK(instr->object()->representation().IsTagged()); DCHECK(instr->key()->representation().IsTagged()); @@ -2403,8 +2403,8 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { LOperand* context = UseFixed(instr->context(), rsi); LOperand* object = - UseFixed(instr->object(), StoreConvention::ReceiverRegister()); - LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); + UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); + LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); LStoreNamedGeneric* result = new(zone()) LStoreNamedGeneric(context, object, value); diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index bbb0c96ad..a8291473b 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -1877,10 +1877,10 @@ class LCallJSFunction FINAL : public LTemplateInstruction<1, 1, 0> { class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { public: - LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, + LCallWithDescriptor(CallInterfaceDescriptor descriptor, const ZoneList& operands, Zone* zone) - : inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { - DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); + : inputs_(descriptor.GetRegisterParameterCount() + 1, zone) { + DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length()); inputs_.AddAll(operands, zone); } diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 6c6ad6894..9dda3da72 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -643,7 +643,6 @@ '../../src/ic/ic.h', '../../src/ic/ic-compiler.cc', '../../src/ic/ic-compiler.h', - '../../src/ic/ic-conventions.h', '../../src/interface.cc', '../../src/interface.h', '../../src/interface-descriptors.cc', @@ -837,7 +836,6 @@ '../../src/ic/arm/handler-compiler-arm.cc', '../../src/ic/arm/ic-arm.cc', '../../src/ic/arm/ic-compiler-arm.cc', - '../../src/ic/arm/ic-conventions-arm.cc', '../../src/ic/arm/stub-cache-arm.cc', ], }], @@ -895,7 +893,6 @@ '../../src/ic/arm64/handler-compiler-arm64.cc', '../../src/ic/arm64/ic-arm64.cc', '../../src/ic/arm64/ic-compiler-arm64.cc', - '../../src/ic/arm64/ic-conventions-arm64.cc', '../../src/ic/arm64/stub-cache-arm64.cc', ], }], @@ -935,7 +932,6 @@ '../../src/ic/ia32/handler-compiler-ia32.cc', '../../src/ic/ia32/ic-ia32.cc', '../../src/ic/ia32/ic-compiler-ia32.cc', - '../../src/ic/ia32/ic-conventions-ia32.cc', '../../src/ic/ia32/stub-cache-ia32.cc', ], }], @@ -1089,7 +1085,6 @@ '../../src/ic/x64/handler-compiler-x64.cc', '../../src/ic/x64/ic-x64.cc', '../../src/ic/x64/ic-compiler-x64.cc', - '../../src/ic/x64/ic-conventions-x64.cc', '../../src/ic/x64/stub-cache-x64.cc', ], }],