| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 14e3df61d10a867966d0f69c945263a4fb8f73bb..08686e37c9781d1e97c359b25fdd8eda5c353892 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -182,20 +182,22 @@ void FullCodeGenerator::Generate() {
|
| if (heap_slots > 0) {
|
| Comment cmnt(masm_, "[ Allocate context");
|
| // Argument to NewContext is the function, which is still in edi.
|
| - __ push(edi);
|
| if (FLAG_harmony_scoping && info->scope()->is_global_scope()) {
|
| + __ push(edi);
|
| __ Push(info->scope()->GetScopeInfo());
|
| __ CallRuntime(Runtime::kNewGlobalContext, 2);
|
| } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
|
| FastNewContextStub stub(heap_slots);
|
| __ CallStub(&stub);
|
| } else {
|
| + __ push(edi);
|
| __ CallRuntime(Runtime::kNewFunctionContext, 1);
|
| }
|
| function_in_register = false;
|
| - // Context is returned in both eax and esi. It replaces the context
|
| - // passed to us. It's saved in the stack and kept live in esi.
|
| - __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi);
|
| + // Context is returned in eax. It replaces the context passed to us.
|
| + // It's saved in the stack and kept live in esi.
|
| + __ mov(esi, eax);
|
| + __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax);
|
|
|
| // Copy parameters into context if necessary.
|
| int num_parameters = info->scope()->num_parameters();
|
| @@ -2673,10 +2675,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 arguments.
|
| @@ -2711,12 +2712,14 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
|
| context()->DropAndPlug(1, eax);
|
|
|
| - } else if (proxy != NULL && proxy->var()->IsUnallocated()) {
|
| + } else if (call_type == Call::GLOBAL_CALL) {
|
| // Push global object as receiver for the call IC.
|
| __ push(GlobalObjectOperand());
|
| + 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());
|
| // Generate code for loading from variables potentially shadowed by
|
| @@ -2750,7 +2753,8 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| // 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());
|
| }
|
| @@ -2763,6 +2767,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
|
| }
|
|
|
| } else {
|
| + ASSERT(call_type == Call::OTHER_CALL);
|
| // Call to an arbitrary expression not handled specially above.
|
| { PreservePositionScope scope(masm()->positions_recorder());
|
| VisitForStackValue(callee);
|
| @@ -3633,21 +3638,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(edx);
|
| - 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(edx);
|
| + StringAddStub stub(STRING_ADD_CHECK_BOTH, NOT_TENURED);
|
| + __ CallStub(&stub);
|
| context()->Plug(eax);
|
| }
|
|
|
|
|