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

Side by Side Diff: src/compiler/type-hint-analyzer.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
« no previous file with comments | « src/compiler/mips64/instruction-selector-mips64.cc ('k') | src/crankshaft/arm/lithium-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/type-hint-analyzer.h" 5 #include "src/compiler/type-hint-analyzer.h"
6 6
7 #include "src/assembler.h" 7 #include "src/assembler.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler/type-hints.h" 9 #include "src/compiler/type-hints.h"
10 #include "src/ic/ic-state.h" 10 #include "src/ic/ic-state.h"
(...skipping 30 matching lines...) Expand all
41 return true; 41 return true;
42 } 42 }
43 43
44 44
45 bool TypeHintAnalysis::GetToBooleanHints(TypeFeedbackId id, 45 bool TypeHintAnalysis::GetToBooleanHints(TypeFeedbackId id,
46 ToBooleanHints* hints) const { 46 ToBooleanHints* hints) const {
47 auto i = infos_.find(id); 47 auto i = infos_.find(id);
48 if (i == infos_.end()) return false; 48 if (i == infos_.end()) return false;
49 Handle<Code> code = i->second; 49 Handle<Code> code = i->second;
50 DCHECK_EQ(Code::TO_BOOLEAN_IC, code->kind()); 50 DCHECK_EQ(Code::TO_BOOLEAN_IC, code->kind());
51 ToBooleanStub stub(code->GetIsolate(), code->extra_ic_state()); 51 ToBooleanICStub stub(code->GetIsolate(), code->extra_ic_state());
52 // TODO(bmeurer): Replace ToBooleanStub::Types with ToBooleanHints. 52 // TODO(bmeurer): Replace ToBooleanICStub::Types with ToBooleanHints.
53 #define ASSERT_COMPATIBLE(NAME, Name) \ 53 #define ASSERT_COMPATIBLE(NAME, Name) \
54 STATIC_ASSERT(1 << ToBooleanStub::NAME == \ 54 STATIC_ASSERT(1 << ToBooleanICStub::NAME == \
55 static_cast<int>(ToBooleanHint::k##Name)) 55 static_cast<int>(ToBooleanHint::k##Name))
56 ASSERT_COMPATIBLE(UNDEFINED, Undefined); 56 ASSERT_COMPATIBLE(UNDEFINED, Undefined);
57 ASSERT_COMPATIBLE(BOOLEAN, Boolean); 57 ASSERT_COMPATIBLE(BOOLEAN, Boolean);
58 ASSERT_COMPATIBLE(NULL_TYPE, Null); 58 ASSERT_COMPATIBLE(NULL_TYPE, Null);
59 ASSERT_COMPATIBLE(SMI, SmallInteger); 59 ASSERT_COMPATIBLE(SMI, SmallInteger);
60 ASSERT_COMPATIBLE(SPEC_OBJECT, Receiver); 60 ASSERT_COMPATIBLE(SPEC_OBJECT, Receiver);
61 ASSERT_COMPATIBLE(STRING, String); 61 ASSERT_COMPATIBLE(STRING, String);
62 ASSERT_COMPATIBLE(SYMBOL, Symbol); 62 ASSERT_COMPATIBLE(SYMBOL, Symbol);
63 ASSERT_COMPATIBLE(HEAP_NUMBER, HeapNumber); 63 ASSERT_COMPATIBLE(HEAP_NUMBER, HeapNumber);
64 ASSERT_COMPATIBLE(SIMD_VALUE, SimdValue); 64 ASSERT_COMPATIBLE(SIMD_VALUE, SimdValue);
(...skipping 24 matching lines...) Expand all
89 // Ignore the remaining code objects. 89 // Ignore the remaining code objects.
90 break; 90 break;
91 } 91 }
92 } 92 }
93 return new (zone()) TypeHintAnalysis(infos); 93 return new (zone()) TypeHintAnalysis(infos);
94 } 94 }
95 95
96 } // namespace compiler 96 } // namespace compiler
97 } // namespace internal 97 } // namespace internal
98 } // namespace v8 98 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/instruction-selector-mips64.cc ('k') | src/crankshaft/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698