| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |