| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 3567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3578 __ j(no_overflow, &done, Label::kNear); | 3578 __ j(no_overflow, &done, Label::kNear); |
| 3579 // Call stub. Undo operation first. | 3579 // Call stub. Undo operation first. |
| 3580 if (expr->op() == Token::INC) { | 3580 if (expr->op() == Token::INC) { |
| 3581 __ sub(eax, Immediate(Smi::FromInt(1))); | 3581 __ sub(eax, Immediate(Smi::FromInt(1))); |
| 3582 } else { | 3582 } else { |
| 3583 __ add(eax, Immediate(Smi::FromInt(1))); | 3583 __ add(eax, Immediate(Smi::FromInt(1))); |
| 3584 } | 3584 } |
| 3585 __ jmp(&stub_call, Label::kNear); | 3585 __ jmp(&stub_call, Label::kNear); |
| 3586 __ bind(&slow); | 3586 __ bind(&slow); |
| 3587 } | 3587 } |
| 3588 if (!is_strong(language_mode())) { | 3588 |
| 3589 ToNumberStub convert_stub(isolate()); | 3589 // Convert old value into a number. |
| 3590 __ CallStub(&convert_stub); | 3590 ToNumberStub convert_stub(isolate()); |
| 3591 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 3591 __ CallStub(&convert_stub); |
| 3592 } | 3592 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 3593 | 3593 |
| 3594 // Save result for postfix expressions. | 3594 // Save result for postfix expressions. |
| 3595 if (expr->is_postfix()) { | 3595 if (expr->is_postfix()) { |
| 3596 if (!context()->IsEffect()) { | 3596 if (!context()->IsEffect()) { |
| 3597 // Save the result on the stack. If we have a named or keyed property | 3597 // Save the result on the stack. If we have a named or keyed property |
| 3598 // we store the result under the receiver that is currently on top | 3598 // we store the result under the receiver that is currently on top |
| 3599 // of the stack. | 3599 // of the stack. |
| 3600 switch (assign_type) { | 3600 switch (assign_type) { |
| 3601 case VARIABLE: | 3601 case VARIABLE: |
| 3602 PushOperand(eax); | 3602 PushOperand(eax); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3622 // Call stub for +1/-1. | 3622 // Call stub for +1/-1. |
| 3623 __ bind(&stub_call); | 3623 __ bind(&stub_call); |
| 3624 __ mov(edx, eax); | 3624 __ mov(edx, eax); |
| 3625 __ mov(eax, Immediate(Smi::FromInt(1))); | 3625 __ mov(eax, Immediate(Smi::FromInt(1))); |
| 3626 Handle<Code> code = | 3626 Handle<Code> code = |
| 3627 CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); | 3627 CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); |
| 3628 CallIC(code, expr->CountBinOpFeedbackId()); | 3628 CallIC(code, expr->CountBinOpFeedbackId()); |
| 3629 patch_site.EmitPatchInfo(); | 3629 patch_site.EmitPatchInfo(); |
| 3630 __ bind(&done); | 3630 __ bind(&done); |
| 3631 | 3631 |
| 3632 if (is_strong(language_mode())) { | |
| 3633 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | |
| 3634 } | |
| 3635 // Store the value returned in eax. | 3632 // Store the value returned in eax. |
| 3636 switch (assign_type) { | 3633 switch (assign_type) { |
| 3637 case VARIABLE: | 3634 case VARIABLE: |
| 3638 if (expr->is_postfix()) { | 3635 if (expr->is_postfix()) { |
| 3639 // Perform the assignment as if via '='. | 3636 // Perform the assignment as if via '='. |
| 3640 { EffectContext context(this); | 3637 { EffectContext context(this); |
| 3641 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 3638 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 3642 Token::ASSIGN, expr->CountSlot()); | 3639 Token::ASSIGN, expr->CountSlot()); |
| 3643 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3640 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 3644 context.Plug(eax); | 3641 context.Plug(eax); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4088 Assembler::target_address_at(call_target_address, | 4085 Assembler::target_address_at(call_target_address, |
| 4089 unoptimized_code)); | 4086 unoptimized_code)); |
| 4090 return OSR_AFTER_STACK_CHECK; | 4087 return OSR_AFTER_STACK_CHECK; |
| 4091 } | 4088 } |
| 4092 | 4089 |
| 4093 | 4090 |
| 4094 } // namespace internal | 4091 } // namespace internal |
| 4095 } // namespace v8 | 4092 } // namespace v8 |
| 4096 | 4093 |
| 4097 #endif // V8_TARGET_ARCH_X87 | 4094 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |