Chromium Code Reviews| 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/base/flags.h" | 5 #include "src/base/flags.h" |
| 6 #include "src/bootstrapper.h" | 6 #include "src/bootstrapper.h" |
| 7 #include "src/compiler/graph-reducer.h" | 7 #include "src/compiler/graph-reducer.h" |
| 8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
| 9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 2392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2403 return typer_->cache_->Get(kUint32ArrayFunc); | 2403 return typer_->cache_->Get(kUint32ArrayFunc); |
| 2404 } else if (*value == native->float32_array_fun()) { | 2404 } else if (*value == native->float32_array_fun()) { |
| 2405 return typer_->cache_->Get(kFloat32ArrayFunc); | 2405 return typer_->cache_->Get(kFloat32ArrayFunc); |
| 2406 } else if (*value == native->float64_array_fun()) { | 2406 } else if (*value == native->float64_array_fun()) { |
| 2407 return typer_->cache_->Get(kFloat64ArrayFunc); | 2407 return typer_->cache_->Get(kFloat64ArrayFunc); |
| 2408 } | 2408 } |
| 2409 } | 2409 } |
| 2410 int const arity = | 2410 int const arity = |
| 2411 JSFunction::cast(*value)->shared()->internal_formal_parameter_count(); | 2411 JSFunction::cast(*value)->shared()->internal_formal_parameter_count(); |
| 2412 switch (arity) { | 2412 switch (arity) { |
| 2413 case SharedFunctionInfo::kDontAdaptArgumentsSentinel: | |
| 2414 // Some smart optimization at work... &%$!&@+$! | |
| 2415 // https://code.google.com/p/chromium/issues/detail?id=500824 | |
|
Michael Starzinger
2015/06/16 09:03:17
nit: We probably don't need to reference the issue
Benedikt Meurer
2015/06/16 09:04:05
Done.
| |
| 2416 return Type::Any(zone()); | |
| 2413 case 0: | 2417 case 0: |
| 2414 return typer_->cache_->Get(kAnyFunc0); | 2418 return typer_->cache_->Get(kAnyFunc0); |
| 2415 case 1: | 2419 case 1: |
| 2416 return typer_->cache_->Get(kAnyFunc1); | 2420 return typer_->cache_->Get(kAnyFunc1); |
| 2417 case 2: | 2421 case 2: |
| 2418 return typer_->cache_->Get(kAnyFunc2); | 2422 return typer_->cache_->Get(kAnyFunc2); |
| 2419 case 3: | 2423 case 3: |
| 2420 return typer_->cache_->Get(kAnyFunc3); | 2424 return typer_->cache_->Get(kAnyFunc3); |
| 2421 default: { | 2425 default: { |
| 2426 DCHECK_LT(3, arity); | |
| 2422 Type** const params = zone()->NewArray<Type*>(arity); | 2427 Type** const params = zone()->NewArray<Type*>(arity); |
| 2423 std::fill(¶ms[0], ¶ms[arity], Type::Any(zone())); | 2428 std::fill(¶ms[0], ¶ms[arity], Type::Any(zone())); |
| 2424 return Type::Function(Type::Any(zone()), arity, params, zone()); | 2429 return Type::Function(Type::Any(zone()), arity, params, zone()); |
| 2425 } | 2430 } |
| 2426 } | 2431 } |
| 2427 } else if (value->IsJSTypedArray()) { | 2432 } else if (value->IsJSTypedArray()) { |
| 2428 switch (JSTypedArray::cast(*value)->type()) { | 2433 switch (JSTypedArray::cast(*value)->type()) { |
| 2429 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 2434 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| 2430 case kExternal##Type##Array: \ | 2435 case kExternal##Type##Array: \ |
| 2431 return typer_->cache_->Get(k##Type##Array); | 2436 return typer_->cache_->Get(k##Type##Array); |
| 2432 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 2437 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 2433 #undef TYPED_ARRAY_CASE | 2438 #undef TYPED_ARRAY_CASE |
| 2434 } | 2439 } |
| 2435 } | 2440 } |
| 2436 return Type::Constant(value, zone()); | 2441 return Type::Constant(value, zone()); |
| 2437 } | 2442 } |
| 2438 | 2443 |
| 2439 } // namespace compiler | 2444 } // namespace compiler |
| 2440 } // namespace internal | 2445 } // namespace internal |
| 2441 } // namespace v8 | 2446 } // namespace v8 |
| OLD | NEW |