| Index: src/arm/full-codegen-arm.cc
|
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
|
| index b787f69c50cb3a79bda22b3cd27de0dcb8c5ff03..2c9b2756ed6683b7a704c6e27b3d803d8b00eb98 100644
|
| --- a/src/arm/full-codegen-arm.cc
|
| +++ b/src/arm/full-codegen-arm.cc
|
| @@ -202,20 +202,22 @@ void FullCodeGenerator::Generate() {
|
| if (heap_slots > 0) {
|
| // Argument to NewContext is the function, which is still in r1.
|
| Comment cmnt(masm_, "[ Allocate context");
|
| - __ push(r1);
|
| if (FLAG_harmony_scoping && info->scope()->is_global_scope()) {
|
| + __ push(r1);
|
| __ Push(info->scope()->GetScopeInfo());
|
| __ CallRuntime(Runtime::kNewGlobalContext, 2);
|
| } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
|
| FastNewContextStub stub(heap_slots);
|
| __ CallStub(&stub);
|
| } else {
|
| + __ push(r1);
|
| __ CallRuntime(Runtime::kNewFunctionContext, 1);
|
| }
|
| function_in_register = false;
|
| - // Context is returned in both r0 and cp. It replaces the context
|
| - // passed to us. It's saved in the stack and kept live in cp.
|
| - __ str(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| + // Context is returned in r0. It replaces the context passed to us.
|
| + // It's saved in the stack and kept live in cp.
|
| + __ mov(cp, r0);
|
| + __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| // Copy any necessary parameters into the context.
|
| int num_parameters = info->scope()->num_parameters();
|
| for (int i = 0; i < num_parameters; i++) {
|
| @@ -2721,10 +2723,9 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
|
|
| Comment cmnt(masm_, "[ Call");
|
| Expression* callee = expr->expression();
|
| - VariableProxy* proxy = callee->AsVariableProxy();
|
| - Property* property = callee->AsProperty();
|
| + Call::CallType call_type = expr->GetCallType(isolate());
|
|
|
| - if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) {
|
| + if (call_type == Call::POSSIBLY_EVAL_CALL) {
|
| // In a call to eval, we first call %ResolvePossiblyDirectEval to
|
| // resolve the function we need to call and the receiver of the
|
| // call. Then we call the resolved function using the given
|
| @@ -2763,13 +2764,15 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| // Restore context register.
|
| __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| context()->DropAndPlug(1, r0);
|
| - } else if (proxy != NULL && proxy->var()->IsUnallocated()) {
|
| + } else if (call_type == Call::GLOBAL_CALL) {
|
| // Push global object as receiver for the call IC.
|
| __ ldr(r0, GlobalObjectOperand());
|
| __ push(r0);
|
| + VariableProxy* proxy = callee->AsVariableProxy();
|
| EmitCallWithIC(expr, proxy->name(), CONTEXTUAL);
|
| - } else if (proxy != NULL && proxy->var()->IsLookupSlot()) {
|
| + } else if (call_type == Call::LOOKUP_SLOT_CALL) {
|
| // Call to a lookup slot (dynamically introduced variable).
|
| + VariableProxy* proxy = callee->AsVariableProxy();
|
| Label slow, done;
|
|
|
| { PreservePositionScope scope(masm()->positions_recorder());
|
| @@ -2806,7 +2809,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| // The receiver is either the global receiver or an object found
|
| // by LoadContextSlot.
|
| EmitCallWithStub(expr);
|
| - } else if (property != NULL) {
|
| + } else if (call_type == Call::PROPERTY_CALL) {
|
| + Property* property = callee->AsProperty();
|
| { PreservePositionScope scope(masm()->positions_recorder());
|
| VisitForStackValue(property->obj());
|
| }
|
| @@ -2818,6 +2822,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| EmitKeyedCallWithIC(expr, property->key());
|
| }
|
| } else {
|
| + ASSERT(call_type == Call::OTHER_CALL);
|
| // Call to an arbitrary expression not handled specially above.
|
| { PreservePositionScope scope(masm()->positions_recorder());
|
| VisitForStackValue(callee);
|
| @@ -3671,21 +3676,12 @@ void FullCodeGenerator::EmitStringCharAt(CallRuntime* expr) {
|
| void FullCodeGenerator::EmitStringAdd(CallRuntime* expr) {
|
| ZoneList<Expression*>* args = expr->arguments();
|
| ASSERT_EQ(2, args->length());
|
| + VisitForStackValue(args->at(0));
|
| + VisitForAccumulatorValue(args->at(1));
|
|
|
| - if (FLAG_new_string_add) {
|
| - VisitForStackValue(args->at(0));
|
| - VisitForAccumulatorValue(args->at(1));
|
| -
|
| - __ pop(r1);
|
| - NewStringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED);
|
| - __ CallStub(&stub);
|
| - } else {
|
| - VisitForStackValue(args->at(0));
|
| - VisitForStackValue(args->at(1));
|
| -
|
| - StringAddStub stub(STRING_ADD_CHECK_BOTH);
|
| - __ CallStub(&stub);
|
| - }
|
| + __ pop(r1);
|
| + StringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED);
|
| + __ CallStub(&stub);
|
| context()->Plug(r0);
|
| }
|
|
|
|
|