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

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

Issue 1884713003: [turbofan] Change number operations to handle Undefined as well. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 4 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 "src/base/flags.h" 7 #include "src/base/flags.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/compilation-dependencies.h" 9 #include "src/compilation-dependencies.h"
10 #include "src/compiler/common-operator.h" 10 #include "src/compiler/common-operator.h"
(...skipping 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1940 } 1940 }
1941 } 1941 }
1942 return access.type; 1942 return access.type;
1943 } 1943 }
1944 1944
1945 1945
1946 Type* Typer::Visitor::TypeLoadBuffer(Node* node) { 1946 Type* Typer::Visitor::TypeLoadBuffer(Node* node) {
1947 // TODO(bmeurer): This typing is not yet correct. Since we can still access 1947 // TODO(bmeurer): This typing is not yet correct. Since we can still access
1948 // out of bounds, the type in the general case has to include Undefined. 1948 // out of bounds, the type in the general case has to include Undefined.
1949 switch (BufferAccessOf(node->op()).external_array_type()) { 1949 switch (BufferAccessOf(node->op()).external_array_type()) {
1950 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ 1950 #define TYPED_ARRAY_CASE(ElemType, type, TYPE, ctype, size) \
1951 case kExternal##Type##Array: \ 1951 case kExternal##ElemType##Array: \
1952 return typer_->cache_.k##Type; 1952 return Type::Union(typer_->cache_.k##ElemType, Type::Undefined(), zone());
1953 TYPED_ARRAYS(TYPED_ARRAY_CASE) 1953 TYPED_ARRAYS(TYPED_ARRAY_CASE)
1954 #undef TYPED_ARRAY_CASE 1954 #undef TYPED_ARRAY_CASE
1955 } 1955 }
1956 UNREACHABLE(); 1956 UNREACHABLE();
1957 return nullptr; 1957 return nullptr;
1958 } 1958 }
1959 1959
1960 1960
1961 Type* Typer::Visitor::TypeLoadElement(Node* node) { 1961 Type* Typer::Visitor::TypeLoadElement(Node* node) {
1962 return ElementAccessOf(node->op()).type; 1962 return ElementAccessOf(node->op()).type;
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
2534 } 2534 }
2535 if (Type::IsInteger(*value)) { 2535 if (Type::IsInteger(*value)) {
2536 return Type::Range(value->Number(), value->Number(), zone()); 2536 return Type::Range(value->Number(), value->Number(), zone());
2537 } 2537 }
2538 return Type::Constant(value, zone()); 2538 return Type::Constant(value, zone());
2539 } 2539 }
2540 2540
2541 } // namespace compiler 2541 } // namespace compiler
2542 } // namespace internal 2542 } // namespace internal
2543 } // namespace v8 2543 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698