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

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

Issue 1186333002: [turbofan] Work around negative parameter count. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove bug reference. Created 5 years, 6 months 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
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-500824.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 return Type::Any(zone());
2413 case 0: 2416 case 0:
2414 return typer_->cache_->Get(kAnyFunc0); 2417 return typer_->cache_->Get(kAnyFunc0);
2415 case 1: 2418 case 1:
2416 return typer_->cache_->Get(kAnyFunc1); 2419 return typer_->cache_->Get(kAnyFunc1);
2417 case 2: 2420 case 2:
2418 return typer_->cache_->Get(kAnyFunc2); 2421 return typer_->cache_->Get(kAnyFunc2);
2419 case 3: 2422 case 3:
2420 return typer_->cache_->Get(kAnyFunc3); 2423 return typer_->cache_->Get(kAnyFunc3);
2421 default: { 2424 default: {
2425 DCHECK_LT(3, arity);
2422 Type** const params = zone()->NewArray<Type*>(arity); 2426 Type** const params = zone()->NewArray<Type*>(arity);
2423 std::fill(&params[0], &params[arity], Type::Any(zone())); 2427 std::fill(&params[0], &params[arity], Type::Any(zone()));
2424 return Type::Function(Type::Any(zone()), arity, params, zone()); 2428 return Type::Function(Type::Any(zone()), arity, params, zone());
2425 } 2429 }
2426 } 2430 }
2427 } else if (value->IsJSTypedArray()) { 2431 } else if (value->IsJSTypedArray()) {
2428 switch (JSTypedArray::cast(*value)->type()) { 2432 switch (JSTypedArray::cast(*value)->type()) {
2429 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ 2433 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
2430 case kExternal##Type##Array: \ 2434 case kExternal##Type##Array: \
2431 return typer_->cache_->Get(k##Type##Array); 2435 return typer_->cache_->Get(k##Type##Array);
2432 TYPED_ARRAYS(TYPED_ARRAY_CASE) 2436 TYPED_ARRAYS(TYPED_ARRAY_CASE)
2433 #undef TYPED_ARRAY_CASE 2437 #undef TYPED_ARRAY_CASE
2434 } 2438 }
2435 } 2439 }
2436 return Type::Constant(value, zone()); 2440 return Type::Constant(value, zone());
2437 } 2441 }
2438 2442
2439 } // namespace compiler 2443 } // namespace compiler
2440 } // namespace internal 2444 } // namespace internal
2441 } // namespace v8 2445 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-500824.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698