| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 3575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3586 __ j(no_overflow, &done, Label::kNear); | 3586 __ j(no_overflow, &done, Label::kNear); |
| 3587 // Call stub. Undo operation first. | 3587 // Call stub. Undo operation first. |
| 3588 if (expr->op() == Token::INC) { | 3588 if (expr->op() == Token::INC) { |
| 3589 __ sub(eax, Immediate(Smi::FromInt(1))); | 3589 __ sub(eax, Immediate(Smi::FromInt(1))); |
| 3590 } else { | 3590 } else { |
| 3591 __ add(eax, Immediate(Smi::FromInt(1))); | 3591 __ add(eax, Immediate(Smi::FromInt(1))); |
| 3592 } | 3592 } |
| 3593 __ jmp(&stub_call, Label::kNear); | 3593 __ jmp(&stub_call, Label::kNear); |
| 3594 __ bind(&slow); | 3594 __ bind(&slow); |
| 3595 } | 3595 } |
| 3596 if (!is_strong(language_mode())) { | 3596 |
| 3597 ToNumberStub convert_stub(isolate()); | 3597 // Convert old value into a number. |
| 3598 __ CallStub(&convert_stub); | 3598 ToNumberStub convert_stub(isolate()); |
| 3599 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 3599 __ CallStub(&convert_stub); |
| 3600 } | 3600 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 3601 | 3601 |
| 3602 // Save result for postfix expressions. | 3602 // Save result for postfix expressions. |
| 3603 if (expr->is_postfix()) { | 3603 if (expr->is_postfix()) { |
| 3604 if (!context()->IsEffect()) { | 3604 if (!context()->IsEffect()) { |
| 3605 // Save the result on the stack. If we have a named or keyed property | 3605 // Save the result on the stack. If we have a named or keyed property |
| 3606 // we store the result under the receiver that is currently on top | 3606 // we store the result under the receiver that is currently on top |
| 3607 // of the stack. | 3607 // of the stack. |
| 3608 switch (assign_type) { | 3608 switch (assign_type) { |
| 3609 case VARIABLE: | 3609 case VARIABLE: |
| 3610 PushOperand(eax); | 3610 PushOperand(eax); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3630 // Call stub for +1/-1. | 3630 // Call stub for +1/-1. |
| 3631 __ bind(&stub_call); | 3631 __ bind(&stub_call); |
| 3632 __ mov(edx, eax); | 3632 __ mov(edx, eax); |
| 3633 __ mov(eax, Immediate(Smi::FromInt(1))); | 3633 __ mov(eax, Immediate(Smi::FromInt(1))); |
| 3634 Handle<Code> code = | 3634 Handle<Code> code = |
| 3635 CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); | 3635 CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); |
| 3636 CallIC(code, expr->CountBinOpFeedbackId()); | 3636 CallIC(code, expr->CountBinOpFeedbackId()); |
| 3637 patch_site.EmitPatchInfo(); | 3637 patch_site.EmitPatchInfo(); |
| 3638 __ bind(&done); | 3638 __ bind(&done); |
| 3639 | 3639 |
| 3640 if (is_strong(language_mode())) { | |
| 3641 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | |
| 3642 } | |
| 3643 // Store the value returned in eax. | 3640 // Store the value returned in eax. |
| 3644 switch (assign_type) { | 3641 switch (assign_type) { |
| 3645 case VARIABLE: | 3642 case VARIABLE: |
| 3646 if (expr->is_postfix()) { | 3643 if (expr->is_postfix()) { |
| 3647 // Perform the assignment as if via '='. | 3644 // Perform the assignment as if via '='. |
| 3648 { EffectContext context(this); | 3645 { EffectContext context(this); |
| 3649 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 3646 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 3650 Token::ASSIGN, expr->CountSlot()); | 3647 Token::ASSIGN, expr->CountSlot()); |
| 3651 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3648 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 3652 context.Plug(eax); | 3649 context.Plug(eax); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4096 Assembler::target_address_at(call_target_address, | 4093 Assembler::target_address_at(call_target_address, |
| 4097 unoptimized_code)); | 4094 unoptimized_code)); |
| 4098 return OSR_AFTER_STACK_CHECK; | 4095 return OSR_AFTER_STACK_CHECK; |
| 4099 } | 4096 } |
| 4100 | 4097 |
| 4101 | 4098 |
| 4102 } // namespace internal | 4099 } // namespace internal |
| 4103 } // namespace v8 | 4100 } // namespace v8 |
| 4104 | 4101 |
| 4105 #endif // V8_TARGET_ARCH_IA32 | 4102 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |