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

Side by Side Diff: src/field-type.cc

Issue 2237433003: [turbofan] Utilize type information for alias analysis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ASAN redness. Created 4 years, 4 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/typer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/field-type.h" 5 #include "src/field-type.h"
6 6
7 #include "src/handles-inl.h" 7 #include "src/handles-inl.h"
8 #include "src/ostreams.h" 8 #include "src/ostreams.h"
9 #include "src/types.h" 9 #include "src/types.h"
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (other->IsNone()) return false; 63 if (other->IsNone()) return false;
64 if (IsAny()) return false; 64 if (IsAny()) return false;
65 DCHECK(IsClass()); 65 DCHECK(IsClass());
66 DCHECK(other->IsClass()); 66 DCHECK(other->IsClass());
67 return this == other; 67 return this == other;
68 } 68 }
69 69
70 bool FieldType::NowIs(Handle<FieldType> other) { return NowIs(*other); } 70 bool FieldType::NowIs(Handle<FieldType> other) { return NowIs(*other); }
71 71
72 Type* FieldType::Convert(Zone* zone) { 72 Type* FieldType::Convert(Zone* zone) {
73 if (IsAny()) return Type::Any(); 73 if (IsAny()) return Type::NonInternal();
74 if (IsNone()) return Type::None(); 74 if (IsNone()) return Type::None();
75 DCHECK(IsClass()); 75 DCHECK(IsClass());
76 return Type::Class(AsClass(), zone); 76 return Type::Class(AsClass(), zone);
77 } 77 }
78 78
79 void FieldType::PrintTo(std::ostream& os) { 79 void FieldType::PrintTo(std::ostream& os) {
80 if (IsAny()) { 80 if (IsAny()) {
81 os << "Any"; 81 os << "Any";
82 } else if (IsNone()) { 82 } else if (IsNone()) {
83 os << "None"; 83 os << "None";
84 } else { 84 } else {
85 DCHECK(IsClass()); 85 DCHECK(IsClass());
86 os << "Class(" << static_cast<void*>(*AsClass()) << ")"; 86 os << "Class(" << static_cast<void*>(*AsClass()) << ")";
87 } 87 }
88 } 88 }
89 89
90 } // namespace internal 90 } // namespace internal
91 } // namespace v8 91 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/typer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698