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

Unified Diff: src/x64/full-codegen-x64.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/x64/debug-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 7e8b7088830ecdfce2669e808bc12fc850976e2e..2655cf59f726c06ed698bc77ae34c7438f567376 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -1362,10 +1362,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
// All extension objects were empty and it is safe to use a global
// load IC call.
- __ movp(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ Move(LoadIC::NameRegister(), proxy->var()->name());
+ __ movp(LoadConvention::ReceiverRegister(), GlobalObjectOperand());
+ __ Move(LoadConvention::NameRegister(), proxy->var()->name());
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(),
+ __ Move(VectorLoadConvention::SlotRegister(),
Smi::FromInt(proxy->VariableFeedbackSlot()));
}
@@ -1448,10 +1448,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
switch (var->location()) {
case Variable::UNALLOCATED: {
Comment cmnt(masm_, "[ Global variable");
- __ Move(LoadIC::NameRegister(), var->name());
- __ movp(LoadIC::ReceiverRegister(), GlobalObjectOperand());
+ __ Move(LoadConvention::NameRegister(), var->name());
+ __ movp(LoadConvention::ReceiverRegister(), GlobalObjectOperand());
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(),
+ __ Move(VectorLoadConvention::SlotRegister(),
Smi::FromInt(proxy->VariableFeedbackSlot()));
}
CallLoadIC(CONTEXTUAL);
@@ -1666,9 +1666,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
if (key->value()->IsInternalizedString()) {
if (property->emit_store()) {
VisitForAccumulatorValue(value);
- DCHECK(StoreIC::ValueRegister().is(rax));
- __ Move(StoreIC::NameRegister(), key->value());
- __ movp(StoreIC::ReceiverRegister(), Operand(rsp, 0));
+ DCHECK(StoreConvention::ValueRegister().is(rax));
+ __ Move(StoreConvention::NameRegister(), key->value());
+ __ movp(StoreConvention::ReceiverRegister(), Operand(rsp, 0));
CallStoreIC(key->LiteralFeedbackId());
PrepareForBailoutForId(key->id(), NO_REGISTERS);
} else {
@@ -1847,7 +1847,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
// We need the receiver both on the stack and in the register.
VisitForStackValue(property->obj());
- __ movp(LoadIC::ReceiverRegister(), Operand(rsp, 0));
+ __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0));
} else {
VisitForStackValue(property->obj());
}
@@ -1856,8 +1856,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
- __ movp(LoadIC::ReceiverRegister(), Operand(rsp, kPointerSize));
- __ movp(LoadIC::NameRegister(), Operand(rsp, 0));
+ __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, kPointerSize));
+ __ movp(LoadConvention::NameRegister(), Operand(rsp, 0));
} else {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
@@ -1998,8 +1998,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
Label l_catch, l_try, l_suspend, l_continuation, l_resume;
Label l_next, l_call, l_loop;
- Register load_receiver = LoadIC::ReceiverRegister();
- Register load_name = LoadIC::NameRegister();
+ Register load_receiver = LoadConvention::ReceiverRegister();
+ Register load_name = LoadConvention::NameRegister();
// Initial send value is undefined.
__ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
@@ -2056,7 +2056,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ bind(&l_call);
__ movp(load_receiver, Operand(rsp, kPointerSize));
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(),
+ __ Move(VectorLoadConvention::SlotRegister(),
Smi::FromInt(expr->KeyedLoadFeedbackSlot()));
}
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
@@ -2075,7 +2075,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ Push(load_receiver); // save result
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(), Smi::FromInt(expr->DoneFeedbackSlot()));
+ __ Move(VectorLoadConvention::SlotRegister(),
+ Smi::FromInt(expr->DoneFeedbackSlot()));
}
CallLoadIC(NOT_CONTEXTUAL); // rax=result.done
Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
@@ -2087,7 +2088,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ Pop(load_receiver); // result
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(),
+ __ Move(VectorLoadConvention::SlotRegister(),
Smi::FromInt(expr->ValueFeedbackSlot()));
}
CallLoadIC(NOT_CONTEXTUAL); // result.value in rax
@@ -2250,9 +2251,10 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
- __ Move(LoadIC::NameRegister(), key->value());
+ __ Move(LoadConvention::NameRegister(), key->value());
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot()));
+ __ Move(VectorLoadConvention::SlotRegister(),
+ Smi::FromInt(prop->PropertyFeedbackSlot()));
CallLoadIC(NOT_CONTEXTUAL);
} else {
CallLoadIC(NOT_CONTEXTUAL, prop->PropertyFeedbackId());
@@ -2264,7 +2266,8 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(), Smi::FromInt(prop->PropertyFeedbackSlot()));
+ __ Move(VectorLoadConvention::SlotRegister(),
+ Smi::FromInt(prop->PropertyFeedbackSlot()));
CallIC(ic);
} else {
CallIC(ic, prop->PropertyFeedbackId());
@@ -2369,9 +2372,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
case NAMED_PROPERTY: {
__ Push(rax); // Preserve value.
VisitForAccumulatorValue(prop->obj());
- __ Move(StoreIC::ReceiverRegister(), rax);
- __ Pop(StoreIC::ValueRegister()); // Restore value.
- __ Move(StoreIC::NameRegister(), prop->key()->AsLiteral()->value());
+ __ Move(StoreConvention::ReceiverRegister(), rax);
+ __ Pop(StoreConvention::ValueRegister()); // Restore value.
+ __ Move(StoreConvention::NameRegister(),
+ prop->key()->AsLiteral()->value());
CallStoreIC();
break;
}
@@ -2379,9 +2383,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
__ Push(rax); // Preserve value.
VisitForStackValue(prop->obj());
VisitForAccumulatorValue(prop->key());
- __ Move(KeyedStoreIC::NameRegister(), rax);
- __ Pop(KeyedStoreIC::ReceiverRegister());
- __ Pop(KeyedStoreIC::ValueRegister()); // Restore value.
+ __ Move(StoreConvention::NameRegister(), rax);
+ __ Pop(StoreConvention::ReceiverRegister());
+ __ Pop(StoreConvention::ValueRegister()); // Restore value.
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
@@ -2408,8 +2412,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
Token::Value op) {
if (var->IsUnallocated()) {
// Global var, const, or let.
- __ Move(StoreIC::NameRegister(), var->name());
- __ movp(StoreIC::ReceiverRegister(), GlobalObjectOperand());
+ __ Move(StoreConvention::NameRegister(), var->name());
+ __ movp(StoreConvention::ReceiverRegister(), GlobalObjectOperand());
CallStoreIC();
} else if (op == Token::INIT_CONST_LEGACY) {
@@ -2479,8 +2483,8 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
// Record source code position before IC call.
SetSourcePosition(expr->position());
- __ Move(StoreIC::NameRegister(), prop->key()->AsLiteral()->value());
- __ Pop(StoreIC::ReceiverRegister());
+ __ Move(StoreConvention::NameRegister(), prop->key()->AsLiteral()->value());
+ __ Pop(StoreConvention::ReceiverRegister());
CallStoreIC(expr->AssignmentFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
@@ -2491,9 +2495,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
// Assignment to a property, using a keyed store IC.
- __ Pop(KeyedStoreIC::NameRegister()); // Key.
- __ Pop(KeyedStoreIC::ReceiverRegister());
- DCHECK(KeyedStoreIC::ValueRegister().is(rax));
+ __ Pop(StoreConvention::NameRegister()); // Key.
+ __ Pop(StoreConvention::ReceiverRegister());
+ DCHECK(StoreConvention::ValueRegister().is(rax));
// Record source code position before IC call.
SetSourcePosition(expr->position());
Handle<Code> ic = strict_mode() == SLOPPY
@@ -2512,16 +2516,16 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
- DCHECK(!rax.is(LoadIC::ReceiverRegister()));
- __ movp(LoadIC::ReceiverRegister(), rax);
+ DCHECK(!rax.is(LoadConvention::ReceiverRegister()));
+ __ movp(LoadConvention::ReceiverRegister(), rax);
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(rax);
} else {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
- __ Move(LoadIC::NameRegister(), rax);
- __ Pop(LoadIC::ReceiverRegister());
+ __ Move(LoadConvention::NameRegister(), rax);
+ __ Pop(LoadConvention::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
context()->Plug(rax);
}
@@ -2554,7 +2558,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
} else {
// Load the function from the receiver.
DCHECK(callee->IsProperty());
- __ movp(LoadIC::ReceiverRegister(), Operand(rsp, 0));
+ __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0));
EmitNamedPropertyLoad(callee->AsProperty());
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
// Push the target function under the receiver.
@@ -2576,8 +2580,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
// Load the function from the receiver.
DCHECK(callee->IsProperty());
- __ movp(LoadIC::ReceiverRegister(), Operand(rsp, 0));
- __ Move(LoadIC::NameRegister(), rax);
+ __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0));
+ __ Move(LoadConvention::NameRegister(), rax);
EmitKeyedPropertyLoad(callee->AsProperty());
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
@@ -4055,10 +4059,10 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
__ Push(FieldOperand(rax, GlobalObject::kBuiltinsOffset));
// Load the function from the receiver.
- __ movp(LoadIC::ReceiverRegister(), Operand(rsp, 0));
- __ Move(LoadIC::NameRegister(), expr->name());
+ __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0));
+ __ Move(LoadConvention::NameRegister(), expr->name());
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(),
+ __ Move(VectorLoadConvention::SlotRegister(),
Smi::FromInt(expr->CallRuntimeFeedbackSlot()));
CallLoadIC(NOT_CONTEXTUAL);
} else {
@@ -4241,15 +4245,15 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
if (assign_type == NAMED_PROPERTY) {
VisitForStackValue(prop->obj());
- __ movp(LoadIC::ReceiverRegister(), Operand(rsp, 0));
+ __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, 0));
EmitNamedPropertyLoad(prop);
} else {
VisitForStackValue(prop->obj());
VisitForStackValue(prop->key());
// Leave receiver on stack
- __ movp(LoadIC::ReceiverRegister(), Operand(rsp, kPointerSize));
+ __ movp(LoadConvention::ReceiverRegister(), Operand(rsp, kPointerSize));
// Copy of key, needed for later store.
- __ movp(LoadIC::NameRegister(), Operand(rsp, 0));
+ __ movp(LoadConvention::NameRegister(), Operand(rsp, 0));
EmitKeyedPropertyLoad(prop);
}
}
@@ -4361,8 +4365,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
break;
case NAMED_PROPERTY: {
- __ Move(StoreIC::NameRegister(), prop->key()->AsLiteral()->value());
- __ Pop(StoreIC::ReceiverRegister());
+ __ Move(StoreConvention::NameRegister(),
+ prop->key()->AsLiteral()->value());
+ __ Pop(StoreConvention::ReceiverRegister());
CallStoreIC(expr->CountStoreFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@@ -4375,8 +4380,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();
@@ -4402,10 +4407,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
if (proxy != NULL && proxy->var()->IsUnallocated()) {
Comment cmnt(masm_, "[ Global variable");
- __ Move(LoadIC::NameRegister(), proxy->name());
- __ movp(LoadIC::ReceiverRegister(), GlobalObjectOperand());
+ __ Move(LoadConvention::NameRegister(), proxy->name());
+ __ movp(LoadConvention::ReceiverRegister(), GlobalObjectOperand());
if (FLAG_vector_ics) {
- __ Move(LoadIC::SlotRegister(),
+ __ Move(VectorLoadConvention::SlotRegister(),
Smi::FromInt(proxy->VariableFeedbackSlot()));
}
// Use a regular load, not a contextual load, to avoid a reference
« no previous file with comments | « src/x64/debug-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698