Commit d0e84c8e authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[fullcodegen] Factor out VisitProperty from architectures.

This makes the aforementioned visitation function independent of the
target architecture by leveraging existing abstractions.

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/1962663002
Cr-Commit-Position: refs/heads/master@{#36111}
parent 99230f8d
......@@ -2321,43 +2321,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), r0);
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), r0);
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(r0);
}
void FullCodeGenerator::CallIC(Handle<Code> code,
TypeFeedbackId ast_id) {
ic_total_count_++;
......
......@@ -2215,42 +2215,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), x0);
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), x0);
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(x0);
}
void FullCodeGenerator::CallIC(Handle<Code> code,
TypeFeedbackId ast_id) {
ic_total_count_++;
......
......@@ -820,6 +820,41 @@ void FullCodeGenerator::VisitArithmeticExpression(BinaryOperation* expr) {
}
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), result_register());
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), result_register());
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(result_register());
}
void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
VariableProxy* proxy = expr->AsVariableProxy();
......
......@@ -2229,43 +2229,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), result_register());
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
PopOperand(LoadDescriptor::ReceiverRegister()); // Object.
__ Move(LoadDescriptor::NameRegister(), result_register()); // Key.
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(eax);
}
void FullCodeGenerator::CallIC(Handle<Code> code,
TypeFeedbackId ast_id) {
ic_total_count_++;
......
......@@ -2332,43 +2332,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), v0);
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), v0);
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(v0);
}
void FullCodeGenerator::CallIC(Handle<Code> code,
TypeFeedbackId id) {
ic_total_count_++;
......
......@@ -2331,43 +2331,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), v0);
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), v0);
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(v0);
}
void FullCodeGenerator::CallIC(Handle<Code> code,
TypeFeedbackId id) {
ic_total_count_++;
......
......@@ -2323,43 +2323,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), r3);
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), r3);
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(r3);
}
void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) {
ic_total_count_++;
__ Call(code, RelocInfo::CODE_TARGET, ast_id);
......
......@@ -2272,42 +2272,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
context()->Plug(r2);
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), r2);
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), r2);
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(r2);
}
void FullCodeGenerator::CallIC(Handle<Code> code, TypeFeedbackId ast_id) {
ic_total_count_++;
__ Call(code, RelocInfo::CODE_TARGET, ast_id);
......
......@@ -2215,44 +2215,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
DCHECK(!rax.is(LoadDescriptor::ReceiverRegister()));
__ movp(LoadDescriptor::ReceiverRegister(), rax);
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), rax);
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(rax);
}
void FullCodeGenerator::CallIC(Handle<Code> code,
TypeFeedbackId ast_id) {
ic_total_count_++;
......
......@@ -2221,43 +2221,6 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
}
void FullCodeGenerator::VisitProperty(Property* expr) {
Comment cmnt(masm_, "[ Property");
SetExpressionPosition(expr);
Expression* key = expr->key();
if (key->IsPropertyName()) {
if (!expr->IsSuperAccess()) {
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), result_register());
EmitNamedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
EmitNamedSuperPropertyLoad(expr);
}
} else {
if (!expr->IsSuperAccess()) {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
PopOperand(LoadDescriptor::ReceiverRegister()); // Object.
__ Move(LoadDescriptor::NameRegister(), result_register()); // Key.
EmitKeyedPropertyLoad(expr);
} else {
VisitForStackValue(expr->obj()->AsSuperPropertyReference()->this_var());
VisitForStackValue(
expr->obj()->AsSuperPropertyReference()->home_object());
VisitForStackValue(expr->key());
EmitKeyedSuperPropertyLoad(expr);
}
}
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(eax);
}
void FullCodeGenerator::CallIC(Handle<Code> code,
TypeFeedbackId ast_id) {
ic_total_count_++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment