| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
| 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 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2179 __ X87SetFPUCW(0x037F); | 2179 __ X87SetFPUCW(0x037F); |
| 2180 } | 2180 } |
| 2181 | 2181 |
| 2182 | 2182 |
| 2183 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 2183 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
| 2184 DCHECK(ToRegister(instr->context()).is(esi)); | 2184 DCHECK(ToRegister(instr->context()).is(esi)); |
| 2185 DCHECK(ToRegister(instr->left()).is(edx)); | 2185 DCHECK(ToRegister(instr->left()).is(edx)); |
| 2186 DCHECK(ToRegister(instr->right()).is(eax)); | 2186 DCHECK(ToRegister(instr->right()).is(eax)); |
| 2187 DCHECK(ToRegister(instr->result()).is(eax)); | 2187 DCHECK(ToRegister(instr->result()).is(eax)); |
| 2188 | 2188 |
| 2189 Handle<Code> code = | 2189 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), instr->op()).code(); |
| 2190 CodeFactory::BinaryOpIC(isolate(), instr->op(), instr->strength()).code(); | |
| 2191 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2190 CallCode(code, RelocInfo::CODE_TARGET, instr); |
| 2192 } | 2191 } |
| 2193 | 2192 |
| 2194 | 2193 |
| 2195 template<class InstrType> | 2194 template<class InstrType> |
| 2196 void LCodeGen::EmitBranch(InstrType instr, Condition cc) { | 2195 void LCodeGen::EmitBranch(InstrType instr, Condition cc) { |
| 2197 int left_block = instr->TrueDestination(chunk_); | 2196 int left_block = instr->TrueDestination(chunk_); |
| 2198 int right_block = instr->FalseDestination(chunk_); | 2197 int right_block = instr->FalseDestination(chunk_); |
| 2199 | 2198 |
| 2200 int next_block = GetNextEmittedBlock(); | 2199 int next_block = GetNextEmittedBlock(); |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2756 __ cmp(object_prototype, factory()->null_value()); | 2755 __ cmp(object_prototype, factory()->null_value()); |
| 2757 EmitFalseBranch(instr, equal); | 2756 EmitFalseBranch(instr, equal); |
| 2758 __ mov(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); | 2757 __ mov(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); |
| 2759 __ jmp(&loop); | 2758 __ jmp(&loop); |
| 2760 } | 2759 } |
| 2761 | 2760 |
| 2762 | 2761 |
| 2763 void LCodeGen::DoCmpT(LCmpT* instr) { | 2762 void LCodeGen::DoCmpT(LCmpT* instr) { |
| 2764 Token::Value op = instr->op(); | 2763 Token::Value op = instr->op(); |
| 2765 | 2764 |
| 2766 Handle<Code> ic = | 2765 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); |
| 2767 CodeFactory::CompareIC(isolate(), op, instr->strength()).code(); | |
| 2768 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2766 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2769 | 2767 |
| 2770 Condition condition = ComputeCompareCondition(op); | 2768 Condition condition = ComputeCompareCondition(op); |
| 2771 Label true_value, done; | 2769 Label true_value, done; |
| 2772 __ test(eax, Operand(eax)); | 2770 __ test(eax, Operand(eax)); |
| 2773 __ j(condition, &true_value, Label::kNear); | 2771 __ j(condition, &true_value, Label::kNear); |
| 2774 __ mov(ToRegister(instr->result()), factory()->false_value()); | 2772 __ mov(ToRegister(instr->result()), factory()->false_value()); |
| 2775 __ jmp(&done, Label::kNear); | 2773 __ jmp(&done, Label::kNear); |
| 2776 __ bind(&true_value); | 2774 __ bind(&true_value); |
| 2777 __ mov(ToRegister(instr->result()), factory()->true_value()); | 2775 __ mov(ToRegister(instr->result()), factory()->true_value()); |
| (...skipping 3212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5990 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5988 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5991 } | 5989 } |
| 5992 | 5990 |
| 5993 | 5991 |
| 5994 #undef __ | 5992 #undef __ |
| 5995 | 5993 |
| 5996 } // namespace internal | 5994 } // namespace internal |
| 5997 } // namespace v8 | 5995 } // namespace v8 |
| 5998 | 5996 |
| 5999 #endif // V8_TARGET_ARCH_X87 | 5997 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |