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 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
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 2141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 } | 2152 } |
2153 } | 2153 } |
2154 | 2154 |
2155 | 2155 |
2156 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 2156 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
2157 DCHECK(ToRegister(instr->context()).is(cp)); | 2157 DCHECK(ToRegister(instr->context()).is(cp)); |
2158 DCHECK(ToRegister(instr->left()).is(r1)); | 2158 DCHECK(ToRegister(instr->left()).is(r1)); |
2159 DCHECK(ToRegister(instr->right()).is(r0)); | 2159 DCHECK(ToRegister(instr->right()).is(r0)); |
2160 DCHECK(ToRegister(instr->result()).is(r0)); | 2160 DCHECK(ToRegister(instr->result()).is(r0)); |
2161 | 2161 |
2162 Handle<Code> code = CodeFactory::BinaryOpIC( | 2162 Handle<Code> code = |
2163 isolate(), instr->op(), instr->language_mode()).code(); | 2163 CodeFactory::BinaryOpIC(isolate(), instr->op(), instr->strength()).code(); |
2164 // Block literal pool emission to ensure nop indicating no inlined smi code | 2164 // Block literal pool emission to ensure nop indicating no inlined smi code |
2165 // is in the correct position. | 2165 // is in the correct position. |
2166 Assembler::BlockConstPoolScope block_const_pool(masm()); | 2166 Assembler::BlockConstPoolScope block_const_pool(masm()); |
2167 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2167 CallCode(code, RelocInfo::CODE_TARGET, instr); |
2168 } | 2168 } |
2169 | 2169 |
2170 | 2170 |
2171 template<class InstrType> | 2171 template<class InstrType> |
2172 void LCodeGen::EmitBranch(InstrType instr, Condition condition) { | 2172 void LCodeGen::EmitBranch(InstrType instr, Condition condition) { |
2173 int left_block = instr->TrueDestination(chunk_); | 2173 int left_block = instr->TrueDestination(chunk_); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2589 UNREACHABLE(); | 2589 UNREACHABLE(); |
2590 return kNoCondition; | 2590 return kNoCondition; |
2591 } | 2591 } |
2592 } | 2592 } |
2593 | 2593 |
2594 | 2594 |
2595 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2595 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
2596 DCHECK(ToRegister(instr->context()).is(cp)); | 2596 DCHECK(ToRegister(instr->context()).is(cp)); |
2597 Token::Value op = instr->op(); | 2597 Token::Value op = instr->op(); |
2598 | 2598 |
2599 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op, SLOPPY).code(); | 2599 Handle<Code> ic = |
| 2600 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); |
2600 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2601 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2601 // This instruction also signals no smi code inlined. | 2602 // This instruction also signals no smi code inlined. |
2602 __ cmp(r0, Operand::Zero()); | 2603 __ cmp(r0, Operand::Zero()); |
2603 | 2604 |
2604 Condition condition = ComputeCompareCondition(op); | 2605 Condition condition = ComputeCompareCondition(op); |
2605 | 2606 |
2606 EmitBranch(instr, condition); | 2607 EmitBranch(instr, condition); |
2607 } | 2608 } |
2608 | 2609 |
2609 | 2610 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2907 // restore all registers. | 2908 // restore all registers. |
2908 __ StoreToSafepointRegisterSlot(r0, ToRegister(instr->result())); | 2909 __ StoreToSafepointRegisterSlot(r0, ToRegister(instr->result())); |
2909 } | 2910 } |
2910 | 2911 |
2911 | 2912 |
2912 void LCodeGen::DoCmpT(LCmpT* instr) { | 2913 void LCodeGen::DoCmpT(LCmpT* instr) { |
2913 DCHECK(ToRegister(instr->context()).is(cp)); | 2914 DCHECK(ToRegister(instr->context()).is(cp)); |
2914 Token::Value op = instr->op(); | 2915 Token::Value op = instr->op(); |
2915 | 2916 |
2916 Handle<Code> ic = | 2917 Handle<Code> ic = |
2917 CodeFactory::CompareIC(isolate(), op, instr->language_mode()).code(); | 2918 CodeFactory::CompareIC(isolate(), op, instr->strength()).code(); |
2918 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2919 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2919 // This instruction also signals no smi code inlined. | 2920 // This instruction also signals no smi code inlined. |
2920 __ cmp(r0, Operand::Zero()); | 2921 __ cmp(r0, Operand::Zero()); |
2921 | 2922 |
2922 Condition condition = ComputeCompareCondition(op); | 2923 Condition condition = ComputeCompareCondition(op); |
2923 __ LoadRoot(ToRegister(instr->result()), | 2924 __ LoadRoot(ToRegister(instr->result()), |
2924 Heap::kTrueValueRootIndex, | 2925 Heap::kTrueValueRootIndex, |
2925 condition); | 2926 condition); |
2926 __ LoadRoot(ToRegister(instr->result()), | 2927 __ LoadRoot(ToRegister(instr->result()), |
2927 Heap::kFalseValueRootIndex, | 2928 Heap::kFalseValueRootIndex, |
(...skipping 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6004 __ push(ToRegister(instr->function())); | 6005 __ push(ToRegister(instr->function())); |
6005 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6006 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6006 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6007 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6007 } | 6008 } |
6008 | 6009 |
6009 | 6010 |
6010 #undef __ | 6011 #undef __ |
6011 | 6012 |
6012 } // namespace internal | 6013 } // namespace internal |
6013 } // namespace v8 | 6014 } // namespace v8 |
OLD | NEW |