| OLD | NEW |
| 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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1220 | 1220 |
| 1221 | 1221 |
| 1222 Type* Typer::Visitor::TypeJSDeleteProperty(Node* node) { | 1222 Type* Typer::Visitor::TypeJSDeleteProperty(Node* node) { |
| 1223 return Type::Boolean(); | 1223 return Type::Boolean(); |
| 1224 } | 1224 } |
| 1225 | 1225 |
| 1226 Type* Typer::Visitor::TypeJSHasProperty(Node* node) { return Type::Boolean(); } | 1226 Type* Typer::Visitor::TypeJSHasProperty(Node* node) { return Type::Boolean(); } |
| 1227 | 1227 |
| 1228 Type* Typer::Visitor::TypeJSInstanceOf(Node* node) { return Type::Boolean(); } | 1228 Type* Typer::Visitor::TypeJSInstanceOf(Node* node) { return Type::Boolean(); } |
| 1229 | 1229 |
| 1230 Type* Typer::Visitor::TypeJSOrdinaryHasInstance(Node* node) { |
| 1231 return Type::Boolean(); |
| 1232 } |
| 1233 |
| 1230 // JS context operators. | 1234 // JS context operators. |
| 1231 | 1235 |
| 1232 | 1236 |
| 1233 Type* Typer::Visitor::TypeJSLoadContext(Node* node) { | 1237 Type* Typer::Visitor::TypeJSLoadContext(Node* node) { |
| 1234 ContextAccess const& access = ContextAccessOf(node->op()); | 1238 ContextAccess const& access = ContextAccessOf(node->op()); |
| 1235 switch (access.index()) { | 1239 switch (access.index()) { |
| 1236 case Context::PREVIOUS_INDEX: | 1240 case Context::PREVIOUS_INDEX: |
| 1237 case Context::NATIVE_CONTEXT_INDEX: | 1241 case Context::NATIVE_CONTEXT_INDEX: |
| 1238 return Type::OtherInternal(); | 1242 return Type::OtherInternal(); |
| 1239 case Context::CLOSURE_INDEX: | 1243 case Context::CLOSURE_INDEX: |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1369 | 1373 |
| 1370 case kStringIteratorNext: | 1374 case kStringIteratorNext: |
| 1371 return Type::OtherObject(); | 1375 return Type::OtherObject(); |
| 1372 | 1376 |
| 1373 // Array functions. | 1377 // Array functions. |
| 1374 case kArrayIndexOf: | 1378 case kArrayIndexOf: |
| 1375 case kArrayLastIndexOf: | 1379 case kArrayLastIndexOf: |
| 1376 return Type::Range(-1, kMaxSafeInteger, t->zone()); | 1380 return Type::Range(-1, kMaxSafeInteger, t->zone()); |
| 1377 case kArrayPush: | 1381 case kArrayPush: |
| 1378 return t->cache_.kPositiveSafeInteger; | 1382 return t->cache_.kPositiveSafeInteger; |
| 1383 |
| 1379 // Object functions. | 1384 // Object functions. |
| 1380 case kObjectHasOwnProperty: | 1385 case kObjectHasOwnProperty: |
| 1381 return Type::Boolean(); | 1386 return Type::Boolean(); |
| 1387 |
| 1388 // Function functions. |
| 1389 case kFunctionHasInstance: |
| 1390 return Type::Boolean(); |
| 1391 |
| 1382 // Global functions. | 1392 // Global functions. |
| 1383 case kGlobalDecodeURI: | 1393 case kGlobalDecodeURI: |
| 1384 case kGlobalDecodeURIComponent: | 1394 case kGlobalDecodeURIComponent: |
| 1385 case kGlobalEncodeURI: | 1395 case kGlobalEncodeURI: |
| 1386 case kGlobalEncodeURIComponent: | 1396 case kGlobalEncodeURIComponent: |
| 1387 case kGlobalEscape: | 1397 case kGlobalEscape: |
| 1388 case kGlobalUnescape: | 1398 case kGlobalUnescape: |
| 1389 return Type::String(); | 1399 return Type::String(); |
| 1390 case kGlobalIsFinite: | 1400 case kGlobalIsFinite: |
| 1391 case kGlobalIsNaN: | 1401 case kGlobalIsNaN: |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1750 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
| 1741 if (Type::IsInteger(*value)) { | 1751 if (Type::IsInteger(*value)) { |
| 1742 return Type::Range(value->Number(), value->Number(), zone()); | 1752 return Type::Range(value->Number(), value->Number(), zone()); |
| 1743 } | 1753 } |
| 1744 return Type::Constant(value, zone()); | 1754 return Type::Constant(value, zone()); |
| 1745 } | 1755 } |
| 1746 | 1756 |
| 1747 } // namespace compiler | 1757 } // namespace compiler |
| 1748 } // namespace internal | 1758 } // namespace internal |
| 1749 } // namespace v8 | 1759 } // namespace v8 |
| OLD | NEW |