Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: src/crankshaft/ia32/lithium-ia32.cc

Issue 1744163002: [stubs] Introduce a proper ToBooleanStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix mips Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/crankshaft/ia32/lithium-ia32.h" 5 #include "src/crankshaft/ia32/lithium-ia32.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #if V8_TARGET_ARCH_IA32 9 #if V8_TARGET_ARCH_IA32
10 10
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 929
930 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 930 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
931 return new(zone()) LGoto(instr->FirstSuccessor()); 931 return new(zone()) LGoto(instr->FirstSuccessor());
932 } 932 }
933 933
934 934
935 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { 935 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
936 HValue* value = instr->value(); 936 HValue* value = instr->value();
937 Representation r = value->representation(); 937 Representation r = value->representation();
938 HType type = value->type(); 938 HType type = value->type();
939 ToBooleanStub::Types expected = instr->expected_input_types(); 939 ToBooleanICStub::Types expected = instr->expected_input_types();
940 if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic(); 940 if (expected.IsEmpty()) expected = ToBooleanICStub::Types::Generic();
941 941
942 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() || 942 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() ||
943 type.IsJSArray() || type.IsHeapNumber() || type.IsString(); 943 type.IsJSArray() || type.IsHeapNumber() || type.IsString();
944 LOperand* temp = !easy_case && expected.NeedsMap() ? TempRegister() : NULL; 944 LOperand* temp = !easy_case && expected.NeedsMap() ? TempRegister() : NULL;
945 LInstruction* branch = new(zone()) LBranch(UseRegister(value), temp); 945 LInstruction* branch = new(zone()) LBranch(UseRegister(value), temp);
946 if (!easy_case && 946 if (!easy_case &&
947 ((!expected.Contains(ToBooleanStub::SMI) && expected.NeedsMap()) || 947 ((!expected.Contains(ToBooleanICStub::SMI) && expected.NeedsMap()) ||
948 !expected.IsGeneric())) { 948 !expected.IsGeneric())) {
949 branch = AssignEnvironment(branch); 949 branch = AssignEnvironment(branch);
950 } 950 }
951 return branch; 951 return branch;
952 } 952 }
953 953
954 954
955 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) { 955 LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) {
956 return new(zone()) LDebugBreak(); 956 return new(zone()) LDebugBreak();
957 } 957 }
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { 2605 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
2606 LOperand* context = UseRegisterAtStart(instr->context()); 2606 LOperand* context = UseRegisterAtStart(instr->context());
2607 return new(zone()) LStoreFrameContext(context); 2607 return new(zone()) LStoreFrameContext(context);
2608 } 2608 }
2609 2609
2610 2610
2611 } // namespace internal 2611 } // namespace internal
2612 } // namespace v8 2612 } // namespace v8
2613 2613
2614 #endif // V8_TARGET_ARCH_IA32 2614 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698