summaryrefslogtreecommitdiff
path: root/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc')
-rw-r--r--deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc954
1 files changed, 79 insertions, 875 deletions
diff --git a/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc b/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc
index 51b3009cd0..ae1fab14b9 100644
--- a/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc
+++ b/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc
@@ -4,15 +4,16 @@
#if V8_TARGET_ARCH_ARM64
-#include "src/full-codegen/full-codegen.h"
#include "src/ast/compile-time-value.h"
#include "src/ast/scopes.h"
+#include "src/builtins/builtins-constructor.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/codegen.h"
#include "src/compilation-info.h"
#include "src/compiler.h"
#include "src/debug/debug.h"
+#include "src/full-codegen/full-codegen.h"
#include "src/ic/ic.h"
#include "src/arm64/code-stubs-arm64.h"
@@ -149,8 +150,6 @@ void FullCodeGenerator::Generate() {
// Reserve space on the stack for locals.
{ Comment cmnt(masm_, "[ Allocate locals");
int locals_count = info->scope()->num_stack_slots();
- // Generators allocate locals, if any, in context slots.
- DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
OperandStackDepthIncrement(locals_count);
if (locals_count > 0) {
if (locals_count >= 128) {
@@ -203,14 +202,17 @@ void FullCodeGenerator::Generate() {
if (info->scope()->new_target_var() != nullptr) {
__ Push(x3); // Preserve new target.
}
- if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
- FastNewFunctionContextStub stub(isolate());
+ if (slots <=
+ ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
+ Callable callable = CodeFactory::FastNewFunctionContext(
+ isolate(), info->scope()->scope_type());
__ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
- __ CallStub(&stub);
- // Result of FastNewFunctionContextStub is always in new space.
+ __ Call(callable.code(), RelocInfo::CODE_TARGET);
+ // Result of the FastNewFunctionContext builtin is always in new space.
need_write_barrier = false;
} else {
__ Push(x1);
+ __ Push(Smi::FromInt(info->scope()->scope_type()));
__ CallRuntime(Runtime::kNewFunctionContext);
}
if (info->scope()->new_target_var() != nullptr) {
@@ -257,37 +259,10 @@ void FullCodeGenerator::Generate() {
PrepareForBailoutForId(BailoutId::FunctionContext(),
BailoutState::NO_REGISTERS);
- // Possibly set up a local binding to the this function which is used in
- // derived constructors with super calls.
- Variable* this_function_var = info->scope()->this_function_var();
- if (this_function_var != nullptr) {
- Comment cmnt(masm_, "[ This function");
- if (!function_in_register_x1) {
- __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- // The write barrier clobbers register again, keep it marked as such.
- }
- SetVar(this_function_var, x1, x0, x2);
- }
-
- // Possibly set up a local binding to the new target value.
- Variable* new_target_var = info->scope()->new_target_var();
- if (new_target_var != nullptr) {
- Comment cmnt(masm_, "[ new.target");
- SetVar(new_target_var, x3, x0, x2);
- }
-
- // Possibly allocate RestParameters
- Variable* rest_param = info->scope()->rest_parameter();
- if (rest_param != nullptr) {
- Comment cmnt(masm_, "[ Allocate rest parameter array");
- if (!function_in_register_x1) {
- __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- }
- FastNewRestParameterStub stub(isolate());
- __ CallStub(&stub);
- function_in_register_x1 = false;
- SetVar(rest_param, x0, x1, x2);
- }
+ // We don't support new.target and rest parameters here.
+ DCHECK_NULL(info->scope()->new_target_var());
+ DCHECK_NULL(info->scope()->rest_parameter());
+ DCHECK_NULL(info->scope()->this_function_var());
Variable* arguments = info->scope()->arguments();
if (arguments != NULL) {
@@ -544,10 +519,8 @@ void FullCodeGenerator::TestContext::Plug(Handle<Object> lit) const {
true,
true_label_,
false_label_);
- DCHECK(lit->IsNull(isolate()) || lit->IsUndefined(isolate()) ||
- !lit->IsUndetectable());
- if (lit->IsUndefined(isolate()) || lit->IsNull(isolate()) ||
- lit->IsFalse(isolate())) {
+ DCHECK(lit->IsNullOrUndefined(isolate()) || !lit->IsUndetectable());
+ if (lit->IsNullOrUndefined(isolate()) || lit->IsFalse(isolate())) {
if (false_label_ != fall_through_) __ B(false_label_);
} else if (lit->IsTrue(isolate()) || lit->IsJSObject()) {
if (true_label_ != fall_through_) __ B(true_label_);
@@ -778,6 +751,7 @@ void FullCodeGenerator::VisitVariableDeclaration(
switch (variable->location()) {
case VariableLocation::UNALLOCATED: {
DCHECK(!variable->binding_needs_init());
+ globals_->Add(variable->name(), zone());
FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
DCHECK(!slot.IsInvalid());
globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
@@ -804,17 +778,7 @@ void FullCodeGenerator::VisitVariableDeclaration(
}
break;
- case VariableLocation::LOOKUP: {
- Comment cmnt(masm_, "[ VariableDeclaration");
- DCHECK_EQ(VAR, variable->mode());
- DCHECK(!variable->binding_needs_init());
- __ Mov(x2, Operand(variable->name()));
- __ Push(x2);
- __ CallRuntime(Runtime::kDeclareEvalVar);
- PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
- break;
- }
-
+ case VariableLocation::LOOKUP:
case VariableLocation::MODULE:
UNREACHABLE();
}
@@ -827,6 +791,7 @@ void FullCodeGenerator::VisitFunctionDeclaration(
Variable* variable = proxy->var();
switch (variable->location()) {
case VariableLocation::UNALLOCATED: {
+ globals_->Add(variable->name(), zone());
FeedbackVectorSlot slot = proxy->VariableFeedbackSlot();
DCHECK(!slot.IsInvalid());
globals_->Add(handle(Smi::FromInt(slot.ToInt()), isolate()), zone());
@@ -865,17 +830,7 @@ void FullCodeGenerator::VisitFunctionDeclaration(
break;
}
- case VariableLocation::LOOKUP: {
- Comment cmnt(masm_, "[ Function Declaration");
- __ Mov(x2, Operand(variable->name()));
- PushOperand(x2);
- // Push initial value for function declaration.
- VisitForStackValue(declaration->fun());
- CallRuntimeWithOperands(Runtime::kDeclareEvalFunction);
- PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS);
- break;
- }
-
+ case VariableLocation::LOOKUP:
case VariableLocation::MODULE:
UNREACHABLE();
}
@@ -1171,91 +1126,6 @@ void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer,
CallStoreIC(slot, isolate()->factory()->home_object_symbol());
}
-
-void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
- TypeofMode typeof_mode,
- Label* slow) {
- Register current = cp;
- Register next = x10;
- Register temp = x11;
-
- int to_check = scope()->ContextChainLengthUntilOutermostSloppyEval();
- for (Scope* s = scope(); to_check > 0; s = s->outer_scope()) {
- if (!s->NeedsContext()) continue;
- if (s->calls_sloppy_eval()) {
- // Check that extension is "the hole".
- __ Ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
- __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
- }
- // Load next context in chain.
- __ Ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
- // Walk the rest of the chain without clobbering cp.
- current = next;
- to_check--;
- }
-
- // All extension objects were empty and it is safe to use a normal global
- // load machinery.
- EmitGlobalVariableLoad(proxy, typeof_mode);
-}
-
-
-MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
- Label* slow) {
- DCHECK(var->IsContextSlot());
- Register context = cp;
- Register next = x10;
- Register temp = x11;
-
- for (Scope* s = scope(); s != var->scope(); s = s->outer_scope()) {
- if (s->NeedsContext()) {
- if (s->calls_sloppy_eval()) {
- // Check that extension is "the hole".
- __ Ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
- __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
- }
- __ Ldr(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
- // Walk the rest of the chain without clobbering cp.
- context = next;
- }
- }
- // Check that last extension is "the hole".
- __ Ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
- __ JumpIfNotRoot(temp, Heap::kTheHoleValueRootIndex, slow);
-
- // This function is used only for loads, not stores, so it's safe to
- // return an cp-based operand (the write barrier cannot be allowed to
- // destroy the cp register).
- return ContextMemOperand(context, var->index());
-}
-
-
-void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy,
- TypeofMode typeof_mode,
- Label* slow, Label* done) {
- // Generate fast-case code for variables that might be shadowed by
- // eval-introduced variables. Eval is used a lot without
- // introducing variables. In those cases, we do not want to
- // perform a runtime call for all variables in the scope
- // containing the eval.
- Variable* var = proxy->var();
- if (var->mode() == DYNAMIC_GLOBAL) {
- EmitLoadGlobalCheckExtensions(proxy, typeof_mode, slow);
- __ B(done);
- } else if (var->mode() == DYNAMIC_LOCAL) {
- Variable* local = var->local_if_not_shadowed();
- __ Ldr(x0, ContextSlotOperandCheckExtensions(local, slow));
- if (local->binding_needs_init()) {
- __ JumpIfNotRoot(x0, Heap::kTheHoleValueRootIndex, done);
- __ Mov(x0, Operand(var->name()));
- __ Push(x0);
- __ CallRuntime(Runtime::kThrowReferenceError);
- } else {
- __ B(done);
- }
- }
-}
-
void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
TypeofMode typeof_mode) {
// Record position before possible IC call.
@@ -1263,8 +1133,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS);
Variable* var = proxy->var();
- // Three cases: global variables, lookup variables, and all other types of
- // variables.
+ // Two cases: global variables and all other types of variables.
switch (var->location()) {
case VariableLocation::UNALLOCATED: {
Comment cmnt(masm_, "Global variable");
@@ -1297,24 +1166,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
break;
}
- case VariableLocation::LOOKUP: {
- Label done, slow;
- // Generate code for loading from variables potentially shadowed by
- // eval-introduced variables.
- EmitDynamicLookupFastCase(proxy, typeof_mode, &slow, &done);
- __ Bind(&slow);
- Comment cmnt(masm_, "Lookup variable");
- __ Push(var->name());
- Runtime::FunctionId function_id =
- typeof_mode == NOT_INSIDE_TYPEOF
- ? Runtime::kLoadLookupSlot
- : Runtime::kLoadLookupSlotInsideTypeof;
- __ CallRuntime(function_id);
- __ Bind(&done);
- context()->Plug(x0);
- break;
- }
-
+ case VariableLocation::LOOKUP:
case VariableLocation::MODULE:
UNREACHABLE();
}
@@ -1341,7 +1193,8 @@ void FullCodeGenerator::EmitAccessor(ObjectLiteralProperty* property) {
void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
Comment cmnt(masm_, "[ ObjectLiteral");
- Handle<FixedArray> constant_properties = expr->constant_properties();
+ Handle<FixedArray> constant_properties =
+ expr->GetOrBuildConstantProperties(isolate());
__ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ Mov(x2, Smi::FromInt(expr->literal_index()));
__ Mov(x1, Operand(constant_properties));
@@ -1351,8 +1204,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
__ Push(x3, x2, x1, x0);
__ CallRuntime(Runtime::kCreateObjectLiteral);
} else {
- FastCloneShallowObjectStub stub(isolate(), expr->properties_count());
- __ CallStub(&stub);
+ Callable callable = CodeFactory::FastCloneShallowObject(
+ isolate(), expr->properties_count());
+ __ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER);
@@ -1362,10 +1216,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
bool result_saved = false;
AccessorTable accessor_table(zone());
- int property_index = 0;
- for (; property_index < expr->properties()->length(); property_index++) {
- ObjectLiteral::Property* property = expr->properties()->at(property_index);
- if (property->is_computed_name()) break;
+ for (int i = 0; i < expr->properties()->length(); i++) {
+ ObjectLiteral::Property* property = expr->properties()->at(i);
+ DCHECK(!property->is_computed_name());
if (property->IsCompileTimeValue()) continue;
Literal* key = property->key()->AsLiteral();
@@ -1375,6 +1228,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
result_saved = true;
}
switch (property->kind()) {
+ case ObjectLiteral::Property::SPREAD:
case ObjectLiteral::Property::CONSTANT:
UNREACHABLE();
case ObjectLiteral::Property::MATERIALIZED_LITERAL:
@@ -1422,20 +1276,20 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
PushOperand(x0);
VisitForStackValue(value);
CallRuntimeWithOperands(Runtime::kInternalSetPrototype);
- PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
+ PrepareForBailoutForId(expr->GetIdForPropertySet(i),
BailoutState::NO_REGISTERS);
break;
case ObjectLiteral::Property::GETTER:
if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key);
- it->second->bailout_id = expr->GetIdForPropertySet(property_index);
+ it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property;
}
break;
case ObjectLiteral::Property::SETTER:
if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key);
- it->second->bailout_id = expr->GetIdForPropertySet(property_index);
+ it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property;
}
break;
@@ -1458,73 +1312,6 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS);
}
- // Object literals have two parts. The "static" part on the left contains no
- // computed property names, and so we can compute its map ahead of time; see
- // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part
- // starts with the first computed property name, and continues with all
- // properties to its right. All the code from above initializes the static
- // component of the object literal, and arranges for the map of the result to
- // reflect the static order in which the keys appear. For the dynamic
- // properties, we compile them into a series of "SetOwnProperty" runtime
- // calls. This will preserve insertion order.
- for (; property_index < expr->properties()->length(); property_index++) {
- ObjectLiteral::Property* property = expr->properties()->at(property_index);
-
- Expression* value = property->value();
- if (!result_saved) {
- PushOperand(x0); // Save result on stack
- result_saved = true;
- }
-
- __ Peek(x10, 0); // Duplicate receiver.
- PushOperand(x10);
-
- if (property->kind() == ObjectLiteral::Property::PROTOTYPE) {
- DCHECK(!property->is_computed_name());
- VisitForStackValue(value);
- DCHECK(property->emit_store());
- CallRuntimeWithOperands(Runtime::kInternalSetPrototype);
- PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
- BailoutState::NO_REGISTERS);
- } else {
- EmitPropertyKey(property, expr->GetIdForPropertyName(property_index));
- VisitForStackValue(value);
- if (NeedsHomeObject(value)) {
- EmitSetHomeObject(value, 2, property->GetSlot());
- }
-
- switch (property->kind()) {
- case ObjectLiteral::Property::CONSTANT:
- case ObjectLiteral::Property::MATERIALIZED_LITERAL:
- case ObjectLiteral::Property::COMPUTED:
- if (property->emit_store()) {
- PushOperand(Smi::FromInt(NONE));
- PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
- CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
- PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
- BailoutState::NO_REGISTERS);
- } else {
- DropOperands(3);
- }
- break;
-
- case ObjectLiteral::Property::PROTOTYPE:
- UNREACHABLE();
- break;
-
- case ObjectLiteral::Property::GETTER:
- PushOperand(Smi::FromInt(NONE));
- CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
- break;
-
- case ObjectLiteral::Property::SETTER:
- PushOperand(Smi::FromInt(NONE));
- CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
- break;
- }
- }
- }
-
if (result_saved) {
context()->PlugTOS();
} else {
@@ -1536,7 +1323,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Comment cmnt(masm_, "[ ArrayLiteral");
- Handle<FixedArray> constant_elements = expr->constant_elements();
+ Handle<ConstantElementsPair> constant_elements =
+ expr->GetOrBuildConstantElements(isolate());
bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind());
@@ -1555,8 +1343,9 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
__ Push(x3, x2, x1, x0);
__ CallRuntime(Runtime::kCreateArrayLiteral);
} else {
- FastCloneShallowArrayStub stub(isolate(), allocation_site_mode);
- __ CallStub(&stub);
+ Callable callable =
+ CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
+ __ Call(callable.code(), RelocInfo::CODE_TARGET);
RestoreContext();
}
PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER);
@@ -1619,33 +1408,6 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
VisitForStackValue(property->obj());
}
break;
- case NAMED_SUPER_PROPERTY:
- VisitForStackValue(
- property->obj()->AsSuperPropertyReference()->this_var());
- VisitForAccumulatorValue(
- property->obj()->AsSuperPropertyReference()->home_object());
- PushOperand(result_register());
- if (expr->is_compound()) {
- const Register scratch = x10;
- __ Peek(scratch, kPointerSize);
- PushOperands(scratch, result_register());
- }
- break;
- case KEYED_SUPER_PROPERTY:
- VisitForStackValue(
- property->obj()->AsSuperPropertyReference()->this_var());
- VisitForStackValue(
- property->obj()->AsSuperPropertyReference()->home_object());
- VisitForAccumulatorValue(property->key());
- PushOperand(result_register());
- if (expr->is_compound()) {
- const Register scratch1 = x10;
- const Register scratch2 = x11;
- __ Peek(scratch1, 2 * kPointerSize);
- __ Peek(scratch2, kPointerSize);
- PushOperands(scratch1, scratch2, result_register());
- }
- break;
case KEYED_PROPERTY:
if (expr->is_compound()) {
VisitForStackValue(property->obj());
@@ -1657,6 +1419,10 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
VisitForStackValue(property->key());
}
break;
+ case NAMED_SUPER_PROPERTY:
+ case KEYED_SUPER_PROPERTY:
+ UNREACHABLE();
+ break;
}
// For compound assignments we need another deoptimization point after the
@@ -1673,21 +1439,15 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
PrepareForBailoutForId(property->LoadId(),
BailoutState::TOS_REGISTER);
break;
- case NAMED_SUPER_PROPERTY:
- EmitNamedSuperPropertyLoad(property);
- PrepareForBailoutForId(property->LoadId(),
- BailoutState::TOS_REGISTER);
- break;
- case KEYED_SUPER_PROPERTY:
- EmitKeyedSuperPropertyLoad(property);
- PrepareForBailoutForId(property->LoadId(),
- BailoutState::TOS_REGISTER);
- break;
case KEYED_PROPERTY:
EmitKeyedPropertyLoad(property);
PrepareForBailoutForId(property->LoadId(),
BailoutState::TOS_REGISTER);
break;
+ case NAMED_SUPER_PROPERTY:
+ case KEYED_SUPER_PROPERTY:
+ UNREACHABLE();
+ break;
}
}
@@ -1726,17 +1486,13 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
case NAMED_PROPERTY:
EmitNamedPropertyAssignment(expr);
break;
- case NAMED_SUPER_PROPERTY:
- EmitNamedSuperPropertyStore(property);
- context()->Plug(x0);
- break;
- case KEYED_SUPER_PROPERTY:
- EmitKeyedSuperPropertyStore(property);
- context()->Plug(x0);
- break;
case KEYED_PROPERTY:
EmitKeyedPropertyAssignment(expr);
break;
+ case NAMED_SUPER_PROPERTY:
+ case KEYED_SUPER_PROPERTY:
+ UNREACHABLE();
+ break;
}
}
@@ -1852,60 +1608,6 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
context()->Plug(x0);
}
-
-void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
- for (int i = 0; i < lit->properties()->length(); i++) {
- ClassLiteral::Property* property = lit->properties()->at(i);
- Expression* value = property->value();
-
- Register scratch = x1;
- if (property->is_static()) {
- __ Peek(scratch, kPointerSize); // constructor
- } else {
- __ Peek(scratch, 0); // prototype
- }
- PushOperand(scratch);
- EmitPropertyKey(property, lit->GetIdForProperty(i));
-
- // The static prototype property is read only. We handle the non computed
- // property name case in the parser. Since this is the only case where we
- // need to check for an own read only property we special case this so we do
- // not need to do this for every property.
- if (property->is_static() && property->is_computed_name()) {
- __ CallRuntime(Runtime::kThrowIfStaticPrototype);
- __ Push(x0);
- }
-
- VisitForStackValue(value);
- if (NeedsHomeObject(value)) {
- EmitSetHomeObject(value, 2, property->GetSlot());
- }
-
- switch (property->kind()) {
- case ClassLiteral::Property::METHOD:
- PushOperand(Smi::FromInt(DONT_ENUM));
- PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
- CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
- break;
-
- case ClassLiteral::Property::GETTER:
- PushOperand(Smi::FromInt(DONT_ENUM));
- CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
- break;
-
- case ClassLiteral::Property::SETTER:
- PushOperand(Smi::FromInt(DONT_ENUM));
- CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
- break;
-
- case ClassLiteral::Property::FIELD:
- default:
- UNREACHABLE();
- }
- }
-}
-
-
void FullCodeGenerator::EmitAssignment(Expression* expr,
FeedbackVectorSlot slot) {
DCHECK(expr->IsValidReferenceExpressionOrThis());
@@ -1931,43 +1633,6 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
CallStoreIC(slot, prop->key()->AsLiteral()->value());
break;
}
- case NAMED_SUPER_PROPERTY: {
- PushOperand(x0);
- VisitForStackValue(prop->obj()->AsSuperPropertyReference()->this_var());
- VisitForAccumulatorValue(
- prop->obj()->AsSuperPropertyReference()->home_object());
- // stack: value, this; x0: home_object
- Register scratch = x10;
- Register scratch2 = x11;
- __ mov(scratch, result_register()); // home_object
- __ Peek(x0, kPointerSize); // value
- __ Peek(scratch2, 0); // this
- __ Poke(scratch2, kPointerSize); // this
- __ Poke(scratch, 0); // home_object
- // stack: this, home_object; x0: value
- EmitNamedSuperPropertyStore(prop);
- break;
- }
- case KEYED_SUPER_PROPERTY: {
- PushOperand(x0);
- VisitForStackValue(prop->obj()->AsSuperPropertyReference()->this_var());
- VisitForStackValue(
- prop->obj()->AsSuperPropertyReference()->home_object());
- VisitForAccumulatorValue(prop->key());
- Register scratch = x10;
- Register scratch2 = x11;
- __ Peek(scratch2, 2 * kPointerSize); // value
- // stack: value, this, home_object; x0: key, x11: value
- __ Peek(scratch, kPointerSize); // this
- __ Poke(scratch, 2 * kPointerSize);
- __ Peek(scratch, 0); // home_object
- __ Poke(scratch, kPointerSize);
- __ Poke(x0, 0);
- __ Move(x0, scratch2);
- // stack: this, home_object, key; x0: value.
- EmitKeyedSuperPropertyStore(prop);
- break;
- }
case KEYED_PROPERTY: {
PushOperand(x0); // Preserve value.
VisitForStackValue(prop->obj());
@@ -1978,6 +1643,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
CallKeyedStoreIC(slot);
break;
}
+ case NAMED_SUPER_PROPERTY:
+ case KEYED_SUPER_PROPERTY:
+ UNREACHABLE();
+ break;
}
context()->Plug(x0);
}
@@ -2038,25 +1707,17 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
} else {
DCHECK(var->mode() != CONST || op == Token::INIT);
- if (var->IsLookupSlot()) {
- // Assignment to var.
- __ Push(var->name());
- __ Push(x0);
- __ CallRuntime(is_strict(language_mode())
- ? Runtime::kStoreLookupSlot_Strict
- : Runtime::kStoreLookupSlot_Sloppy);
- } else {
- // Assignment to var or initializing assignment to let/const in harmony
- // mode.
- DCHECK(var->IsStackAllocated() || var->IsContextSlot());
- MemOperand location = VarOperand(var, x1);
- if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) {
- __ Ldr(x10, location);
- __ CompareRoot(x10, Heap::kTheHoleValueRootIndex);
- __ Check(eq, kLetBindingReInitialization);
- }
- EmitStoreToStackLocalOrContextSlot(var, location);
+ DCHECK(var->IsStackAllocated() || var->IsContextSlot());
+ DCHECK(!var->IsLookupSlot());
+ // Assignment to var or initializing assignment to let/const in harmony
+ // mode.
+ MemOperand location = VarOperand(var, x1);
+ if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) {
+ __ Ldr(x10, location);
+ __ CompareRoot(x10, Heap::kTheHoleValueRootIndex);
+ __ Check(eq, kLetBindingReInitialization);
}
+ EmitStoreToStackLocalOrContextSlot(var, location);
}
}
@@ -2076,35 +1737,6 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
}
-void FullCodeGenerator::EmitNamedSuperPropertyStore(Property* prop) {
- // Assignment to named property of super.
- // x0 : value
- // stack : receiver ('this'), home_object
- DCHECK(prop != NULL);
- Literal* key = prop->key()->AsLiteral();
- DCHECK(key != NULL);
-
- PushOperand(key->value());
- PushOperand(x0);
- CallRuntimeWithOperands(is_strict(language_mode())
- ? Runtime::kStoreToSuper_Strict
- : Runtime::kStoreToSuper_Sloppy);
-}
-
-
-void FullCodeGenerator::EmitKeyedSuperPropertyStore(Property* prop) {
- // Assignment to named property of super.
- // x0 : value
- // stack : receiver ('this'), home_object, key
- DCHECK(prop != NULL);
-
- PushOperand(x0);
- CallRuntimeWithOperands(is_strict(language_mode())
- ? Runtime::kStoreKeyedToSuper_Strict
- : Runtime::kStoreKeyedToSuper_Sloppy);
-}
-
-
void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
ASM_LOCATION("FullCodeGenerator::EmitKeyedPropertyAssignment");
// Assignment to a property, using a keyed store IC.
@@ -2159,47 +1791,6 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
}
-void FullCodeGenerator::EmitSuperCallWithLoadIC(Call* expr) {
- ASM_LOCATION("FullCodeGenerator::EmitSuperCallWithLoadIC");
- Expression* callee = expr->expression();
- DCHECK(callee->IsProperty());
- Property* prop = callee->AsProperty();
- DCHECK(prop->IsSuperAccess());
- SetExpressionPosition(prop);
-
- Literal* key = prop->key()->AsLiteral();
- DCHECK(!key->value()->IsSmi());
-
- // Load the function from the receiver.
- const Register scratch = x10;
- SuperPropertyReference* super_ref =
- callee->AsProperty()->obj()->AsSuperPropertyReference();
- VisitForStackValue(super_ref->home_object());
- VisitForAccumulatorValue(super_ref->this_var());
- PushOperand(x0);
- __ Peek(scratch, kPointerSize);
- PushOperands(x0, scratch);
- PushOperand(key->value());
-
- // Stack here:
- // - home_object
- // - this (receiver)
- // - this (receiver) <-- LoadFromSuper will pop here and below.
- // - home_object
- // - key
- CallRuntimeWithOperands(Runtime::kLoadFromSuper);
- PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER);
-
- // Replace home_object with target function.
- __ Poke(x0, kPointerSize);
-
- // Stack here:
- // - target function
- // - this (receiver)
- EmitCall(expr);
-}
-
-
// Code common for calls using the IC.
void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
Expression* key) {
@@ -2225,44 +1816,6 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
}
-void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) {
- ASM_LOCATION("FullCodeGenerator::EmitKeyedSuperCallWithLoadIC");
- Expression* callee = expr->expression();
- DCHECK(callee->IsProperty());
- Property* prop = callee->AsProperty();
- DCHECK(prop->IsSuperAccess());
- SetExpressionPosition(prop);
-
- // Load the function from the receiver.
- const Register scratch = x10;
- SuperPropertyReference* super_ref =
- callee->AsProperty()->obj()->AsSuperPropertyReference();
- VisitForStackValue(super_ref->home_object());
- VisitForAccumulatorValue(super_ref->this_var());
- PushOperand(x0);
- __ Peek(scratch, kPointerSize);
- PushOperands(x0, scratch);
- VisitForStackValue(prop->key());
-
- // Stack here:
- // - home_object
- // - this (receiver)
- // - this (receiver) <-- LoadKeyedFromSuper will pop here and below.
- // - home_object
- // - key
- CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper);
- PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER);
-
- // Replace home_object with target function.
- __ Poke(x0, kPointerSize);
-
- // Stack here:
- // - target function
- // - this (receiver)
- EmitCall(expr);
-}
-
-
void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) {
ASM_LOCATION("FullCodeGenerator::EmitCall");
// Load the arguments.
@@ -2295,119 +1848,6 @@ void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) {
context()->DropAndPlug(1, x0);
}
-void FullCodeGenerator::EmitResolvePossiblyDirectEval(Call* expr) {
- int arg_count = expr->arguments()->length();
- ASM_LOCATION("FullCodeGenerator::EmitResolvePossiblyDirectEval");
- // Prepare to push a copy of the first argument or undefined if it doesn't
- // exist.
- if (arg_count > 0) {
- __ Peek(x9, arg_count * kXRegSize);
- } else {
- __ LoadRoot(x9, Heap::kUndefinedValueRootIndex);
- }
-
- __ Ldr(x10, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
-
- // Prepare to push the language mode.
- __ Mov(x11, Smi::FromInt(language_mode()));
- // Prepare to push the start position of the scope the calls resides in.
- __ Mov(x12, Smi::FromInt(scope()->start_position()));
- // Prepare to push the source position of the eval call.
- __ Mov(x13, Smi::FromInt(expr->position()));
-
- // Push.
- __ Push(x9, x10, x11, x12, x13);
-
- // Do the runtime call.
- __ CallRuntime(Runtime::kResolvePossiblyDirectEval);
-}
-
-
-// See http://www.ecma-international.org/ecma-262/6.0/#sec-function-calls.
-void FullCodeGenerator::PushCalleeAndWithBaseObject(Call* expr) {
- VariableProxy* callee = expr->expression()->AsVariableProxy();
- if (callee->var()->IsLookupSlot()) {
- Label slow, done;
- SetExpressionPosition(callee);
- // Generate code for loading from variables potentially shadowed
- // by eval-introduced variables.
- EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done);
-
- __ Bind(&slow);
- // Call the runtime to find the function to call (returned in x0)
- // and the object holding it (returned in x1).
- __ Push(callee->name());
- __ CallRuntime(Runtime::kLoadLookupSlotForCall);
- PushOperands(x0, x1); // Receiver, function.
- PrepareForBailoutForId(expr->LookupId(), BailoutState::NO_REGISTERS);
-
- // If fast case code has been generated, emit code to push the
- // function and receiver and have the slow path jump around this
- // code.
- if (done.is_linked()) {
- Label call;
- __ B(&call);
- __ Bind(&done);
- // Push function.
- // The receiver is implicitly the global receiver. Indicate this
- // by passing the undefined to the call function stub.
- __ LoadRoot(x1, Heap::kUndefinedValueRootIndex);
- __ Push(x0, x1);
- __ Bind(&call);
- }
- } else {
- VisitForStackValue(callee);
- // refEnv.WithBaseObject()
- __ LoadRoot(x10, Heap::kUndefinedValueRootIndex);
- PushOperand(x10); // Reserved receiver slot.
- }
-}
-
-
-void FullCodeGenerator::EmitPossiblyEvalCall(Call* expr) {
- ASM_LOCATION("FullCodeGenerator::EmitPossiblyEvalCall");
- // In a call to eval, we first call Runtime_ResolvePossiblyDirectEval
- // to resolve the function we need to call. Then we call the resolved
- // function using the given arguments.
- ZoneList<Expression*>* args = expr->arguments();
- int arg_count = args->length();
-
- PushCalleeAndWithBaseObject(expr);
-
- // Push the arguments.
- for (int i = 0; i < arg_count; i++) {
- VisitForStackValue(args->at(i));
- }
-
- // Push a copy of the function (found below the arguments) and
- // resolve eval.
- __ Peek(x10, (arg_count + 1) * kPointerSize);
- __ Push(x10);
- EmitResolvePossiblyDirectEval(expr);
-
- // Touch up the stack with the resolved function.
- __ Poke(x0, (arg_count + 1) * kPointerSize);
-
- PrepareForBailoutForId(expr->EvalId(), BailoutState::NO_REGISTERS);
-
- // Record source position for debugger.
- SetCallPosition(expr);
-
- // Call the evaluated function.
- Handle<Code> code = CodeFactory::CallIC(isolate(), ConvertReceiverMode::kAny,
- expr->tail_call_mode())
- .code();
- __ Mov(x3, SmiFromSlot(expr->CallFeedbackICSlot()));
- __ Peek(x1, (arg_count + 1) * kXRegSize);
- __ Mov(x0, arg_count);
- __ Call(code, RelocInfo::CODE_TARGET);
- OperandStackDepthDecrement(arg_count + 1);
- RecordJSReturnSite(expr);
- RestoreContext();
- context()->DropAndPlug(1, x0);
-}
-
-
void FullCodeGenerator::VisitCallNew(CallNew* expr) {
Comment cmnt(masm_, "[ CallNew");
// According to ECMA-262, section 11.2.2, page 44, the function
@@ -2448,50 +1888,6 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
}
-void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
- ASM_LOCATION("FullCodeGenerator::EmitSuperConstructorCall");
- SuperCallReference* super_call_ref =
- expr->expression()->AsSuperCallReference();
- DCHECK_NOT_NULL(super_call_ref);
-
- // Push the super constructor target on the stack (may be null,
- // but the Construct builtin can deal with that properly).
- VisitForAccumulatorValue(super_call_ref->this_function_var());
- __ AssertFunction(result_register());
- __ Ldr(result_register(),
- FieldMemOperand(result_register(), HeapObject::kMapOffset));
- __ Ldr(result_register(),
- FieldMemOperand(result_register(), Map::kPrototypeOffset));
- PushOperand(result_register());
-
- // Push the arguments ("left-to-right") on the stack.
- ZoneList<Expression*>* args = expr->arguments();
- int arg_count = args->length();
- for (int i = 0; i < arg_count; i++) {
- VisitForStackValue(args->at(i));
- }
-
- // Call the construct call builtin that handles allocation and
- // constructor invocation.
- SetConstructCallPosition(expr);
-
- // Load new target into x3.
- VisitForAccumulatorValue(super_call_ref->new_target_var());
- __ Mov(x3, result_register());
-
- // Load function and argument count into x1 and x0.
- __ Mov(x0, arg_count);
- __ Peek(x1, arg_count * kXRegSize);
-
- __ Call(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
- OperandStackDepthDecrement(arg_count + 1);
-
- RecordJSReturnSite(expr);
- RestoreContext();
- context()->Plug(x0);
-}
-
-
void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
@@ -2578,28 +1974,6 @@ void FullCodeGenerator::EmitIsTypedArray(CallRuntime* expr) {
}
-void FullCodeGenerator::EmitIsRegExp(CallRuntime* expr) {
- ZoneList<Expression*>* args = expr->arguments();
- DCHECK(args->length() == 1);
-
- VisitForAccumulatorValue(args->at(0));
-
- Label materialize_true, materialize_false;
- Label* if_true = NULL;
- Label* if_false = NULL;
- Label* fall_through = NULL;
- context()->PrepareTest(&materialize_true, &materialize_false,
- &if_true, &if_false, &fall_through);
-
- __ JumpIfSmi(x0, if_false);
- __ CompareObjectType(x0, x10, x11, JS_REGEXP_TYPE);
- PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
- Split(eq, if_true, if_false, fall_through);
-
- context()->Plug(if_true, if_false);
-}
-
-
void FullCodeGenerator::EmitIsJSProxy(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
DCHECK(args->length() == 1);
@@ -2851,16 +2225,12 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
__ Push(x12, x11);
__ CallRuntime(Runtime::kDeleteProperty_Sloppy);
context()->Plug(x0);
- } else if (var->IsStackAllocated() || var->IsContextSlot()) {
+ } else {
+ DCHECK(!var->IsLookupSlot());
+ DCHECK(var->IsStackAllocated() || var->IsContextSlot());
// Result of deleting non-global, non-dynamic variables is false.
// The subexpression does not have side effects.
context()->Plug(is_this);
- } else {
- // Non-global variable. Call the runtime to try to delete from the
- // context where the variable was introduced.
- __ Push(var->name());
- __ CallRuntime(Runtime::kDeleteLookupSlot);
- context()->Plug(x0);
}
} else {
// Result of deleting non-property, non-variable reference is true.
@@ -2965,33 +2335,6 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
break;
}
- case NAMED_SUPER_PROPERTY: {
- VisitForStackValue(prop->obj()->AsSuperPropertyReference()->this_var());
- VisitForAccumulatorValue(
- prop->obj()->AsSuperPropertyReference()->home_object());
- PushOperand(result_register());
- const Register scratch = x10;
- __ Peek(scratch, kPointerSize);
- PushOperands(scratch, result_register());
- EmitNamedSuperPropertyLoad(prop);
- break;
- }
-
- case KEYED_SUPER_PROPERTY: {
- VisitForStackValue(prop->obj()->AsSuperPropertyReference()->this_var());
- VisitForStackValue(
- prop->obj()->AsSuperPropertyReference()->home_object());
- VisitForAccumulatorValue(prop->key());
- PushOperand(result_register());
- const Register scratch1 = x10;
- const Register scratch2 = x11;
- __ Peek(scratch1, 2 * kPointerSize);
- __ Peek(scratch2, kPointerSize);
- PushOperands(scratch1, scratch2, result_register());
- EmitKeyedSuperPropertyLoad(prop);
- break;
- }
-
case KEYED_PROPERTY: {
VisitForStackValue(prop->obj());
VisitForStackValue(prop->key());
@@ -3001,6 +2344,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
break;
}
+ case NAMED_SUPER_PROPERTY:
+ case KEYED_SUPER_PROPERTY:
case VARIABLE:
UNREACHABLE();
}
@@ -3036,14 +2381,12 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case NAMED_PROPERTY:
__ Poke(x0, kPointerSize);
break;
- case NAMED_SUPER_PROPERTY:
- __ Poke(x0, kPointerSize * 2);
- break;
case KEYED_PROPERTY:
__ Poke(x0, kPointerSize * 2);
break;
+ case NAMED_SUPER_PROPERTY:
case KEYED_SUPER_PROPERTY:
- __ Poke(x0, kPointerSize * 3);
+ UNREACHABLE();
break;
}
}
@@ -3075,14 +2418,12 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
case NAMED_PROPERTY:
__ Poke(x0, kXRegSize);
break;
- case NAMED_SUPER_PROPERTY:
- __ Poke(x0, 2 * kXRegSize);
- break;
case KEYED_PROPERTY:
__ Poke(x0, 2 * kXRegSize);
break;
+ case NAMED_SUPER_PROPERTY:
case KEYED_SUPER_PROPERTY:
- __ Poke(x0, 3 * kXRegSize);
+ UNREACHABLE();
break;
}
}
@@ -3141,30 +2482,6 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
break;
}
- case NAMED_SUPER_PROPERTY: {
- EmitNamedSuperPropertyStore(prop);
- PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
- if (expr->is_postfix()) {
- if (!context()->IsEffect()) {
- context()->PlugTOS();
- }
- } else {
- context()->Plug(x0);
- }
- break;
- }
- case KEYED_SUPER_PROPERTY: {
- EmitKeyedSuperPropertyStore(prop);
- PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
- if (expr->is_postfix()) {
- if (!context()->IsEffect()) {
- context()->PlugTOS();
- }
- } else {
- context()->Plug(x0);
- }
- break;
- }
case KEYED_PROPERTY: {
PopOperand(StoreDescriptor::NameRegister());
PopOperand(StoreDescriptor::ReceiverRegister());
@@ -3179,6 +2496,10 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
break;
}
+ case NAMED_SUPER_PROPERTY:
+ case KEYED_SUPER_PROPERTY:
+ UNREACHABLE();
+ break;
}
}
@@ -3376,63 +2697,8 @@ void FullCodeGenerator::EmitLiteralCompareNil(CompareOperation* expr,
void FullCodeGenerator::VisitYield(Yield* expr) {
- Comment cmnt(masm_, "[ Yield");
- SetExpressionPosition(expr);
-
- // Evaluate yielded value first; the initial iterator definition depends on
- // this. It stays on the stack while we update the iterator.
- VisitForStackValue(expr->expression());
-
- // TODO(jbramley): Tidy this up once the merge is done, using named registers
- // and suchlike. The implementation changes a little by bleeding_edge so I
- // don't want to spend too much time on it now.
-
- Label suspend, continuation, post_runtime, resume, exception;
-
- __ B(&suspend);
- // TODO(jbramley): This label is bound here because the following code
- // looks at its pos(). Is it possible to do something more efficient here,
- // perhaps using Adr?
- __ Bind(&continuation);
- // When we arrive here, x0 holds the generator object.
- __ RecordGeneratorContinuation();
- __ Ldr(x1, FieldMemOperand(x0, JSGeneratorObject::kResumeModeOffset));
- __ Ldr(x0, FieldMemOperand(x0, JSGeneratorObject::kInputOrDebugPosOffset));
- STATIC_ASSERT(JSGeneratorObject::kNext < JSGeneratorObject::kReturn);
- STATIC_ASSERT(JSGeneratorObject::kThrow > JSGeneratorObject::kReturn);
- __ Cmp(x1, Operand(Smi::FromInt(JSGeneratorObject::kReturn)));
- __ B(lt, &resume);
- __ Push(result_register());
- __ B(gt, &exception);
- EmitCreateIteratorResult(true);
- EmitUnwindAndReturn();
-
- __ Bind(&exception);
- __ CallRuntime(expr->rethrow_on_exception() ? Runtime::kReThrow
- : Runtime::kThrow);
-
- __ Bind(&suspend);
- OperandStackDepthIncrement(1); // Not popped on this path.
- VisitForAccumulatorValue(expr->generator_object());
- DCHECK((continuation.pos() > 0) && Smi::IsValid(continuation.pos()));
- __ Mov(x1, Smi::FromInt(continuation.pos()));
- __ Str(x1, FieldMemOperand(x0, JSGeneratorObject::kContinuationOffset));
- __ Str(cp, FieldMemOperand(x0, JSGeneratorObject::kContextOffset));
- __ Mov(x1, cp);
- __ RecordWriteField(x0, JSGeneratorObject::kContextOffset, x1, x2,
- kLRHasBeenSaved, kDontSaveFPRegs);
- __ Add(x1, fp, StandardFrameConstants::kExpressionsOffset);
- __ Cmp(__ StackPointer(), x1);
- __ B(eq, &post_runtime);
- __ Push(x0); // generator object
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 1);
- RestoreContext();
- __ Bind(&post_runtime);
- PopOperand(result_register());
- EmitReturnSequence();
-
- __ Bind(&resume);
- context()->Plug(result_register());
+ // Resumable functions are not supported.
+ UNREACHABLE();
}
void FullCodeGenerator::PushOperands(Register reg1, Register reg2) {
@@ -3556,68 +2822,6 @@ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
}
-void FullCodeGenerator::EnterFinallyBlock() {
- ASM_LOCATION("FullCodeGenerator::EnterFinallyBlock");
- DCHECK(!result_register().is(x10));
- // Store pending message while executing finally block.
- ExternalReference pending_message_obj =
- ExternalReference::address_of_pending_message_obj(isolate());
- __ Mov(x10, pending_message_obj);
- __ Ldr(x10, MemOperand(x10));
- PushOperand(x10);
-
- ClearPendingMessage();
-}
-
-
-void FullCodeGenerator::ExitFinallyBlock() {
- ASM_LOCATION("FullCodeGenerator::ExitFinallyBlock");
- DCHECK(!result_register().is(x10));
-
- // Restore pending message from stack.
- PopOperand(x10);
- ExternalReference pending_message_obj =
- ExternalReference::address_of_pending_message_obj(isolate());
- __ Mov(x13, pending_message_obj);
- __ Str(x10, MemOperand(x13));
-}
-
-
-void FullCodeGenerator::ClearPendingMessage() {
- DCHECK(!result_register().is(x10));
- ExternalReference pending_message_obj =
- ExternalReference::address_of_pending_message_obj(isolate());
- __ LoadRoot(x10, Heap::kTheHoleValueRootIndex);
- __ Mov(x13, pending_message_obj);
- __ Str(x10, MemOperand(x13));
-}
-
-
-void FullCodeGenerator::DeferredCommands::EmitCommands() {
- __ Pop(result_register(), x1); // Restore the accumulator and get the token.
- for (DeferredCommand cmd : commands_) {
- Label skip;
- __ Cmp(x1, Operand(Smi::FromInt(cmd.token)));
- __ B(ne, &skip);
- switch (cmd.command) {
- case kReturn:
- codegen_->EmitUnwindAndReturn();
- break;
- case kThrow:
- __ Push(result_register());
- __ CallRuntime(Runtime::kReThrow);
- break;
- case kContinue:
- codegen_->EmitContinue(cmd.target);
- break;
- case kBreak:
- codegen_->EmitBreak(cmd.target);
- break;
- }
- __ bind(&skip);
- }
-}
-
#undef __