"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",
"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",
]
"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") {
"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") {
"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") {
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);
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);
void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
Label miss;
- Register receiver = LoadConvention::ReceiverRegister();
+ Register receiver = LoadDescriptor::ReceiverRegister();
NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r3,
r4, &miss);
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);
}
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);
}
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);
}
__ 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())));
}
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);
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 {
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());
}
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());
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);
__ 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<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
__ 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
__ 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
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 {
SetSourcePosition(prop->position());
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
if (FLAG_vector_ics) {
- __ mov(VectorLoadConvention::SlotRegister(),
+ __ mov(VectorLoadICDescriptor::SlotRegister(),
Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
CallIC(ic);
} else {
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;
__ 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<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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) {
// 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);
// 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<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
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);
}
} 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.
// 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);
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 {
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);
}
}
}
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()) {
break;
}
case KEYED_PROPERTY: {
- __ Pop(StoreConvention::ReceiverRegister(),
- StoreConvention::NameRegister());
+ __ Pop(StoreDescriptor::ReceiverRegister(),
+ StoreDescriptor::NameRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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
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
LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) {
- const CallInterfaceDescriptor* descriptor = instr->descriptor();
+ CallInterfaceDescriptor descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> 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());
}
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);
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 =
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 =
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());
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);
class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> {
public:
- LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
+ LCallWithDescriptor(CallInterfaceDescriptor descriptor,
const ZoneList<LOperand*>& 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")
int arity() const { return hydrogen()->argument_count() - 1; }
- const CallInterfaceDescriptor* descriptor_;
+ CallInterfaceDescriptor descriptor_;
ZoneList<LOperand*> inputs_;
// Iterator support.
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())));
}
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<LLoadGlobalGeneric>(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<LLoadNamedGeneric>(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<LLoadKeyedGeneric>(instr);
Handle<Code> code = Handle<Code>::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 {
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<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS);
}
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<Code> ic = instr->strict_mode() == STRICT
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
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);
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);
void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
Label miss;
- Register receiver = LoadConvention::ReceiverRegister();
+ Register receiver = LoadDescriptor::ReceiverRegister();
NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, x10,
x11, &miss);
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);
}
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);
}
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);
}
__ 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()));
}
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);
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 {
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());
}
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());
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 {
// Call keyed load IC. It has arguments key and receiver in r0 and r1.
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
if (FLAG_vector_ics) {
- __ Mov(VectorLoadConvention::SlotRegister(),
+ __ Mov(VectorLoadICDescriptor::SlotRegister(),
Smi::FromInt(prop->PropertyFeedbackSlot()));
CallIC(ic);
} else {
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;
__ 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<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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) {
// 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);
// 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<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
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);
}
} 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.
// 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);
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<String> 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 {
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);
}
}
}
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()) {
break;
}
case KEYED_PROPERTY: {
- __ Pop(StoreConvention::NameRegister());
- __ Pop(StoreConvention::ReceiverRegister());
+ __ Pop(StoreDescriptor::NameRegister());
+ __ Pop(StoreDescriptor::ReceiverRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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
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);
__ 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<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
__ 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
__ 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
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
LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) {
- const CallInterfaceDescriptor* descriptor = instr->descriptor();
+ CallInterfaceDescriptor descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> 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());
}
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 =
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 =
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 =
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());
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);
class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> {
public:
- LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
+ LCallWithDescriptor(CallInterfaceDescriptor descriptor,
const ZoneList<LOperand*>& 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")
int arity() const { return hydrogen()->argument_count() - 1; }
- const CallInterfaceDescriptor* descriptor_;
+ CallInterfaceDescriptor descriptor_;
ZoneList<LOperand*> inputs_;
// Iterator support.
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()));
}
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<LLoadGlobalGeneric>(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<LLoadKeyedGeneric>(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<LLoadNamedGeneric>(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<Code> ic = instr->strict_mode() == STRICT
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
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<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
CallCode(ic, RelocInfo::CODE_TARGET, instr);
}
template <>
HValue* CodeStubGraphBuilder<LoadFastElementStub>::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;
template <>
HValue* CodeStubGraphBuilder<StoreFastElementStub>::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());
Handle<PropertyCell> 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
template <>
HValue* CodeStubGraphBuilder<LoadDictionaryElementStub>::BuildCodeStub() {
- HValue* receiver = GetParameter(LoadConvention::kReceiverIndex);
- HValue* key = GetParameter(LoadConvention::kNameIndex);
+ HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex);
+ HValue* key = GetParameter(LoadDescriptor::kNameIndex);
Add<HCheckSmi>(key);
HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::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(),
template <>
HValue* CodeStubGraphBuilder<VectorLoadStub>::BuildCodeStub() {
- HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex);
+ HValue* receiver = GetParameter(VectorLoadICDescriptor::kReceiverIndex);
Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER);
return receiver;
}
template <>
HValue* CodeStubGraphBuilder<VectorKeyedLoadStub>::BuildCodeStub() {
- HValue* receiver = GetParameter(FullVectorLoadConvention::kReceiverIndex);
+ HValue* receiver = GetParameter(VectorLoadICDescriptor::kReceiverIndex);
Add<HDeoptimize>("Always deopt", Deoptimizer::EAGER);
return receiver;
}
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),
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;
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) {
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));
}
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));
}
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);
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));
}
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));
}
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));
}
void InstanceofStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
- CallInterfaceDescriptor* call_descriptor =
- isolate()->call_descriptor(CallDescriptorKey::InstanceofCall);
+ InstanceofDescriptor call_descriptor(isolate());
descriptor->Initialize(MajorKey(), call_descriptor);
}
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);
}
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);
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);
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);
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);
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);
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);
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(
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(
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(
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));
}
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);
}
#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"
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,
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 {
}
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;
}
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.
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);
};
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:
virtual void InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- CallInterfaceDescriptor* call_descriptor =
- isolate()->call_descriptor(CallDescriptorKey::LoadICCall);
+ LoadDescriptor call_descriptor(isolate());
descriptor->Initialize(MajorKey(), call_descriptor);
}
virtual void InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- CallInterfaceDescriptor* call_descriptor =
- isolate()->call_descriptor(CallDescriptorKey::LoadICCall);
+ LoadDescriptor call_descriptor(isolate());
descriptor->Initialize(MajorKey(), call_descriptor);
}
virtual void InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- CallInterfaceDescriptor* call_descriptor =
- isolate()->call_descriptor(CallDescriptorKey::StoreICCall);
+ StoreDescriptor call_descriptor(isolate());
descriptor->Initialize(MajorKey(), call_descriptor);
}
virtual void InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- CallInterfaceDescriptor* call_descriptor =
- isolate()->call_descriptor(CallDescriptorKey::StoreICCall);
+ StoreDescriptor call_descriptor(isolate());
descriptor->Initialize(MajorKey(), call_descriptor);
}
public:
static HCallWithDescriptor* New(Zone* zone, HValue* context, HValue* target,
int argument_count,
- const CallInterfaceDescriptor* descriptor,
+ CallInterfaceDescriptor descriptor,
const Vector<HValue*>& operands) {
- DCHECK(operands.length() == descriptor->GetEnvironmentLength());
+ DCHECK(operands.length() == descriptor.GetEnvironmentLength());
HCallWithDescriptor* res =
new(zone) HCallWithDescriptor(target, argument_count,
descriptor, operands, zone);
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);
}
}
return -argument_count_;
}
- const CallInterfaceDescriptor* descriptor() const { return descriptor_; }
+ CallInterfaceDescriptor descriptor() const { return descriptor_; }
HValue* target() {
return OperandAt(0);
private:
// The argument count includes the receiver.
HCallWithDescriptor(HValue* target, int argument_count,
- const CallInterfaceDescriptor* descriptor,
+ CallInterfaceDescriptor descriptor,
const Vector<HValue*>& 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++) {
values_[index] = value;
}
- const CallInterfaceDescriptor* descriptor_;
+ CallInterfaceDescriptor descriptor_;
ZoneList<HValue*> values_;
int argument_count_;
};
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<HConstant>(argument_count - 1);
HValue* op_vals[] = { context, fun, arity, expected_param_count };
return New<HCallWithDescriptor>(
adaptor_value, argument_count, descriptor,
- Vector<HValue*>(op_vals, descriptor->GetEnvironmentLength()));
+ Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
}
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> code = stub.GetCode();
HConstant* code_value = Add<HConstant>(code);
- DCHECK((sizeof(op_vals) / kPointerSize) ==
- descriptor->GetEnvironmentLength());
+ DCHECK((sizeof(op_vals) / kPointerSize) == descriptor.GetEnvironmentLength());
HInstruction* call = New<HCallWithDescriptor>(
code_value, argc + 1, descriptor,
- Vector<HValue*>(op_vals, descriptor->GetEnvironmentLength()));
+ Vector<HValue*>(op_vals, descriptor.GetEnvironmentLength()));
if (drop_extra) Drop(1); // Drop function.
ast_context()->ReturnInstruction(call, ast_id);
// 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);
// 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<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Initialize();
__ call(ic, RelocInfo::CODE_TARGET);
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);
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);
void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
Label miss;
- Register receiver = LoadConvention::ReceiverRegister();
+ Register receiver = LoadDescriptor::ReceiverRegister();
NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, eax,
ebx, &miss);
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);
}
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);
}
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);
}
// 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())));
}
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);
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 {
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());
}
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());
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());
__ 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<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
__ 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
__ 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
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 {
SetSourcePosition(prop->position());
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
if (FLAG_vector_ics) {
- __ mov(VectorLoadConvention::SlotRegister(),
+ __ mov(VectorLoadICDescriptor::SlotRegister(),
Immediate(Smi::FromInt(prop->PropertyFeedbackSlot())));
CallIC(ic);
} else {
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;
__ 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<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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) {
// 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);
// 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<Code> ic = strict_mode() == SLOPPY
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);
}
} 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.
// 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);
__ 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 {
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);
}
}
}
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()) {
break;
}
case KEYED_PROPERTY: {
- __ pop(StoreConvention::NameRegister());
- __ pop(StoreConvention::ReceiverRegister());
+ __ pop(StoreDescriptor::NameRegister());
+ __ pop(StoreDescriptor::ReceiverRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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
#if V8_TARGET_ARCH_IA32
-#include "src/ic/ic-conventions.h"
#include "src/interface-descriptors.h"
namespace v8 {
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
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())));
}
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<LLoadGlobalGeneric>(instr);
}
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<LLoadNamedGeneric>(instr);
}
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<LLoadKeyedGeneric>(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<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
CallCode(ic, RelocInfo::CODE_TARGET, 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<Code> ic = instr->strict_mode() == STRICT
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) {
- const CallInterfaceDescriptor* descriptor = instr->descriptor();
+ CallInterfaceDescriptor descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> 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());
}
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 =
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);
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);
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());
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);
class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> {
public:
- LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
+ LCallWithDescriptor(CallInterfaceDescriptor descriptor,
const ZoneList<LOperand*>& 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);
}
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;
}
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;
}
// 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));
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.
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.
Register NamedStoreHandlerCompiler::value() {
- return StoreConvention::ValueRegister();
+ return StoreDescriptor::ValueRegister();
}
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));
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));
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).
__ 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);
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);
}
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));
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));
__ 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 =
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);
}
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));
// 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));
// 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));
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());
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));
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(
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 =
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));
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);
// 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;
+++ /dev/null
-// 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
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;
}
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;
}
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));
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.
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.
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));
Register NamedStoreHandlerCompiler::value() {
- return StoreConvention::ValueRegister();
+ return StoreDescriptor::ValueRegister();
}
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));
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).
__ 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);
}
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);
}
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));
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));
__ 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 =
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);
}
// 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));
// 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));
// 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));
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());
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));
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.
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 =
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));
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);
// 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;
+++ /dev/null
-// 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
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;
}
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;
}
// -- 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
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));
Register NamedStoreHandlerCompiler::value() {
- return StoreConvention::ValueRegister();
+ return StoreDescriptor::ValueRegister();
}
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));
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
// 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;
+++ /dev/null
-// 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
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));
// 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;
// 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));
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));
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));
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));
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));
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));
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).
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);
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);
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));
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));
+++ /dev/null
-// 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_
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;
}
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;
}
// -- 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
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));
Register NamedStoreHandlerCompiler::value() {
- return StoreConvention::ValueRegister();
+ return StoreDescriptor::ValueRegister();
}
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));
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);
// 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;
+++ /dev/null
-// 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
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));
// 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));
// 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));
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));
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));
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));
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));
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));
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).
__ 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.
// 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.
__ 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.
// 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.
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);
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));
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;
#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) {
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>(register_parameter_count));
}
-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
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
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> 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<Representation> 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
// 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> 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<Representation> 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
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),
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;
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());
}
-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];
}
namespace internal {
class Bootstrapper;
-class CallInterfaceDescriptor;
+class CallInterfaceDescriptorData;
class CodeGenerator;
class CodeRange;
class CodeStubInterfaceDescriptor;
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);
DateCache* date_cache_;
unibrow::Mapping<unibrow::Ecma262Canonicalize> 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.
// 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);
// 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<Code> ic =
masm->isolate()->builtins()->KeyedLoadIC_Initialize();
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);
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);
void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
Label miss;
- Register receiver = LoadConvention::ReceiverRegister();
+ Register receiver = LoadDescriptor::ReceiverRegister();
NamedLoadHandlerCompiler::GenerateLoadFunctionPrototype(masm, receiver, r8,
r9, &miss);
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);
}
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);
}
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);
}
// 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()));
}
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);
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 {
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());
}
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());
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);
__ bind(&l_call);
__ movp(load_receiver, Operand(rsp, kPointerSize));
if (FLAG_vector_ics) {
- __ Move(VectorLoadConvention::SlotRegister(),
+ __ Move(VectorLoadICDescriptor::SlotRegister(),
Smi::FromInt(expr->KeyedLoadFeedbackSlot()));
}
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
__ 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
__ 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
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 {
SetSourcePosition(prop->position());
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
if (FLAG_vector_ics) {
- __ Move(VectorLoadConvention::SlotRegister(),
+ __ Move(VectorLoadICDescriptor::SlotRegister(),
Smi::FromInt(prop->PropertyFeedbackSlot()));
CallIC(ic);
} else {
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;
__ 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<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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) {
// 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);
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<Code> ic = strict_mode() == SLOPPY
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);
}
} 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.
// 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);
__ 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 {
}
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);
}
}
}
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()) {
break;
}
case KEYED_PROPERTY: {
- __ Pop(StoreConvention::NameRegister());
- __ Pop(StoreConvention::ReceiverRegister());
+ __ Pop(StoreDescriptor::NameRegister());
+ __ Pop(StoreDescriptor::ReceiverRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
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
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
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()));
}
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<LLoadGlobalGeneric>(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<LLoadNamedGeneric>(instr);
}
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<LLoadKeyedGeneric>(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<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode());
CallCode(ic, RelocInfo::CODE_TARGET, 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<Code> ic = instr->strict_mode() == STRICT
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
LInstruction* LChunkBuilder::DoCallWithDescriptor(
HCallWithDescriptor* instr) {
- const CallInterfaceDescriptor* descriptor = instr->descriptor();
+ CallInterfaceDescriptor descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> 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());
}
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 =
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);
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 =
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());
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);
class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> {
public:
- LCallWithDescriptor(const CallInterfaceDescriptor* descriptor,
+ LCallWithDescriptor(CallInterfaceDescriptor descriptor,
const ZoneList<LOperand*>& 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);
}
'../../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',
'../../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',
],
}],
'../../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',
],
}],
'../../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',
],
}],
'../../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',
],
}],