| 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/base/bits.h" | 5 #include "src/base/bits.h" |
| 6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/cpu-profiler.h" | 8 #include "src/cpu-profiler.h" |
| 9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 case CodeStub::RegExpExec: { | 977 case CodeStub::RegExpExec: { |
| 978 RegExpExecStub stub(isolate()); | 978 RegExpExecStub stub(isolate()); |
| 979 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 979 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 980 break; | 980 break; |
| 981 } | 981 } |
| 982 case CodeStub::SubString: { | 982 case CodeStub::SubString: { |
| 983 SubStringStub stub(isolate()); | 983 SubStringStub stub(isolate()); |
| 984 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 984 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 985 break; | 985 break; |
| 986 } | 986 } |
| 987 case CodeStub::StringCompare: { | |
| 988 StringCompareStub stub(isolate()); | |
| 989 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 990 break; | |
| 991 } | |
| 992 default: | 987 default: |
| 993 UNREACHABLE(); | 988 UNREACHABLE(); |
| 994 } | 989 } |
| 995 } | 990 } |
| 996 | 991 |
| 997 | 992 |
| 998 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { | 993 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
| 999 GenerateOsrPrologue(); | 994 GenerateOsrPrologue(); |
| 1000 } | 995 } |
| 1001 | 996 |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2603 return ge; | 2598 return ge; |
| 2604 default: | 2599 default: |
| 2605 UNREACHABLE(); | 2600 UNREACHABLE(); |
| 2606 return kNoCondition; | 2601 return kNoCondition; |
| 2607 } | 2602 } |
| 2608 } | 2603 } |
| 2609 | 2604 |
| 2610 | 2605 |
| 2611 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { | 2606 void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) { |
| 2612 DCHECK(ToRegister(instr->context()).is(cp)); | 2607 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2613 Token::Value op = instr->op(); | 2608 DCHECK(ToRegister(instr->left()).is(r4)); |
| 2609 DCHECK(ToRegister(instr->right()).is(r3)); |
| 2614 | 2610 |
| 2615 Handle<Code> ic = | 2611 Handle<Code> code = CodeFactory::StringCompare(isolate()).code(); |
| 2616 CodeFactory::CompareIC(isolate(), op, Strength::WEAK).code(); | 2612 CallCode(code, RelocInfo::CODE_TARGET, instr); |
| 2617 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
| 2618 // This instruction also signals no smi code inlined | |
| 2619 __ cmpi(r3, Operand::Zero()); | 2613 __ cmpi(r3, Operand::Zero()); |
| 2620 | 2614 |
| 2621 Condition condition = ComputeCompareCondition(op); | 2615 EmitBranch(instr, ComputeCompareCondition(instr->op())); |
| 2622 | |
| 2623 EmitBranch(instr, condition); | |
| 2624 } | 2616 } |
| 2625 | 2617 |
| 2626 | 2618 |
| 2627 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { | 2619 static InstanceType TestType(HHasInstanceTypeAndBranch* instr) { |
| 2628 InstanceType from = instr->from(); | 2620 InstanceType from = instr->from(); |
| 2629 InstanceType to = instr->to(); | 2621 InstanceType to = instr->to(); |
| 2630 if (from == FIRST_TYPE) return to; | 2622 if (from == FIRST_TYPE) return to; |
| 2631 DCHECK(from == to || to == LAST_TYPE); | 2623 DCHECK(from == to || to == LAST_TYPE); |
| 2632 return from; | 2624 return from; |
| 2633 } | 2625 } |
| (...skipping 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6137 __ Push(scope_info); | 6129 __ Push(scope_info); |
| 6138 __ push(ToRegister(instr->function())); | 6130 __ push(ToRegister(instr->function())); |
| 6139 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6131 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6140 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6132 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6141 } | 6133 } |
| 6142 | 6134 |
| 6143 | 6135 |
| 6144 #undef __ | 6136 #undef __ |
| 6145 } // namespace internal | 6137 } // namespace internal |
| 6146 } // namespace v8 | 6138 } // namespace v8 |
| OLD | NEW |