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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 } | 1902 } |
1903 } | 1903 } |
1904 | 1904 |
1905 | 1905 |
1906 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 1906 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
1907 DCHECK(ToRegister(instr->context()).is(esi)); | 1907 DCHECK(ToRegister(instr->context()).is(esi)); |
1908 DCHECK(ToRegister(instr->left()).is(edx)); | 1908 DCHECK(ToRegister(instr->left()).is(edx)); |
1909 DCHECK(ToRegister(instr->right()).is(eax)); | 1909 DCHECK(ToRegister(instr->right()).is(eax)); |
1910 DCHECK(ToRegister(instr->result()).is(eax)); | 1910 DCHECK(ToRegister(instr->result()).is(eax)); |
1911 | 1911 |
1912 Handle<Code> code = | 1912 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), instr->op()).code(); |
1913 CodeFactory::BinaryOpIC(isolate(), instr->op(), instr->strength()).code(); | |
1914 CallCode(code, RelocInfo::CODE_TARGET, instr); | 1913 CallCode(code, RelocInfo::CODE_TARGET, instr); |
1915 } | 1914 } |
1916 | 1915 |
1917 | 1916 |
1918 template<class InstrType> | 1917 template<class InstrType> |
1919 void LCodeGen::EmitBranch(InstrType instr, Condition cc) { | 1918 void LCodeGen::EmitBranch(InstrType instr, Condition cc) { |
1920 int left_block = instr->TrueDestination(chunk_); | 1919 int left_block = instr->TrueDestination(chunk_); |
1921 int right_block = instr->FalseDestination(chunk_); | 1920 int right_block = instr->FalseDestination(chunk_); |
1922 | 1921 |
1923 int next_block = GetNextEmittedBlock(); | 1922 int next_block = GetNextEmittedBlock(); |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 __ cmp(object_prototype, factory()->null_value()); | 2467 __ cmp(object_prototype, factory()->null_value()); |
2469 EmitFalseBranch(instr, equal); | 2468 EmitFalseBranch(instr, equal); |
2470 __ mov(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); | 2469 __ mov(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); |
2471 __ jmp(&loop); | 2470 __ jmp(&loop); |
2472 } | 2471 } |
2473 | 2472 |
2474 | 2473 |
2475 void LCodeGen::DoCmpT(LCmpT* instr) { | 2474 void LCodeGen::DoCmpT(LCmpT* instr) { |
2476 Token::Value op = instr->op(); | 2475 Token::Value op = instr->op(); |
2477 | 2476 |
2478 Handle<Code> ic = | 2477 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); |
2479 CodeFactory::CompareIC(isolate(), op, instr->strength()).code(); | |
2480 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2478 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2481 | 2479 |
2482 Condition condition = ComputeCompareCondition(op); | 2480 Condition condition = ComputeCompareCondition(op); |
2483 Label true_value, done; | 2481 Label true_value, done; |
2484 __ test(eax, Operand(eax)); | 2482 __ test(eax, Operand(eax)); |
2485 __ j(condition, &true_value, Label::kNear); | 2483 __ j(condition, &true_value, Label::kNear); |
2486 __ mov(ToRegister(instr->result()), factory()->false_value()); | 2484 __ mov(ToRegister(instr->result()), factory()->false_value()); |
2487 __ jmp(&done, Label::kNear); | 2485 __ jmp(&done, Label::kNear); |
2488 __ bind(&true_value); | 2486 __ bind(&true_value); |
2489 __ mov(ToRegister(instr->result()), factory()->true_value()); | 2487 __ mov(ToRegister(instr->result()), factory()->true_value()); |
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5424 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5422 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5425 } | 5423 } |
5426 | 5424 |
5427 | 5425 |
5428 #undef __ | 5426 #undef __ |
5429 | 5427 |
5430 } // namespace internal | 5428 } // namespace internal |
5431 } // namespace v8 | 5429 } // namespace v8 |
5432 | 5430 |
5433 #endif // V8_TARGET_ARCH_IA32 | 5431 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |