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 "src/base/flags.h" | 7 #include "src/base/flags.h" |
8 #include "src/base/lazy-instance.h" | 8 #include "src/base/lazy-instance.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/compiler/graph-reducer.h" | 10 #include "src/compiler/graph-reducer.h" |
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 return typer_->cache_.kFloat32ArrayFunc; | 2358 return typer_->cache_.kFloat32ArrayFunc; |
2359 } else if (*value == native->float64_array_fun()) { | 2359 } else if (*value == native->float64_array_fun()) { |
2360 return typer_->cache_.kFloat64ArrayFunc; | 2360 return typer_->cache_.kFloat64ArrayFunc; |
2361 } | 2361 } |
2362 } | 2362 } |
2363 int const arity = | 2363 int const arity = |
2364 JSFunction::cast(*value)->shared()->internal_formal_parameter_count(); | 2364 JSFunction::cast(*value)->shared()->internal_formal_parameter_count(); |
2365 switch (arity) { | 2365 switch (arity) { |
2366 case SharedFunctionInfo::kDontAdaptArgumentsSentinel: | 2366 case SharedFunctionInfo::kDontAdaptArgumentsSentinel: |
2367 // Some smart optimization at work... &%$!&@+$! | 2367 // Some smart optimization at work... &%$!&@+$! |
2368 return Type::Any(zone()); | 2368 break; |
2369 case 0: | 2369 case 0: |
2370 return typer_->cache_.kAnyFunc0; | 2370 return typer_->cache_.kAnyFunc0; |
2371 case 1: | 2371 case 1: |
2372 return typer_->cache_.kAnyFunc1; | 2372 return typer_->cache_.kAnyFunc1; |
2373 case 2: | 2373 case 2: |
2374 return typer_->cache_.kAnyFunc2; | 2374 return typer_->cache_.kAnyFunc2; |
2375 case 3: | 2375 case 3: |
2376 return typer_->cache_.kAnyFunc3; | 2376 return typer_->cache_.kAnyFunc3; |
2377 default: { | 2377 default: { |
2378 DCHECK_LT(3, arity); | 2378 DCHECK_LT(3, arity); |
(...skipping 10 matching lines...) Expand all Loading... |
2389 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 2389 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
2390 #undef TYPED_ARRAY_CASE | 2390 #undef TYPED_ARRAY_CASE |
2391 } | 2391 } |
2392 } | 2392 } |
2393 return Type::Constant(value, zone()); | 2393 return Type::Constant(value, zone()); |
2394 } | 2394 } |
2395 | 2395 |
2396 } // namespace compiler | 2396 } // namespace compiler |
2397 } // namespace internal | 2397 } // namespace internal |
2398 } // namespace v8 | 2398 } // namespace v8 |
OLD | NEW |