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

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

Issue 11421134: Remove ClosureArgumentMismatch runtime entry in vm and (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | « runtime/vm/code_generator.h ('k') | runtime/vm/flow_graph_compiler_ia32.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/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 for (int i = 1; i < total_num_parameters; i++) { 1373 for (int i = 1; i < total_num_parameters; i++) {
1374 array.SetAt(i - 1, String::Handle(function.ParameterNameAt(i))); 1374 array.SetAt(i - 1, String::Handle(function.ParameterNameAt(i)));
1375 } 1375 }
1376 dart_arguments.Add(&array); 1376 dart_arguments.Add(&array);
1377 } 1377 }
1378 Exceptions::ThrowByType(Exceptions::kNoSuchMethod, dart_arguments); 1378 Exceptions::ThrowByType(Exceptions::kNoSuchMethod, dart_arguments);
1379 UNREACHABLE(); 1379 UNREACHABLE();
1380 } 1380 }
1381 1381
1382 1382
1383 // A closure object was invoked with incompatible arguments.
1384 // TODO(regis): Deprecated. This case should be handled by a noSuchMethod call.
1385 DEFINE_RUNTIME_ENTRY(ClosureArgumentMismatch, 0) {
1386 ASSERT(arguments.ArgCount() ==
1387 kClosureArgumentMismatchRuntimeEntry.argument_count());
1388 const Instance& instance = Instance::Handle(); // Incorrect. OK for now.
1389 const Array& function_args = Array::Handle(); // Incorrect. OK for now.
1390 const String& function_name = String::Handle(Symbols::Call());
1391 GrowableArray<const Object*> dart_arguments(5);
1392
1393 const Object& null_object = Object::Handle();
1394 dart_arguments.Add(&instance);
1395 dart_arguments.Add(&function_name);
1396 dart_arguments.Add(&function_args);
1397 dart_arguments.Add(&null_object);
1398 Exceptions::ThrowByType(Exceptions::kNoSuchMethod, dart_arguments);
1399 UNREACHABLE();
1400 }
1401
1402
1403 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { 1383 DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
1404 ASSERT(arguments.ArgCount() == 1384 ASSERT(arguments.ArgCount() ==
1405 kStackOverflowRuntimeEntry.argument_count()); 1385 kStackOverflowRuntimeEntry.argument_count());
1406 uword stack_pos = reinterpret_cast<uword>(&arguments); 1386 uword stack_pos = reinterpret_cast<uword>(&arguments);
1407 1387
1408 // If an interrupt happens at the same time as a stack overflow, we 1388 // If an interrupt happens at the same time as a stack overflow, we
1409 // process the stack overflow first. 1389 // process the stack overflow first.
1410 if (stack_pos < isolate->saved_stack_limit()) { 1390 if (stack_pos < isolate->saved_stack_limit()) {
1411 // Use the preallocated stack overflow exception to avoid calling 1391 // Use the preallocated stack overflow exception to avoid calling
1412 // into dart code. 1392 // into dart code.
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 Isolate* isolate = Isolate::Current(); 1896 Isolate* isolate = Isolate::Current();
1917 StackZone zone(isolate); 1897 StackZone zone(isolate);
1918 HANDLESCOPE(isolate); 1898 HANDLESCOPE(isolate);
1919 const Bigint& big_left = Bigint::Handle(left); 1899 const Bigint& big_left = Bigint::Handle(left);
1920 const Bigint& big_right = Bigint::Handle(right); 1900 const Bigint& big_right = Bigint::Handle(right);
1921 return BigintOperations::Compare(big_left, big_right); 1901 return BigintOperations::Compare(big_left, big_right);
1922 } 1902 }
1923 END_LEAF_RUNTIME_ENTRY 1903 END_LEAF_RUNTIME_ENTRY
1924 1904
1925 } // namespace dart 1905 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698