Commit 9c53fcad authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[fullcodegen] Factor out EmitNamedPropertyLoad.

This makes the FullCodeGenerator::EmitNamedPropertyLoad be architecture
independent by adding MacroAssembler::Move helpers.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/1734643002

Cr-Commit-Position: refs/heads/master@{#34259}
parent 4014f1c7
......@@ -895,6 +895,7 @@ class MacroAssembler : public Assembler {
// This is required for compatibility with architecture independant code.
// Remove if not needed.
inline void Move(Register dst, Register src) { Mov(dst, src); }
inline void Move(Register dst, Handle<Object> x) { LoadObject(dst, x); }
inline void Move(Register dst, Smi* src) { Mov(dst, src); }
void LoadInstanceDescriptors(Register map,
......
......@@ -2093,18 +2093,6 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!prop->IsSuperAccess());
__ mov(LoadDescriptor::NameRegister(), Operand(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left_expr,
......
......@@ -1858,18 +1858,6 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!prop->IsSuperAccess());
__ Mov(LoadDescriptor::NameRegister(), Operand(key->value()));
__ Mov(LoadDescriptor::SlotRegister(),
SmiFromSlot(prop->PropertyFeedbackSlot()));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left_expr,
......
......@@ -1007,6 +1007,18 @@ void FullCodeGenerator::EmitUnwindAndReturn() {
EmitReturnSequence();
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!key->value()->IsSmi());
DCHECK(!prop->IsSuperAccess());
__ Move(LoadDescriptor::NameRegister(), key->value());
__ Move(LoadDescriptor::SlotRegister(),
SmiFromSlot(prop->PropertyFeedbackSlot()));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) {
// Stack: receiver, home_object
SetExpressionPosition(prop);
......
......@@ -1994,19 +1994,6 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!key->value()->IsSmi());
DCHECK(!prop->IsSuperAccess());
__ mov(LoadDescriptor::NameRegister(), Immediate(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left,
......
......@@ -2092,18 +2092,6 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!prop->IsSuperAccess());
__ li(LoadDescriptor::NameRegister(), Operand(key->value()));
__ li(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left_expr,
......
......@@ -2096,18 +2096,6 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!prop->IsSuperAccess());
__ li(LoadDescriptor::NameRegister(), Operand(key->value()));
__ li(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left_expr,
......
......@@ -2072,18 +2072,6 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!prop->IsSuperAccess());
__ mov(LoadDescriptor::NameRegister(), Operand(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left_expr,
......
......@@ -2017,19 +2017,6 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!key->value()->IsSmi());
DCHECK(!prop->IsSuperAccess());
__ Move(LoadDescriptor::NameRegister(), key->value());
__ Move(LoadDescriptor::SlotRegister(),
SmiFromSlot(prop->PropertyFeedbackSlot()));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left,
......
......@@ -1986,19 +1986,6 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
}
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetExpressionPosition(prop);
Literal* key = prop->key()->AsLiteral();
DCHECK(!key->value()->IsSmi());
DCHECK(!prop->IsSuperAccess());
__ mov(LoadDescriptor::NameRegister(), Immediate(key->value()));
__ mov(LoadDescriptor::SlotRegister(),
Immediate(SmiFromSlot(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_INSIDE_TYPEOF);
}
void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
Token::Value op,
Expression* left,
......
......@@ -796,6 +796,7 @@ class MacroAssembler: public Assembler {
void Move(XMMRegister dst, float src) { Move(dst, bit_cast<uint32_t>(src)); }
void Move(XMMRegister dst, double src) { Move(dst, bit_cast<uint64_t>(src)); }
void Move(Register dst, Handle<Object> handle) { LoadObject(dst, handle); }
void Move(Register dst, Smi* source) { Move(dst, Immediate(source)); }
// Push a handle value.
......
......@@ -237,6 +237,7 @@ class MacroAssembler: public Assembler {
void Call(Label* target);
void Move(Register dst, Handle<Object> handle) { li(dst, handle); }
void Move(Register dst, Smi* smi) { li(dst, Operand(smi)); }
inline void Move(Register dst, Register src) {
......
......@@ -265,6 +265,7 @@ class MacroAssembler: public Assembler {
void Call(Label* target);
void Move(Register dst, Handle<Object> handle) { li(dst, handle); }
void Move(Register dst, Smi* smi) { li(dst, Operand(smi)); }
inline void Move(Register dst, Register src) {
......
......@@ -770,6 +770,7 @@ class MacroAssembler: public Assembler {
void Move(Register dst, const Immediate& x);
void Move(const Operand& dst, const Immediate& x);
void Move(Register dst, Handle<Object> handle) { LoadObject(dst, handle); }
void Move(Register dst, Smi* source) { Move(dst, Immediate(source)); }
// Push a handle value.
......
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