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

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') | runtime/vm/object.h » ('J')
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,
1470 0));
1468 cache.SetAt(i + FunctionsCache::kFunctionName, 1471 cache.SetAt(i + FunctionsCache::kFunctionName,
1469 String::Handle(function.name())); 1472 String::Handle(function.name()));
1470 cache.SetAt(i + FunctionsCache::kArgCount, 1473 cache.SetAt(i + FunctionsCache::kArgCount,
1471 Smi::Handle(Smi::New(num_arguments))); 1474 Smi::Handle(Smi::New(num_arguments)));
1472 cache.SetAt(i + FunctionsCache::kNamedArgCount, 1475 cache.SetAt(i + FunctionsCache::kNamedArgCount,
1473 Smi::Handle(Smi::New(num_named_arguments))); 1476 Smi::Handle(Smi::New(num_named_arguments)));
1474 cache.SetAt(i + FunctionsCache::kFunction, function); 1477 cache.SetAt(i + FunctionsCache::kFunction, function);
1475 } 1478 }
1476 1479
1477 1480
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 } 1539 }
1537 } 1540 }
1538 } 1541 }
1539 // The cache is null terminated, therefore the loop above should never 1542 // The cache is null terminated, therefore the loop above should never
1540 // terminate by itself. 1543 // terminate by itself.
1541 UNREACHABLE(); 1544 UNREACHABLE();
1542 return Code::null(); 1545 return Code::null();
1543 } 1546 }
1544 1547
1545 } // namespace dart 1548 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698