| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 3678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3689 Register scratch1 = r4; | 3689 Register scratch1 = r4; |
| 3690 Register scratch2 = r5; | 3690 Register scratch2 = r5; |
| 3691 __ LoadSmiLiteral(scratch1, Smi::FromInt(count_value)); | 3691 __ LoadSmiLiteral(scratch1, Smi::FromInt(count_value)); |
| 3692 __ AddAndCheckForOverflow(r3, r3, scratch1, scratch2, r0); | 3692 __ AddAndCheckForOverflow(r3, r3, scratch1, scratch2, r0); |
| 3693 __ BranchOnNoOverflow(&done); | 3693 __ BranchOnNoOverflow(&done); |
| 3694 // Call stub. Undo operation first. | 3694 // Call stub. Undo operation first. |
| 3695 __ sub(r3, r3, scratch1); | 3695 __ sub(r3, r3, scratch1); |
| 3696 __ b(&stub_call); | 3696 __ b(&stub_call); |
| 3697 __ bind(&slow); | 3697 __ bind(&slow); |
| 3698 } | 3698 } |
| 3699 if (!is_strong(language_mode())) { | 3699 |
| 3700 ToNumberStub convert_stub(isolate()); | 3700 // Convert old value into a number. |
| 3701 __ CallStub(&convert_stub); | 3701 ToNumberStub convert_stub(isolate()); |
| 3702 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 3702 __ CallStub(&convert_stub); |
| 3703 } | 3703 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 3704 | 3704 |
| 3705 // Save result for postfix expressions. | 3705 // Save result for postfix expressions. |
| 3706 if (expr->is_postfix()) { | 3706 if (expr->is_postfix()) { |
| 3707 if (!context()->IsEffect()) { | 3707 if (!context()->IsEffect()) { |
| 3708 // Save the result on the stack. If we have a named or keyed property | 3708 // Save the result on the stack. If we have a named or keyed property |
| 3709 // we store the result under the receiver that is currently on top | 3709 // we store the result under the receiver that is currently on top |
| 3710 // of the stack. | 3710 // of the stack. |
| 3711 switch (assign_type) { | 3711 switch (assign_type) { |
| 3712 case VARIABLE: | 3712 case VARIABLE: |
| 3713 PushOperand(r3); | 3713 PushOperand(r3); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3732 __ mr(r4, r3); | 3732 __ mr(r4, r3); |
| 3733 __ LoadSmiLiteral(r3, Smi::FromInt(count_value)); | 3733 __ LoadSmiLiteral(r3, Smi::FromInt(count_value)); |
| 3734 | 3734 |
| 3735 SetExpressionPosition(expr); | 3735 SetExpressionPosition(expr); |
| 3736 | 3736 |
| 3737 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); | 3737 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); |
| 3738 CallIC(code, expr->CountBinOpFeedbackId()); | 3738 CallIC(code, expr->CountBinOpFeedbackId()); |
| 3739 patch_site.EmitPatchInfo(); | 3739 patch_site.EmitPatchInfo(); |
| 3740 __ bind(&done); | 3740 __ bind(&done); |
| 3741 | 3741 |
| 3742 if (is_strong(language_mode())) { | |
| 3743 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | |
| 3744 } | |
| 3745 // Store the value returned in r3. | 3742 // Store the value returned in r3. |
| 3746 switch (assign_type) { | 3743 switch (assign_type) { |
| 3747 case VARIABLE: | 3744 case VARIABLE: |
| 3748 if (expr->is_postfix()) { | 3745 if (expr->is_postfix()) { |
| 3749 { | 3746 { |
| 3750 EffectContext context(this); | 3747 EffectContext context(this); |
| 3751 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 3748 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 3752 Token::ASSIGN, expr->CountSlot()); | 3749 Token::ASSIGN, expr->CountSlot()); |
| 3753 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 3750 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 3754 context.Plug(r3); | 3751 context.Plug(r3); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4189 return ON_STACK_REPLACEMENT; | 4186 return ON_STACK_REPLACEMENT; |
| 4190 } | 4187 } |
| 4191 | 4188 |
| 4192 DCHECK(interrupt_address == | 4189 DCHECK(interrupt_address == |
| 4193 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4190 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 4194 return OSR_AFTER_STACK_CHECK; | 4191 return OSR_AFTER_STACK_CHECK; |
| 4195 } | 4192 } |
| 4196 } // namespace internal | 4193 } // namespace internal |
| 4197 } // namespace v8 | 4194 } // namespace v8 |
| 4198 #endif // V8_TARGET_ARCH_PPC | 4195 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |