| Index: src/x87/full-codegen-x87.cc
|
| diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
|
| index bb1bbbfaf686d19422643f2529832d4892e65d8f..1e6a88c97ec185b202ce1064b83681e797ae6251 100644
|
| --- a/src/x87/full-codegen-x87.cc
|
| +++ b/src/x87/full-codegen-x87.cc
|
| @@ -465,11 +465,30 @@
|
| }
|
|
|
|
|
| +void FullCodeGenerator::EffectContext::Plug(Variable* var) const {
|
| + DCHECK(var->IsStackAllocated() || var->IsContextSlot());
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::AccumulatorValueContext::Plug(Variable* var) const {
|
| + DCHECK(var->IsStackAllocated() || var->IsContextSlot());
|
| + codegen()->GetVar(result_register(), var);
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::StackValueContext::Plug(Variable* var) const {
|
| DCHECK(var->IsStackAllocated() || var->IsContextSlot());
|
| MemOperand operand = codegen()->VarOperand(var, result_register());
|
| // Memory operands can be pushed directly.
|
| __ push(operand);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::TestContext::Plug(Variable* var) const {
|
| + // For simplicity we always test the accumulator register.
|
| + codegen()->GetVar(result_register(), var);
|
| + codegen()->PrepareForBailoutBeforeSplit(condition(), false, NULL, NULL);
|
| + codegen()->DoTest(this);
|
| }
|
|
|
|
|
| @@ -620,6 +639,10 @@
|
| Label* materialize_false) const {
|
| DCHECK(materialize_true == true_label_);
|
| DCHECK(materialize_false == false_label_);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::EffectContext::Plug(bool flag) const {
|
| }
|
|
|
|
|
| @@ -876,6 +899,35 @@
|
| break;
|
| }
|
| }
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) {
|
| + VariableProxy* proxy = declaration->proxy();
|
| + Variable* variable = proxy->var();
|
| + switch (variable->location()) {
|
| + case VariableLocation::GLOBAL:
|
| + case VariableLocation::UNALLOCATED:
|
| + // TODO(rossberg)
|
| + break;
|
| +
|
| + case VariableLocation::CONTEXT: {
|
| + Comment cmnt(masm_, "[ ImportDeclaration");
|
| + EmitDebugCheckDeclarationContext(variable);
|
| + // TODO(rossberg)
|
| + break;
|
| + }
|
| +
|
| + case VariableLocation::PARAMETER:
|
| + case VariableLocation::LOCAL:
|
| + case VariableLocation::LOOKUP:
|
| + UNREACHABLE();
|
| + }
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::VisitExportDeclaration(ExportDeclaration* declaration) {
|
| + // TODO(rossberg)
|
| }
|
|
|
|
|
| @@ -1192,6 +1244,12 @@
|
| __ CallRuntime(Runtime::kNewClosure, 3);
|
| }
|
| context()->Plug(eax);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
|
| + Comment cmnt(masm_, "[ VariableProxy");
|
| + EmitVariableLoad(expr);
|
| }
|
|
|
|
|
| @@ -3730,6 +3788,33 @@
|
| }
|
|
|
|
|
| +void FullCodeGenerator::EmitSubString(CallRuntime* expr) {
|
| + // Load the arguments on the stack and call the stub.
|
| + SubStringStub stub(isolate());
|
| + ZoneList<Expression*>* args = expr->arguments();
|
| + DCHECK(args->length() == 3);
|
| + VisitForStackValue(args->at(0));
|
| + VisitForStackValue(args->at(1));
|
| + VisitForStackValue(args->at(2));
|
| + __ CallStub(&stub);
|
| + context()->Plug(eax);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::EmitRegExpExec(CallRuntime* expr) {
|
| + // Load the arguments on the stack and call the stub.
|
| + RegExpExecStub stub(isolate());
|
| + ZoneList<Expression*>* args = expr->arguments();
|
| + DCHECK(args->length() == 4);
|
| + VisitForStackValue(args->at(0));
|
| + VisitForStackValue(args->at(1));
|
| + VisitForStackValue(args->at(2));
|
| + VisitForStackValue(args->at(3));
|
| + __ CallStub(&stub);
|
| + context()->Plug(eax);
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::EmitValueOf(CallRuntime* expr) {
|
| ZoneList<Expression*>* args = expr->arguments();
|
| DCHECK(args->length() == 1);
|
| @@ -3877,6 +3962,18 @@
|
| }
|
|
|
|
|
| +void FullCodeGenerator::EmitMathPow(CallRuntime* expr) {
|
| + // Load the arguments on the stack and call the runtime function.
|
| + ZoneList<Expression*>* args = expr->arguments();
|
| + DCHECK(args->length() == 2);
|
| + VisitForStackValue(args->at(0));
|
| + VisitForStackValue(args->at(1));
|
| +
|
| + __ CallRuntime(Runtime::kMathPowSlow, 2);
|
| + context()->Plug(eax);
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) {
|
| ZoneList<Expression*>* args = expr->arguments();
|
| DCHECK(args->length() == 2);
|
| @@ -3902,6 +3999,19 @@
|
| __ RecordWriteField(ebx, JSValue::kValueOffset, edx, ecx, kDontSaveFPRegs);
|
|
|
| __ bind(&done);
|
| + context()->Plug(eax);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) {
|
| + ZoneList<Expression*>* args = expr->arguments();
|
| + DCHECK_EQ(args->length(), 1);
|
| +
|
| + // Load the argument into eax and call the stub.
|
| + VisitForAccumulatorValue(args->at(0));
|
| +
|
| + NumberToStringStub stub(isolate());
|
| + __ CallStub(&stub);
|
| context()->Plug(eax);
|
| }
|
|
|
| @@ -4027,6 +4137,19 @@
|
|
|
| __ pop(edx);
|
| StringAddStub stub(isolate(), STRING_ADD_CHECK_BOTH, NOT_TENURED);
|
| + __ CallStub(&stub);
|
| + context()->Plug(eax);
|
| +}
|
| +
|
| +
|
| +void FullCodeGenerator::EmitStringCompare(CallRuntime* expr) {
|
| + ZoneList<Expression*>* args = expr->arguments();
|
| + DCHECK_EQ(2, args->length());
|
| +
|
| + VisitForStackValue(args->at(0));
|
| + VisitForStackValue(args->at(1));
|
| +
|
| + StringCompareStub stub(isolate());
|
| __ CallStub(&stub);
|
| context()->Plug(eax);
|
| }
|
|
|