| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 4921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4932 __ j(no_overflow, &done, Label::kNear); | 4932 __ j(no_overflow, &done, Label::kNear); |
| 4933 // Call stub. Undo operation first. | 4933 // Call stub. Undo operation first. |
| 4934 if (expr->op() == Token::INC) { | 4934 if (expr->op() == Token::INC) { |
| 4935 __ sub(eax, Immediate(Smi::FromInt(1))); | 4935 __ sub(eax, Immediate(Smi::FromInt(1))); |
| 4936 } else { | 4936 } else { |
| 4937 __ add(eax, Immediate(Smi::FromInt(1))); | 4937 __ add(eax, Immediate(Smi::FromInt(1))); |
| 4938 } | 4938 } |
| 4939 __ jmp(&stub_call, Label::kNear); | 4939 __ jmp(&stub_call, Label::kNear); |
| 4940 __ bind(&slow); | 4940 __ bind(&slow); |
| 4941 } | 4941 } |
| 4942 ToNumberStub convert_stub(isolate()); | 4942 if (!is_strong(language_mode())) { |
| 4943 __ CallStub(&convert_stub); | 4943 ToNumberStub convert_stub(isolate()); |
| 4944 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 4944 __ CallStub(&convert_stub); |
| 4945 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 4946 } |
| 4945 | 4947 |
| 4946 // Save result for postfix expressions. | 4948 // Save result for postfix expressions. |
| 4947 if (expr->is_postfix()) { | 4949 if (expr->is_postfix()) { |
| 4948 if (!context()->IsEffect()) { | 4950 if (!context()->IsEffect()) { |
| 4949 // Save the result on the stack. If we have a named or keyed property | 4951 // Save the result on the stack. If we have a named or keyed property |
| 4950 // we store the result under the receiver that is currently on top | 4952 // we store the result under the receiver that is currently on top |
| 4951 // of the stack. | 4953 // of the stack. |
| 4952 switch (assign_type) { | 4954 switch (assign_type) { |
| 4953 case VARIABLE: | 4955 case VARIABLE: |
| 4954 __ push(eax); | 4956 __ push(eax); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 4975 // Call stub for +1/-1. | 4977 // Call stub for +1/-1. |
| 4976 __ bind(&stub_call); | 4978 __ bind(&stub_call); |
| 4977 __ mov(edx, eax); | 4979 __ mov(edx, eax); |
| 4978 __ mov(eax, Immediate(Smi::FromInt(1))); | 4980 __ mov(eax, Immediate(Smi::FromInt(1))); |
| 4979 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), expr->binary_op(), | 4981 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), expr->binary_op(), |
| 4980 strength(language_mode())).code(); | 4982 strength(language_mode())).code(); |
| 4981 CallIC(code, expr->CountBinOpFeedbackId()); | 4983 CallIC(code, expr->CountBinOpFeedbackId()); |
| 4982 patch_site.EmitPatchInfo(); | 4984 patch_site.EmitPatchInfo(); |
| 4983 __ bind(&done); | 4985 __ bind(&done); |
| 4984 | 4986 |
| 4987 if (is_strong(language_mode())) { |
| 4988 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 4989 } |
| 4985 // Store the value returned in eax. | 4990 // Store the value returned in eax. |
| 4986 switch (assign_type) { | 4991 switch (assign_type) { |
| 4987 case VARIABLE: | 4992 case VARIABLE: |
| 4988 if (expr->is_postfix()) { | 4993 if (expr->is_postfix()) { |
| 4989 // Perform the assignment as if via '='. | 4994 // Perform the assignment as if via '='. |
| 4990 { EffectContext context(this); | 4995 { EffectContext context(this); |
| 4991 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 4996 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
| 4992 Token::ASSIGN, expr->CountSlot()); | 4997 Token::ASSIGN, expr->CountSlot()); |
| 4993 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 4998 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
| 4994 context.Plug(eax); | 4999 context.Plug(eax); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5476 Assembler::target_address_at(call_target_address, | 5481 Assembler::target_address_at(call_target_address, |
| 5477 unoptimized_code)); | 5482 unoptimized_code)); |
| 5478 return OSR_AFTER_STACK_CHECK; | 5483 return OSR_AFTER_STACK_CHECK; |
| 5479 } | 5484 } |
| 5480 | 5485 |
| 5481 | 5486 |
| 5482 } // namespace internal | 5487 } // namespace internal |
| 5483 } // namespace v8 | 5488 } // namespace v8 |
| 5484 | 5489 |
| 5485 #endif // V8_TARGET_ARCH_X87 | 5490 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |