| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3573 if (expr->op() == Token::INC) { | 3573 if (expr->op() == Token::INC) { |
| 3574 __ SmiAddConstant(rax, rax, Smi::FromInt(1), constraints, &done, | 3574 __ SmiAddConstant(rax, rax, Smi::FromInt(1), constraints, &done, |
| 3575 Label::kNear); | 3575 Label::kNear); |
| 3576 } else { | 3576 } else { |
| 3577 __ SmiSubConstant(rax, rax, Smi::FromInt(1), constraints, &done, | 3577 __ SmiSubConstant(rax, rax, Smi::FromInt(1), constraints, &done, |
| 3578 Label::kNear); | 3578 Label::kNear); |
| 3579 } | 3579 } |
| 3580 __ jmp(&stub_call, Label::kNear); | 3580 __ jmp(&stub_call, Label::kNear); |
| 3581 __ bind(&slow); | 3581 __ bind(&slow); |
| 3582 } | 3582 } |
| 3583 if (!is_strong(language_mode())) { | 3583 |
| 3584 ToNumberStub convert_stub(isolate()); | 3584 // Convert old value into a number. |
| 3585 __ CallStub(&convert_stub); | 3585 ToNumberStub convert_stub(isolate()); |
| 3586 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 3586 __ CallStub(&convert_stub); |
| 3587 } | 3587 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 3588 | 3588 |
| 3589 // Save result for postfix expressions. | 3589 // Save result for postfix expressions. |
| 3590 if (expr->is_postfix()) { | 3590 if (expr->is_postfix()) { |
| 3591 if (!context()->IsEffect()) { | 3591 if (!context()->IsEffect()) { |
| 3592 // Save the result on the stack. If we have a named or keyed property | 3592 // Save the result on the stack. If we have a named or keyed property |
| 3593 // we store the result under the receiver that is currently on top | 3593 // we store the result under the receiver that is currently on top |
| 3594 // of the stack. | 3594 // of the stack. |
| 3595 switch (assign_type) { | 3595 switch (assign_type) { |
| 3596 case VARIABLE: | 3596 case VARIABLE: |
| 3597 PushOperand(rax); | 3597 PushOperand(rax); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3617 // Call stub for +1/-1. | 3617 // Call stub for +1/-1. |
| 3618 __ bind(&stub_call); | 3618 __ bind(&stub_call); |
| 3619 __ movp(rdx, rax); | 3619 __ movp(rdx, rax); |
| 3620 __ Move(rax, Smi::FromInt(1)); | 3620 __ Move(rax, Smi::FromInt(1)); |
| 3621 Handle<Code> code = | 3621 Handle<Code> code = |
| 3622 CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); | 3622 CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); |
| 3623 CallIC(code, expr->CountBinOpFeedbackId()); | 3623 CallIC(code, expr->CountBinOpFeedbackId()); |
| 3624 patch_site.EmitPatchInfo(); | 3624 patch_site.EmitPatchInfo(); |
| 3625 __ bind(&done); | 3625 __ bind(&done); |
| 3626 | 3626 |
| 3627 if (is_strong(language_mode())) { | |
| 3628 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | |
| 3629 } | |
| 3630 // Store the value returned in rax. | 3627 // Store the value returned in rax. |
| 3631 switch (assign_type) { | 3628 switch (assign_type) { |
| 3632 case VARIABLE: | 3629 case VARIABLE: |
| 3633 if (expr->is_postfix()) { | 3630 if (expr->is_postfix()) { |
| 3634 // Perform the assignment as if via '='. | 3631 // Perform the assignment as if via '='. |
| 3635 { EffectContext context(this); | 3632 { EffectContext context(this); |
| 3636 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 3633 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 3637 Token::ASSIGN, expr->CountSlot()); | 3634 Token::ASSIGN, expr->CountSlot()); |
| 3638 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3635 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 3639 context.Plug(rax); | 3636 context.Plug(rax); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4082 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4079 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4083 Assembler::target_address_at(call_target_address, | 4080 Assembler::target_address_at(call_target_address, |
| 4084 unoptimized_code)); | 4081 unoptimized_code)); |
| 4085 return OSR_AFTER_STACK_CHECK; | 4082 return OSR_AFTER_STACK_CHECK; |
| 4086 } | 4083 } |
| 4087 | 4084 |
| 4088 } // namespace internal | 4085 } // namespace internal |
| 4089 } // namespace v8 | 4086 } // namespace v8 |
| 4090 | 4087 |
| 4091 #endif // V8_TARGET_ARCH_X64 | 4088 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |