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

Side by Side Diff: runtime/vm/code_generator.cc

Issue 10695137: Provide better error message when passing wrong number of arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler_macros.h" 7 #include "vm/assembler_macros.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 } 1457 }
1458 1458
1459 1459
1460 // We are entering function name for a valid argument count. 1460 // We are entering function name for a valid argument count.
1461 void FunctionsCache::EnterFunctionAt(int i, 1461 void FunctionsCache::EnterFunctionAt(int i,
1462 const Array& cache, 1462 const Array& cache,
1463 const Function& function, 1463 const Function& function,
1464 int num_arguments, 1464 int num_arguments,
1465 int num_named_arguments) { 1465 int num_named_arguments) {
1466 ASSERT((i % kNumEntries) == 0); 1466 ASSERT((i % kNumEntries) == 0);
1467 ASSERT(function.AreValidArgumentCounts(num_arguments, num_named_arguments)); 1467 ASSERT(function.AreValidArgumentCounts(num_arguments,
1468 num_named_arguments,
1469 NULL));
1468 cache.SetAt(i + FunctionsCache::kFunctionName, 1470 cache.SetAt(i + FunctionsCache::kFunctionName,
1469 String::Handle(function.name())); 1471 String::Handle(function.name()));
1470 cache.SetAt(i + FunctionsCache::kArgCount, 1472 cache.SetAt(i + FunctionsCache::kArgCount,
1471 Smi::Handle(Smi::New(num_arguments))); 1473 Smi::Handle(Smi::New(num_arguments)));
1472 cache.SetAt(i + FunctionsCache::kNamedArgCount, 1474 cache.SetAt(i + FunctionsCache::kNamedArgCount,
1473 Smi::Handle(Smi::New(num_named_arguments))); 1475 Smi::Handle(Smi::New(num_named_arguments)));
1474 cache.SetAt(i + FunctionsCache::kFunction, function); 1476 cache.SetAt(i + FunctionsCache::kFunction, function);
1475 } 1477 }
1476 1478
1477 1479
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 } 1538 }
1537 } 1539 }
1538 } 1540 }
1539 // The cache is null terminated, therefore the loop above should never 1541 // The cache is null terminated, therefore the loop above should never
1540 // terminate by itself. 1542 // terminate by itself.
1541 UNREACHABLE(); 1543 UNREACHABLE();
1542 return Code::null(); 1544 return Code::null();
1543 } 1545 }
1544 1546
1545 } // namespace dart 1547 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698