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