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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 __ X87SetFPUCW(0x037F); | 2333 __ X87SetFPUCW(0x037F); |
2334 } | 2334 } |
2335 | 2335 |
2336 | 2336 |
2337 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 2337 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
2338 DCHECK(ToRegister(instr->context()).is(esi)); | 2338 DCHECK(ToRegister(instr->context()).is(esi)); |
2339 DCHECK(ToRegister(instr->left()).is(edx)); | 2339 DCHECK(ToRegister(instr->left()).is(edx)); |
2340 DCHECK(ToRegister(instr->right()).is(eax)); | 2340 DCHECK(ToRegister(instr->right()).is(eax)); |
2341 DCHECK(ToRegister(instr->result()).is(eax)); | 2341 DCHECK(ToRegister(instr->result()).is(eax)); |
2342 | 2342 |
2343 Handle<Code> code = CodeFactory::BinaryOpIC( | 2343 Handle<Code> code = |
2344 isolate(), instr->op(), instr->language_mode()).code(); | 2344 CodeFactory::BinaryOpIC(isolate(), instr->op(), instr->strength()).code(); |
2345 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2345 CallCode(code, RelocInfo::CODE_TARGET, instr); |
2346 } | 2346 } |
2347 | 2347 |
2348 | 2348 |
2349 template<class InstrType> | 2349 template<class InstrType> |
2350 void LCodeGen::EmitBranch(InstrType instr, Condition cc) { | 2350 void LCodeGen::EmitBranch(InstrType instr, Condition cc) { |
2351 int left_block = instr->TrueDestination(chunk_); | 2351 int left_block = instr->TrueDestination(chunk_); |
2352 int right_block = instr->FalseDestination(chunk_); | 2352 int right_block = instr->FalseDestination(chunk_); |
2353 | 2353 |
2354 int next_block = GetNextEmittedBlock(); | 2354 int next_block = GetNextEmittedBlock(); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2766 default: | 2766 default: |
2767 UNREACHABLE(); | 2767 UNREACHABLE(); |
2768 return no_condition; | 2768 return no_condition; |
2769 } | 2769 } |
2770 } | 2770 } |
2771 | 2771 |
2772 | 2772 |
2773 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2773 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
2774 Token::Value op = instr->op(); | 2774 Token::Value op = instr->op(); |
2775 | 2775 |
2776 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op, SLOPPY).code(); | 2776 Handle<Code> ic = |
| 2777 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); |
2777 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2778 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2778 | 2779 |
2779 Condition condition = ComputeCompareCondition(op); | 2780 Condition condition = ComputeCompareCondition(op); |
2780 __ test(eax, Operand(eax)); | 2781 __ test(eax, Operand(eax)); |
2781 | 2782 |
2782 EmitBranch(instr, condition); | 2783 EmitBranch(instr, condition); |
2783 } | 2784 } |
2784 | 2785 |
2785 | 2786 |
2786 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { | 2787 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3039 | 3040 |
3040 // Put the result value into the eax slot and restore all registers. | 3041 // Put the result value into the eax slot and restore all registers. |
3041 __ StoreToSafepointRegisterSlot(eax, eax); | 3042 __ StoreToSafepointRegisterSlot(eax, eax); |
3042 } | 3043 } |
3043 | 3044 |
3044 | 3045 |
3045 void LCodeGen::DoCmpT(LCmpT* instr) { | 3046 void LCodeGen::DoCmpT(LCmpT* instr) { |
3046 Token::Value op = instr->op(); | 3047 Token::Value op = instr->op(); |
3047 | 3048 |
3048 Handle<Code> ic = | 3049 Handle<Code> ic = |
3049 CodeFactory::CompareIC(isolate(), op, instr->language_mode()).code(); | 3050 CodeFactory::CompareIC(isolate(), op, instr->strength()).code(); |
3050 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3051 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3051 | 3052 |
3052 Condition condition = ComputeCompareCondition(op); | 3053 Condition condition = ComputeCompareCondition(op); |
3053 Label true_value, done; | 3054 Label true_value, done; |
3054 __ test(eax, Operand(eax)); | 3055 __ test(eax, Operand(eax)); |
3055 __ j(condition, &true_value, Label::kNear); | 3056 __ j(condition, &true_value, Label::kNear); |
3056 __ mov(ToRegister(instr->result()), factory()->false_value()); | 3057 __ mov(ToRegister(instr->result()), factory()->false_value()); |
3057 __ jmp(&done, Label::kNear); | 3058 __ jmp(&done, Label::kNear); |
3058 __ bind(&true_value); | 3059 __ bind(&true_value); |
3059 __ mov(ToRegister(instr->result()), factory()->true_value()); | 3060 __ mov(ToRegister(instr->result()), factory()->true_value()); |
(...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6443 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6444 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6444 } | 6445 } |
6445 | 6446 |
6446 | 6447 |
6447 #undef __ | 6448 #undef __ |
6448 | 6449 |
6449 } // namespace internal | 6450 } // namespace internal |
6450 } // namespace v8 | 6451 } // namespace v8 |
6451 | 6452 |
6452 #endif // V8_TARGET_ARCH_X87 | 6453 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |