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

Side by Side Diff: src/compiler/type-hint-analyzer.cc

Issue 1921563002: [turbofan] Initial version of number type feedback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 6 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/simplified-operator.cc ('k') | src/compiler/type-hints.h » ('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"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 namespace compiler { 14 namespace compiler {
15 15
16 namespace { 16 namespace {
17 17
18 // TODO(bmeurer): This detour via types is ugly. 18 // TODO(bmeurer): This detour via types is ugly.
19 BinaryOperationHints::Hint ToHint(Type* type) { 19 BinaryOperationHints::Hint ToHint(Type* type) {
20 if (type->Is(Type::None())) return BinaryOperationHints::kNone; 20 if (type->Is(Type::None())) return BinaryOperationHints::kNone;
21 if (type->Is(Type::SignedSmall())) return BinaryOperationHints::kSignedSmall; 21 if (type->Is(Type::SignedSmall())) return BinaryOperationHints::kSignedSmall;
22 if (type->Is(Type::Signed32())) return BinaryOperationHints::kSigned32; 22 if (type->Is(Type::Signed32())) return BinaryOperationHints::kSigned32;
23 if (type->Is(Type::Number())) return BinaryOperationHints::kNumber; 23 if (type->Is(Type::Number())) return BinaryOperationHints::kNumberOrUndefined;
24 if (type->Is(Type::String())) return BinaryOperationHints::kString; 24 if (type->Is(Type::String())) return BinaryOperationHints::kString;
25 return BinaryOperationHints::kAny; 25 return BinaryOperationHints::kAny;
26 } 26 }
27 27
28 } // namespace 28 } // namespace
29 29
30 30
31 bool TypeHintAnalysis::GetBinaryOperationHints( 31 bool TypeHintAnalysis::GetBinaryOperationHints(
32 TypeFeedbackId id, BinaryOperationHints* hints) const { 32 TypeFeedbackId id, BinaryOperationHints* hints) const {
33 auto i = infos_.find(id); 33 auto i = infos_.find(id);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/simplified-operator.cc ('k') | src/compiler/type-hints.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698