OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 } | 2181 } |
2182 } | 2182 } |
2183 | 2183 |
2184 | 2184 |
2185 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 2185 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
2186 DCHECK(ToRegister(instr->context()).is(cp)); | 2186 DCHECK(ToRegister(instr->context()).is(cp)); |
2187 DCHECK(ToRegister(instr->left()).is(r4)); | 2187 DCHECK(ToRegister(instr->left()).is(r4)); |
2188 DCHECK(ToRegister(instr->right()).is(r3)); | 2188 DCHECK(ToRegister(instr->right()).is(r3)); |
2189 DCHECK(ToRegister(instr->result()).is(r3)); | 2189 DCHECK(ToRegister(instr->result()).is(r3)); |
2190 | 2190 |
2191 Handle<Code> code = CodeFactory::BinaryOpIC( | 2191 Handle<Code> code = |
2192 isolate(), instr->op(), instr->language_mode()).code(); | 2192 CodeFactory::BinaryOpIC(isolate(), instr->op(), instr->strength()).code(); |
2193 CallCode(code, RelocInfo::CODE_TARGET, instr); | 2193 CallCode(code, RelocInfo::CODE_TARGET, instr); |
2194 } | 2194 } |
2195 | 2195 |
2196 | 2196 |
2197 template <class InstrType> | 2197 template <class InstrType> |
2198 void LCodeGen::EmitBranch(InstrType instr, Condition cond, CRegister cr) { | 2198 void LCodeGen::EmitBranch(InstrType instr, Condition cond, CRegister cr) { |
2199 int left_block = instr->TrueDestination(chunk_); | 2199 int left_block = instr->TrueDestination(chunk_); |
2200 int right_block = instr->FalseDestination(chunk_); | 2200 int right_block = instr->FalseDestination(chunk_); |
2201 | 2201 |
2202 int next_block = GetNextEmittedBlock(); | 2202 int next_block = GetNextEmittedBlock(); |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2658 UNREACHABLE(); | 2658 UNREACHABLE(); |
2659 return kNoCondition; | 2659 return kNoCondition; |
2660 } | 2660 } |
2661 } | 2661 } |
2662 | 2662 |
2663 | 2663 |
2664 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2664 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
2665 DCHECK(ToRegister(instr->context()).is(cp)); | 2665 DCHECK(ToRegister(instr->context()).is(cp)); |
2666 Token::Value op = instr->op(); | 2666 Token::Value op = instr->op(); |
2667 | 2667 |
2668 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op, SLOPPY).code(); | 2668 Handle<Code> ic = |
| 2669 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); |
2669 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2670 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2670 // This instruction also signals no smi code inlined | 2671 // This instruction also signals no smi code inlined |
2671 __ cmpi(r3, Operand::Zero()); | 2672 __ cmpi(r3, Operand::Zero()); |
2672 | 2673 |
2673 Condition condition = ComputeCompareCondition(op); | 2674 Condition condition = ComputeCompareCondition(op); |
2674 | 2675 |
2675 EmitBranch(instr, condition); | 2676 EmitBranch(instr, condition); |
2676 } | 2677 } |
2677 | 2678 |
2678 | 2679 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2966 // restore all registers. | 2967 // restore all registers. |
2967 __ StoreToSafepointRegisterSlot(r3, ToRegister(instr->result())); | 2968 __ StoreToSafepointRegisterSlot(r3, ToRegister(instr->result())); |
2968 } | 2969 } |
2969 | 2970 |
2970 | 2971 |
2971 void LCodeGen::DoCmpT(LCmpT* instr) { | 2972 void LCodeGen::DoCmpT(LCmpT* instr) { |
2972 DCHECK(ToRegister(instr->context()).is(cp)); | 2973 DCHECK(ToRegister(instr->context()).is(cp)); |
2973 Token::Value op = instr->op(); | 2974 Token::Value op = instr->op(); |
2974 | 2975 |
2975 Handle<Code> ic = | 2976 Handle<Code> ic = |
2976 CodeFactory::CompareIC(isolate(), op, instr->language_mode()).code(); | 2977 CodeFactory::CompareIC(isolate(), op, instr->strength()).code(); |
2977 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2978 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2978 // This instruction also signals no smi code inlined | 2979 // This instruction also signals no smi code inlined |
2979 __ cmpi(r3, Operand::Zero()); | 2980 __ cmpi(r3, Operand::Zero()); |
2980 | 2981 |
2981 Condition condition = ComputeCompareCondition(op); | 2982 Condition condition = ComputeCompareCondition(op); |
2982 if (CpuFeatures::IsSupported(ISELECT)) { | 2983 if (CpuFeatures::IsSupported(ISELECT)) { |
2983 __ LoadRoot(r4, Heap::kTrueValueRootIndex); | 2984 __ LoadRoot(r4, Heap::kTrueValueRootIndex); |
2984 __ LoadRoot(r5, Heap::kFalseValueRootIndex); | 2985 __ LoadRoot(r5, Heap::kFalseValueRootIndex); |
2985 __ isel(condition, ToRegister(instr->result()), r4, r5); | 2986 __ isel(condition, ToRegister(instr->result()), r4, r5); |
2986 } else { | 2987 } else { |
(...skipping 3287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6274 __ Push(scope_info); | 6275 __ Push(scope_info); |
6275 __ push(ToRegister(instr->function())); | 6276 __ push(ToRegister(instr->function())); |
6276 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6277 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6277 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6278 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6278 } | 6279 } |
6279 | 6280 |
6280 | 6281 |
6281 #undef __ | 6282 #undef __ |
6282 } // namespace internal | 6283 } // namespace internal |
6283 } // namespace v8 | 6284 } // namespace v8 |
OLD | NEW |