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

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

Issue 2484003002: [builtins] implement JSBuiltinReducer for ArrayIteratorNext() (Closed)
Patch Set: add (some) test coverage, and fix some bugs found by it Created 4 years, 1 month 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 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 1098
1099 Type* Typer::Visitor::TypeJSCreateClosure(Node* node) { 1099 Type* Typer::Visitor::TypeJSCreateClosure(Node* node) {
1100 return Type::Function(); 1100 return Type::Function();
1101 } 1101 }
1102 1102
1103 1103
1104 Type* Typer::Visitor::TypeJSCreateIterResultObject(Node* node) { 1104 Type* Typer::Visitor::TypeJSCreateIterResultObject(Node* node) {
1105 return Type::OtherObject(); 1105 return Type::OtherObject();
1106 } 1106 }
1107 1107
1108 Type* Typer::Visitor::TypeJSCreateKeyValueArray(Node* node) {
1109 return Type::OtherObject();
1110 }
1108 1111
1109 Type* Typer::Visitor::TypeJSCreateLiteralArray(Node* node) { 1112 Type* Typer::Visitor::TypeJSCreateLiteralArray(Node* node) {
1110 return Type::OtherObject(); 1113 return Type::OtherObject();
1111 } 1114 }
1112 1115
1113 1116
1114 Type* Typer::Visitor::TypeJSCreateLiteralObject(Node* node) { 1117 Type* Typer::Visitor::TypeJSCreateLiteralObject(Node* node) {
1115 return Type::OtherObject(); 1118 return Type::OtherObject();
1116 } 1119 }
1117 1120
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 case kStringFromCharCode: 1382 case kStringFromCharCode:
1380 case kStringSubstr: 1383 case kStringSubstr:
1381 case kStringToLowerCase: 1384 case kStringToLowerCase:
1382 case kStringToUpperCase: 1385 case kStringToUpperCase:
1383 return Type::String(); 1386 return Type::String();
1384 1387
1385 case kStringIterator: 1388 case kStringIterator:
1386 case kStringIteratorNext: 1389 case kStringIteratorNext:
1387 return Type::OtherObject(); 1390 return Type::OtherObject();
1388 1391
1392 case kArrayEntries:
1393 case kArrayKeys:
1394 case kArrayValues:
1395 case kTypedArrayEntries:
1396 case kTypedArrayKeys:
1397 case kTypedArrayValues:
1398 case kArrayIteratorNext:
1399 return Type::OtherObject();
1400
1389 // Array functions. 1401 // Array functions.
1390 case kArrayIndexOf: 1402 case kArrayIndexOf:
1391 case kArrayLastIndexOf: 1403 case kArrayLastIndexOf:
1392 return Type::Range(-1, kMaxSafeInteger, t->zone()); 1404 return Type::Range(-1, kMaxSafeInteger, t->zone());
1393 case kArrayPush: 1405 case kArrayPush:
1394 return t->cache_.kPositiveSafeInteger; 1406 return t->cache_.kPositiveSafeInteger;
1395 // Object functions. 1407 // Object functions.
1396 case kObjectHasOwnProperty: 1408 case kObjectHasOwnProperty:
1397 return Type::Boolean(); 1409 return Type::Boolean();
1398 // Global functions. 1410 // Global functions.
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { 1753 Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
1742 if (Type::IsInteger(*value)) { 1754 if (Type::IsInteger(*value)) {
1743 return Type::Range(value->Number(), value->Number(), zone()); 1755 return Type::Range(value->Number(), value->Number(), zone());
1744 } 1756 }
1745 return Type::NewConstant(value, zone()); 1757 return Type::NewConstant(value, zone());
1746 } 1758 }
1747 1759
1748 } // namespace compiler 1760 } // namespace compiler
1749 } // namespace internal 1761 } // namespace internal
1750 } // namespace v8 1762 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698