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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 4939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4950 __ j(no_overflow, &done, Label::kNear); | 4950 __ j(no_overflow, &done, Label::kNear); |
4951 // Call stub. Undo operation first. | 4951 // Call stub. Undo operation first. |
4952 if (expr->op() == Token::INC) { | 4952 if (expr->op() == Token::INC) { |
4953 __ sub(eax, Immediate(Smi::FromInt(1))); | 4953 __ sub(eax, Immediate(Smi::FromInt(1))); |
4954 } else { | 4954 } else { |
4955 __ add(eax, Immediate(Smi::FromInt(1))); | 4955 __ add(eax, Immediate(Smi::FromInt(1))); |
4956 } | 4956 } |
4957 __ jmp(&stub_call, Label::kNear); | 4957 __ jmp(&stub_call, Label::kNear); |
4958 __ bind(&slow); | 4958 __ bind(&slow); |
4959 } | 4959 } |
4960 ToNumberStub convert_stub(isolate()); | 4960 if (!is_strong(language_mode())) { |
4961 __ CallStub(&convert_stub); | 4961 ToNumberStub convert_stub(isolate()); |
4962 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 4962 __ CallStub(&convert_stub); |
| 4963 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 4964 } |
4963 | 4965 |
4964 // Save result for postfix expressions. | 4966 // Save result for postfix expressions. |
4965 if (expr->is_postfix()) { | 4967 if (expr->is_postfix()) { |
4966 if (!context()->IsEffect()) { | 4968 if (!context()->IsEffect()) { |
4967 // Save the result on the stack. If we have a named or keyed property | 4969 // Save the result on the stack. If we have a named or keyed property |
4968 // we store the result under the receiver that is currently on top | 4970 // we store the result under the receiver that is currently on top |
4969 // of the stack. | 4971 // of the stack. |
4970 switch (assign_type) { | 4972 switch (assign_type) { |
4971 case VARIABLE: | 4973 case VARIABLE: |
4972 __ push(eax); | 4974 __ push(eax); |
(...skipping 20 matching lines...) Expand all Loading... |
4993 // Call stub for +1/-1. | 4995 // Call stub for +1/-1. |
4994 __ bind(&stub_call); | 4996 __ bind(&stub_call); |
4995 __ mov(edx, eax); | 4997 __ mov(edx, eax); |
4996 __ mov(eax, Immediate(Smi::FromInt(1))); | 4998 __ mov(eax, Immediate(Smi::FromInt(1))); |
4997 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), expr->binary_op(), | 4999 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), expr->binary_op(), |
4998 strength(language_mode())).code(); | 5000 strength(language_mode())).code(); |
4999 CallIC(code, expr->CountBinOpFeedbackId()); | 5001 CallIC(code, expr->CountBinOpFeedbackId()); |
5000 patch_site.EmitPatchInfo(); | 5002 patch_site.EmitPatchInfo(); |
5001 __ bind(&done); | 5003 __ bind(&done); |
5002 | 5004 |
| 5005 if (is_strong(language_mode())) { |
| 5006 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 5007 } |
5003 // Store the value returned in eax. | 5008 // Store the value returned in eax. |
5004 switch (assign_type) { | 5009 switch (assign_type) { |
5005 case VARIABLE: | 5010 case VARIABLE: |
5006 if (expr->is_postfix()) { | 5011 if (expr->is_postfix()) { |
5007 // Perform the assignment as if via '='. | 5012 // Perform the assignment as if via '='. |
5008 { EffectContext context(this); | 5013 { EffectContext context(this); |
5009 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), | 5014 EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
5010 Token::ASSIGN, expr->CountSlot()); | 5015 Token::ASSIGN, expr->CountSlot()); |
5011 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); | 5016 PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
5012 context.Plug(eax); | 5017 context.Plug(eax); |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5494 Assembler::target_address_at(call_target_address, | 5499 Assembler::target_address_at(call_target_address, |
5495 unoptimized_code)); | 5500 unoptimized_code)); |
5496 return OSR_AFTER_STACK_CHECK; | 5501 return OSR_AFTER_STACK_CHECK; |
5497 } | 5502 } |
5498 | 5503 |
5499 | 5504 |
5500 } // namespace internal | 5505 } // namespace internal |
5501 } // namespace v8 | 5506 } // namespace v8 |
5502 | 5507 |
5503 #endif // V8_TARGET_ARCH_IA32 | 5508 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |