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

[fullcodegen] Remove super property access support.

This removes support for accessing super properties (load, store & call)
from the {FullCodeGenerator}. Consequently optimized code containing
such constructs must use the {BytecodeGraphBuilder} and can no longer
use the {AstGraphBuilder} for graph building.

R=bmeurer@chromium.org
BUG=v8:5657

Review-Url: https://codereview.chromium.org/2544123004
Cr-Commit-Position: refs/heads/master@{#41478}
parent d9cfd775
This diff is collapsed.
......@@ -288,16 +288,6 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
Node* BuildNamedStore(Node* receiver, Handle<Name> name, Node* value,
const VectorSlotPair& feedback);
// Builders for super property loads and stores.
Node* BuildKeyedSuperStore(Node* receiver, Node* home_object, Node* key,
Node* value);
Node* BuildNamedSuperStore(Node* receiver, Node* home_object,
Handle<Name> name, Node* value);
Node* BuildNamedSuperLoad(Node* receiver, Node* home_object,
Handle<Name> name, const VectorSlotPair& feedback);
Node* BuildKeyedSuperLoad(Node* receiver, Node* home_object, Node* key,
const VectorSlotPair& feedback);
// Builders for global variable loads and stores.
Node* BuildGlobalLoad(Handle<Name> name, const VectorSlotPair& feedback,
TypeofMode typeof_mode);
......@@ -321,7 +311,6 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
Node* BuildThrowError(Node* exception, BailoutId bailout_id);
Node* BuildThrowReferenceError(Variable* var, BailoutId bailout_id);
Node* BuildThrowConstAssignError(BailoutId bailout_id);
Node* BuildThrowUnsupportedSuperError(BailoutId bailout_id);
// Builders for dynamic hole-checks at runtime.
Node* BuildHoleCheckThenThrow(Node* value, Variable* var, Node* not_hole,
......
This diff is collapsed.
......@@ -853,30 +853,17 @@ void FullCodeGenerator::VisitProperty(Property* 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);
}
DCHECK(!expr->IsSuperAccess());
VisitForAccumulatorValue(expr->obj());
__ Move(LoadDescriptor::ReceiverRegister(), result_register());
EmitNamedPropertyLoad(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);
}
DCHECK(!expr->IsSuperAccess());
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
__ Move(LoadDescriptor::NameRegister(), result_register());
PopOperand(LoadDescriptor::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
}
PrepareForBailoutForId(expr->LoadId(), BailoutState::TOS_REGISTER);
context()->Plug(result_register());
......@@ -1059,17 +1046,6 @@ void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
CallLoadIC(prop->PropertyFeedbackSlot(), key->value());
}
void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!key->value()->IsSmi());
DCHECK(prop->IsSuperAccess());
PushOperand(key->value());
CallRuntimeWithOperands(Runtime::kLoadFromSuper);
}
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
......@@ -1080,12 +1056,6 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
RestoreContext();
}
void FullCodeGenerator::EmitKeyedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object, key.
SetExpressionPosition(prop);
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
}
void FullCodeGenerator::EmitPropertyKey(LiteralProperty* property,
BailoutId bailout_id) {
VisitForStackValue(property->key());
......@@ -1404,12 +1374,6 @@ void FullCodeGenerator::VisitCall(Call* expr) {
EmitKeyedCallWithLoadIC(expr, property->key());
break;
}
case Call::NAMED_SUPER_PROPERTY_CALL:
EmitSuperCallWithLoadIC(expr);
break;
case Call::KEYED_SUPER_PROPERTY_CALL:
EmitKeyedSuperCallWithLoadIC(expr);
break;
case Call::OTHER_CALL:
// Call to an arbitrary expression not handled specially above.
VisitForStackValue(callee);
......@@ -1418,6 +1382,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// Emit function call.
EmitCall(expr);
break;
case Call::NAMED_SUPER_PROPERTY_CALL:
case Call::KEYED_SUPER_PROPERTY_CALL:
case Call::SUPER_CALL:
case Call::WITH_CALL:
UNREACHABLE();
......
......@@ -393,9 +393,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
// Platform-specific code sequences for calls
void EmitCall(Call* expr, ConvertReceiverMode = ConvertReceiverMode::kAny);
void EmitCallWithLoadIC(Call* expr);
void EmitSuperCallWithLoadIC(Call* expr);
void EmitKeyedCallWithLoadIC(Call* expr, Expression* key);
void EmitKeyedSuperCallWithLoadIC(Call* expr);
#define FOR_EACH_FULL_CODE_INTRINSIC(F) \
F(IsSmi) \
......@@ -452,14 +450,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
// The receiver is left on the stack by the IC.
void EmitNamedPropertyLoad(Property* expr);
// Load a value from super.named property.
// Expect receiver ('this' value) and home_object on the stack.
void EmitNamedSuperPropertyLoad(Property* expr);
// Load a value from super[keyed] property.
// Expect receiver ('this' value), home_object and key on the stack.
void EmitKeyedSuperPropertyLoad(Property* expr);
// Load a value from a keyed property.
// The receiver and the key is left on the stack by the IC.
void EmitKeyedPropertyLoad(Property* expr);
......@@ -497,14 +487,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
// of the stack and the right-hand-side value in the accumulator.
void EmitNamedPropertyAssignment(Assignment* expr);
// Complete a super named property assignment. The right-hand-side value
// is expected in accumulator.
void EmitNamedSuperPropertyStore(Property* prop);
// Complete a super named property assignment. The right-hand-side value
// is expected in accumulator.
void EmitKeyedSuperPropertyStore(Property* prop);
// Complete a keyed property assignment. The receiver and key are
// expected on top of the stack and the right-hand-side value in the
// accumulator.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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