| 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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 return Type::OtherInternal(); | 1281 return Type::OtherInternal(); |
| 1282 } | 1282 } |
| 1283 | 1283 |
| 1284 // JS other operators. | 1284 // JS other operators. |
| 1285 | 1285 |
| 1286 | 1286 |
| 1287 Type* Typer::Visitor::TypeJSCallConstruct(Node* node) { | 1287 Type* Typer::Visitor::TypeJSCallConstruct(Node* node) { |
| 1288 return Type::Receiver(); | 1288 return Type::Receiver(); |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 | |
| 1292 Type* Typer::Visitor::JSCallFunctionTyper(Type* fun, Typer* t) { | 1291 Type* Typer::Visitor::JSCallFunctionTyper(Type* fun, Typer* t) { |
| 1293 if (fun->IsHeapConstant() && fun->AsHeapConstant()->Value()->IsJSFunction()) { | 1292 if (fun->IsHeapConstant() && fun->AsHeapConstant()->Value()->IsJSFunction()) { |
| 1294 Handle<JSFunction> function = | 1293 Handle<JSFunction> function = |
| 1295 Handle<JSFunction>::cast(fun->AsHeapConstant()->Value()); | 1294 Handle<JSFunction>::cast(fun->AsHeapConstant()->Value()); |
| 1296 if (function->shared()->HasBuiltinFunctionId()) { | 1295 if (function->shared()->HasBuiltinFunctionId()) { |
| 1297 switch (function->shared()->builtin_function_id()) { | 1296 switch (function->shared()->builtin_function_id()) { |
| 1298 case kMathRandom: | 1297 case kMathRandom: |
| 1299 return Type::PlainNumber(); | 1298 return Type::PlainNumber(); |
| 1300 case kMathFloor: | 1299 case kMathFloor: |
| 1301 case kMathCeil: | 1300 case kMathCeil: |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1750 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
| 1752 if (Type::IsInteger(*value)) { | 1751 if (Type::IsInteger(*value)) { |
| 1753 return Type::Range(value->Number(), value->Number(), zone()); | 1752 return Type::Range(value->Number(), value->Number(), zone()); |
| 1754 } | 1753 } |
| 1755 return Type::NewConstant(value, zone()); | 1754 return Type::NewConstant(value, zone()); |
| 1756 } | 1755 } |
| 1757 | 1756 |
| 1758 } // namespace compiler | 1757 } // namespace compiler |
| 1759 } // namespace internal | 1758 } // namespace internal |
| 1760 } // namespace v8 | 1759 } // namespace v8 |
| OLD | NEW |