Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Unified Diff: src/arm64/full-codegen-arm64.cc

Issue 486213003: Move register conventions out of the IC classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/debug-arm64.cc ('k') | src/arm64/lithium-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
index b44f1ff65cb843b8a0ccc0cffe83b4c5e939eb74..b1187e5634f7ccf0f8aec563b6205f896a712d87 100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -1383,10 +1383,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
__ Bind(&fast);
}
- __ Ldr(LoadIC::ReceiverRegister(), GlobalObjectMemOperand());
- __ Mov(LoadIC::NameRegister(), Operand(proxy->var()->name()));
+ __ Ldr(LoadConvention::ReceiverRegister(), GlobalObjectMemOperand());
+ __ Mov(LoadConvention::NameRegister(), Operand(proxy->var()->name()));
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(proxy->VariableFeedbackSlot()));
}
@@ -1468,10 +1468,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
switch (var->location()) {
case Variable::UNALLOCATED: {
Comment cmnt(masm_, "Global variable");
- __ Ldr(LoadIC::ReceiverRegister(), GlobalObjectMemOperand());
- __ Mov(LoadIC::NameRegister(), Operand(var->name()));
+ __ Ldr(LoadConvention::ReceiverRegister(), GlobalObjectMemOperand());
+ __ Mov(LoadConvention::NameRegister(), Operand(var->name()));
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(proxy->VariableFeedbackSlot()));
}
CallLoadIC(CONTEXTUAL);
@@ -1681,9 +1681,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
if (key->value()->IsInternalizedString()) {
if (property->emit_store()) {
VisitForAccumulatorValue(value);
- DCHECK(StoreIC::ValueRegister().is(x0));
- __ Mov(StoreIC::NameRegister(), Operand(key->value()));
- __ Peek(StoreIC::ReceiverRegister(), 0);
+ DCHECK(StoreConvention::ValueRegister().is(x0));
+ __ Mov(StoreConvention::NameRegister(), Operand(key->value()));
+ __ Peek(StoreConvention::ReceiverRegister(), 0);
CallStoreIC(key->LiteralFeedbackId());
PrepareForBailoutForId(key->id(), NO_REGISTERS);
} else {
@@ -1861,7 +1861,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
// We need the receiver both on the stack and in the register.
VisitForStackValue(property->obj());
- __ Peek(LoadIC::ReceiverRegister(), 0);
+ __ Peek(LoadConvention::ReceiverRegister(), 0);
} else {
VisitForStackValue(property->obj());
}
@@ -1870,8 +1870,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
- __ Peek(LoadIC::ReceiverRegister(), 1 * kPointerSize);
- __ Peek(LoadIC::NameRegister(), 0);
+ __ Peek(LoadConvention::ReceiverRegister(), 1 * kPointerSize);
+ __ Peek(LoadConvention::NameRegister(), 0);
} else {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
@@ -1948,9 +1948,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
- __ Mov(LoadIC::NameRegister(), Operand(key->value()));
+ __ Mov(LoadConvention::NameRegister(), Operand(key->value()));
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(prop->PropertyFeedbackSlot()));
CallLoadIC(NOT_CONTEXTUAL);
} else {
@@ -1964,7 +1964,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
// Call keyed load IC. It has arguments key and receiver in r0 and r1.
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(prop->PropertyFeedbackSlot()));
CallIC(ic);
} else {
@@ -2113,9 +2113,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
VisitForAccumulatorValue(prop->obj());
// TODO(all): We could introduce a VisitForRegValue(reg, expr) to avoid
// this copy.
- __ Mov(StoreIC::ReceiverRegister(), x0);
- __ Pop(StoreIC::ValueRegister()); // Restore value.
- __ Mov(StoreIC::NameRegister(),
+ __ Mov(StoreConvention::ReceiverRegister(), x0);
+ __ Pop(StoreConvention::ValueRegister()); // Restore value.
+ __ Mov(StoreConvention::NameRegister(),
Operand(prop->key()->AsLiteral()->value()));
CallStoreIC();
break;
@@ -2124,8 +2124,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
__ Push(x0); // Preserve value.
VisitForStackValue(prop->obj());
VisitForAccumulatorValue(prop->key());
- __ Mov(KeyedStoreIC::NameRegister(), x0);
- __ Pop(KeyedStoreIC::ReceiverRegister(), KeyedStoreIC::ValueRegister());
+ __ Mov(StoreConvention::NameRegister(), x0);
+ __ Pop(StoreConvention::ReceiverRegister(),
+ StoreConvention::ValueRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
@@ -2155,8 +2156,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment");
if (var->IsUnallocated()) {
// Global var, const, or let.
- __ Mov(StoreIC::NameRegister(), Operand(var->name()));
- __ Ldr(StoreIC::ReceiverRegister(), GlobalObjectMemOperand());
+ __ Mov(StoreConvention::NameRegister(), Operand(var->name()));
+ __ Ldr(StoreConvention::ReceiverRegister(), GlobalObjectMemOperand());
CallStoreIC();
} else if (op == Token::INIT_CONST_LEGACY) {
@@ -2228,8 +2229,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
// Record source code position before IC call.
SetSourcePosition(expr->position());
- __ Mov(StoreIC::NameRegister(), Operand(prop->key()->AsLiteral()->value()));
- __ Pop(StoreIC::ReceiverRegister());
+ __ Mov(StoreConvention::NameRegister(),
+ Operand(prop->key()->AsLiteral()->value()));
+ __ Pop(StoreConvention::ReceiverRegister());
CallStoreIC(expr->AssignmentFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
@@ -2244,8 +2246,8 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
// Record source code position before IC call.
SetSourcePosition(expr->position());
// TODO(all): Could we pass this in registers rather than on the stack?
- __ Pop(KeyedStoreIC::NameRegister(), KeyedStoreIC::ReceiverRegister());
- DCHECK(KeyedStoreIC::ValueRegister().is(x0));
+ __ Pop(StoreConvention::NameRegister(), StoreConvention::ReceiverRegister());
+ DCHECK(StoreConvention::ValueRegister().is(x0));
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
@@ -2263,15 +2265,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
- __ Move(LoadIC::ReceiverRegister(), x0);
+ __ Move(LoadConvention::ReceiverRegister(), x0);
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(x0);
} else {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
- __ Move(LoadIC::NameRegister(), x0);
- __ Pop(LoadIC::ReceiverRegister());
+ __ Move(LoadConvention::NameRegister(), x0);
+ __ Pop(LoadConvention::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
context()->Plug(x0);
}
@@ -2307,7 +2309,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
} else {
// Load the function from the receiver.
DCHECK(callee->IsProperty());
- __ Peek(LoadIC::ReceiverRegister(), 0);
+ __ Peek(LoadConvention::ReceiverRegister(), 0);
EmitNamedPropertyLoad(callee->AsProperty());
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
// Push the target function under the receiver.
@@ -2329,8 +2331,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
// Load the function from the receiver.
DCHECK(callee->IsProperty());
- __ Peek(LoadIC::ReceiverRegister(), 0);
- __ Move(LoadIC::NameRegister(), x0);
+ __ Peek(LoadConvention::ReceiverRegister(), 0);
+ __ Move(LoadConvention::NameRegister(), x0);
EmitKeyedPropertyLoad(callee->AsProperty());
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
@@ -3746,15 +3748,15 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
if (expr->is_jsruntime()) {
// Push the builtins object as the receiver.
__ Ldr(x10, GlobalObjectMemOperand());
- __ Ldr(LoadIC::ReceiverRegister(),
+ __ Ldr(LoadConvention::ReceiverRegister(),
FieldMemOperand(x10, GlobalObject::kBuiltinsOffset));
- __ Push(LoadIC::ReceiverRegister());
+ __ Push(LoadConvention::ReceiverRegister());
// Load the function from the receiver.
Handle<String> name = expr->name();
- __ Mov(LoadIC::NameRegister(), Operand(name));
+ __ Mov(LoadConvention::NameRegister(), Operand(name));
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(expr->CallRuntimeFeedbackSlot()));
CallLoadIC(NOT_CONTEXTUAL);
} else {
@@ -3934,14 +3936,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
if (assign_type == NAMED_PROPERTY) {
// Put the object both on the stack and in the register.
VisitForStackValue(prop->obj());
- __ Peek(LoadIC::ReceiverRegister(), 0);
+ __ Peek(LoadConvention::ReceiverRegister(), 0);
EmitNamedPropertyLoad(prop);
} else {
// KEYED_PROPERTY
VisitForStackValue(prop->obj());
VisitForStackValue(prop->key());
- __ Peek(LoadIC::ReceiverRegister(), 1 * kPointerSize);
- __ Peek(LoadIC::NameRegister(), 0);
+ __ Peek(LoadConvention::ReceiverRegister(), 1 * kPointerSize);
+ __ Peek(LoadConvention::NameRegister(), 0);
EmitKeyedPropertyLoad(prop);
}
}
@@ -4051,9 +4053,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
break;
case NAMED_PROPERTY: {
- __ Mov(StoreIC::NameRegister(),
+ __ Mov(StoreConvention::NameRegister(),
Operand(prop->key()->AsLiteral()->value()));
- __ Pop(StoreIC::ReceiverRegister());
+ __ Pop(StoreConvention::ReceiverRegister());
CallStoreIC(expr->CountStoreFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@@ -4066,8 +4068,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
break;
}
case KEYED_PROPERTY: {
- __ Pop(KeyedStoreIC::NameRegister());
- __ Pop(KeyedStoreIC::ReceiverRegister());
+ __ Pop(StoreConvention::NameRegister());
+ __ Pop(StoreConvention::ReceiverRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
@@ -4092,10 +4094,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
VariableProxy* proxy = expr->AsVariableProxy();
if (proxy != NULL && proxy->var()->IsUnallocated()) {
Comment cmnt(masm_, "Global variable");
- __ Ldr(LoadIC::ReceiverRegister(), GlobalObjectMemOperand());
- __ Mov(LoadIC::NameRegister(), Operand(proxy->name()));
+ __ Ldr(LoadConvention::ReceiverRegister(), GlobalObjectMemOperand());
+ __ Mov(LoadConvention::NameRegister(), Operand(proxy->name()));
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(proxy->VariableFeedbackSlot()));
}
// Use a regular load, not a contextual load, to avoid a reference
@@ -4390,8 +4392,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
Label l_catch, l_try, l_suspend, l_continuation, l_resume;
Label l_next, l_call, l_loop;
- Register load_receiver = LoadIC::ReceiverRegister();
- Register load_name = LoadIC::NameRegister();
+ Register load_receiver = LoadConvention::ReceiverRegister();
+ Register load_name = LoadConvention::NameRegister();
// Initial send value is undefined.
__ LoadRoot(x0, Heap::kUndefinedValueRootIndex);
@@ -4451,7 +4453,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ Peek(load_receiver, 1 * kPointerSize);
__ Peek(load_name, 2 * kPointerSize);
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(expr->KeyedLoadFeedbackSlot()));
}
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
@@ -4471,7 +4473,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ Push(load_receiver); // save result
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(expr->DoneFeedbackSlot()));
}
CallLoadIC(NOT_CONTEXTUAL); // x0=result.done
@@ -4484,7 +4486,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ Pop(load_receiver); // result
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
if (FLAG_vector_ics) {
- __ Mov(LoadIC::SlotRegister(),
+ __ Mov(VectorLoadConvention::SlotRegister(),
Smi::FromInt(expr->ValueFeedbackSlot()));
}
CallLoadIC(NOT_CONTEXTUAL); // x0=result.value
« no previous file with comments | « src/arm64/debug-arm64.cc ('k') | src/arm64/lithium-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698