Index: src/arm64/full-codegen-arm64.cc |
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc |
index 0a8e1ca3b2fe63fa088cd8cb2177e4dca9cc2fd3..23234f09fcd1524989ef0c0f023c97839bae8691 100644 |
--- a/src/arm64/full-codegen-arm64.cc |
+++ b/src/arm64/full-codegen-arm64.cc |
@@ -300,7 +300,8 @@ void FullCodeGenerator::Generate() { |
VisitDeclarations(scope()->declarations()); |
} |
- { Comment cmnt(masm_, "[ Stack check"); |
+ { |
+ Comment cmnt(masm_, "[ Stack check"); |
PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
Label ok; |
DCHECK(jssp.Is(__ StackPointer())); |
@@ -312,7 +313,8 @@ void FullCodeGenerator::Generate() { |
__ Bind(&ok); |
} |
- { Comment cmnt(masm_, "[ Body"); |
+ { |
+ Comment cmnt(masm_, "[ Body"); |
DCHECK(loop_depth() == 0); |
VisitStatements(function()->body()); |
DCHECK(loop_depth() == 0); |
@@ -2040,7 +2042,7 @@ void FullCodeGenerator::EmitNamedSuperPropertyLoad(Property* prop) { |
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
SetSourcePosition(prop->position()); |
- // Call keyed load IC. It has arguments key and receiver in r0 and r1. |
+ // Call keyed load IC. It has arguments key and receiver in x0 and x1. |
Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate()).code(); |
if (FLAG_vector_ics) { |
__ Mov(VectorLoadICDescriptor::SlotRegister(), |
@@ -2175,6 +2177,74 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, |
} |
+void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
+ // ctor is in x0. |
+ DCHECK(lit != NULL); |
+ __ push(x0); |
+ |
+ Register scratch = x1; |
+ __ Ldr(scratch, |
+ FieldMemOperand(x0, JSFunction::kPrototypeOrInitialMapOffset)); |
+ __ Push(scratch); |
Dmitry Lomov (no reviews)
2014/10/27 21:37:13
Comment on why access check is not needed.
arv (Not doing code reviews)
2014/10/28 09:42:00
Done.
Dmitry Lomov (no reviews)
2014/10/28 10:34:08
Acknowledged.
|
+ |
+ for (int i = 0; i < lit->properties()->length(); i++) { |
+ ObjectLiteral::Property* property = lit->properties()->at(i); |
+ Literal* key = property->key()->AsLiteral(); |
+ Expression* value = property->value(); |
+ DCHECK(key != NULL); |
+ |
+ if (property->is_static()) { |
+ __ Peek(x1, kPointerSize); // constructor |
Dmitry Lomov (no reviews)
2014/10/27 21:37:13
Nit: Use scratch register here.
arv (Not doing code reviews)
2014/10/28 09:42:00
Done.
Dmitry Lomov (no reviews)
2014/10/28 10:34:08
Acknowledged.
|
+ } else { |
+ __ Peek(x1, 0); // prototype |
+ } |
+ __ Push(x1); |
+ VisitForStackValue(key); |
+ |
+ switch (property->kind()) { |
+ case ObjectLiteral::Property::CONSTANT: |
+ case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
+ case ObjectLiteral::Property::COMPUTED: |
+ case ObjectLiteral::Property::PROTOTYPE: |
+ VisitForStackValue(value); |
+ __ Mov(x0, Smi::FromInt(NONE)); |
+ __ Push(x0); |
+ __ CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4); |
+ break; |
+ |
+ case ObjectLiteral::Property::GETTER: |
+ VisitForStackValue(value); |
+ __ LoadRoot(x0, Heap::kNullValueRootIndex); |
+ __ push(x0); |
+ __ Mov(x0, Smi::FromInt(NONE)); |
+ __ Push(x0); |
+ __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
+ break; |
+ |
+ case ObjectLiteral::Property::SETTER: |
+ __ LoadRoot(x0, Heap::kNullValueRootIndex); |
+ __ push(x0); |
+ VisitForStackValue(value); |
+ __ Mov(x0, Smi::FromInt(NONE)); |
+ __ Push(x0); |
+ __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
+ break; |
+ |
+ default: |
+ UNREACHABLE(); |
+ } |
+ } |
+ |
+ // prototype |
+ __ CallRuntime(Runtime::kToFastProperties, 1); |
+ |
+ // constructor |
+ __ CallRuntime(Runtime::kToFastProperties, 1); |
+ |
+ context()->Plug(x0); |
Dmitry Lomov (no reviews)
2014/10/27 21:37:13
The caller plugs context, no need to do this here.
arv (Not doing code reviews)
2014/10/28 09:42:00
Done.
Dmitry Lomov (no reviews)
2014/10/28 10:34:08
Acknowledged.
|
+} |
+ |
+ |
void FullCodeGenerator::EmitAssignment(Expression* expr) { |
DCHECK(expr->IsValidReferenceExpression()); |
@@ -4858,7 +4928,7 @@ void FullCodeGenerator::EmitGeneratorResume(Expression *generator, |
// The value stays in x0, and is ultimately read by the resumed generator, as |
// if CallRuntime(Runtime::kSuspendJSGeneratorObject) returned it. Or it |
- // is read to throw the value when the resumed generator is already closed. r1 |
+ // is read to throw the value when the resumed generator is already closed. x1 |
// will hold the generator object until the activation has been resumed. |
VisitForStackValue(generator); |
VisitForAccumulatorValue(value); |