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

Side by Side Diff: src/compiler/typer.cc

Issue 2797993006: [turbofan] Add type to the allocation operator. (Closed)
Patch Set: Remove caching Created 3 years, 8 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/typer.h" 5 #include "src/compiler/typer.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/flags.h" 9 #include "src/base/flags.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 Type* Typer::Visitor::TypeConvertTaggedHoleToUndefined(Node* node) { 1869 Type* Typer::Visitor::TypeConvertTaggedHoleToUndefined(Node* node) {
1870 Type* type = Operand(node, 0); 1870 Type* type = Operand(node, 0);
1871 if (type->Maybe(Type::Hole())) { 1871 if (type->Maybe(Type::Hole())) {
1872 // Turn "the hole" into undefined. 1872 // Turn "the hole" into undefined.
1873 type = Type::Intersect(type, Type::NonInternal(), zone()); 1873 type = Type::Intersect(type, Type::NonInternal(), zone());
1874 type = Type::Union(type, Type::Undefined(), zone()); 1874 type = Type::Union(type, Type::Undefined(), zone());
1875 } 1875 }
1876 return type; 1876 return type;
1877 } 1877 }
1878 1878
1879 Type* Typer::Visitor::TypeAllocate(Node* node) { return Type::Any(); } 1879 Type* Typer::Visitor::TypeAllocate(Node* node) {
1880 return AllocateTypeOf(node->op());
1881 }
1880 1882
1881 Type* Typer::Visitor::TypeLoadField(Node* node) { 1883 Type* Typer::Visitor::TypeLoadField(Node* node) {
1882 return FieldAccessOf(node->op()).type; 1884 return FieldAccessOf(node->op()).type;
1883 } 1885 }
1884 1886
1885 Type* Typer::Visitor::TypeLoadBuffer(Node* node) { 1887 Type* Typer::Visitor::TypeLoadBuffer(Node* node) {
1886 switch (BufferAccessOf(node->op()).external_array_type()) { 1888 switch (BufferAccessOf(node->op()).external_array_type()) {
1887 #define TYPED_ARRAY_CASE(ElemType, type, TYPE, ctype, size) \ 1889 #define TYPED_ARRAY_CASE(ElemType, type, TYPE, ctype, size) \
1888 case kExternal##ElemType##Array: \ 1890 case kExternal##ElemType##Array: \
1889 return Type::Union(typer_->cache_.k##ElemType, Type::Undefined(), zone()); 1891 return Type::Union(typer_->cache_.k##ElemType, Type::Undefined(), zone());
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { 1994 Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
1993 if (Type::IsInteger(*value)) { 1995 if (Type::IsInteger(*value)) {
1994 return Type::Range(value->Number(), value->Number(), zone()); 1996 return Type::Range(value->Number(), value->Number(), zone());
1995 } 1997 }
1996 return Type::NewConstant(value, zone()); 1998 return Type::NewConstant(value, zone());
1997 } 1999 }
1998 2000
1999 } // namespace compiler 2001 } // namespace compiler
2000 } // namespace internal 2002 } // namespace internal
2001 } // namespace v8 2003 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/simplified-operator.cc ('k') | test/unittests/compiler/escape-analysis-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698