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

Unified Diff: runtime/vm/code_generator.cc

Issue 11442010: Introduce a class encapsulating arguments descriptor arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/code_patcher_ia32.cc » ('j') | runtime/vm/dart_entry.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index ed9073110582af7dc30436a5ca5a3bc21c30357a..1c968f5e64051e50ca0c38c4b79fceb97ea67f2a 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -675,17 +675,16 @@ DEFINE_RUNTIME_ENTRY(ArgumentDefinitionTest, 3) {
const Smi& param_index = Smi::CheckedHandle(arguments.ArgAt(0));
const String& param_name = String::CheckedHandle(arguments.ArgAt(1));
ASSERT(param_name.IsSymbol());
- const Array& arg_desc = Array::CheckedHandle(arguments.ArgAt(2));
- const intptr_t num_pos_args = Smi::CheckedHandle(arg_desc.At(1)).Value();
+ ArgumentsDescriptor arg_desc(arguments.ArgAt(2));
regis 2012/12/05 18:39:24 Why did you remove the CheckedHandle here and belo
regis 2012/12/05 18:39:24 You cannot pass a raw object as parameter.
Kevin Millikin (Google) 2012/12/05 19:11:23 Here: it's not removed, the ArgumentsDescriptor co
srdjan 2012/12/05 19:34:17 We need to document when to use CheckedHandle (onl
+ const intptr_t num_pos_args = arg_desc.PositionalCount();
// Check if the formal parameter is defined by a positional argument.
bool is_defined = num_pos_args > param_index.Value();
if (!is_defined) {
// Check if the formal parameter is defined by a named argument.
- const intptr_t num_named_args =
- Smi::CheckedHandle(arg_desc.At(0)).Value() - num_pos_args;
+ const intptr_t num_named_args = arg_desc.NamedCount();
String& arg_name = String::Handle();
for (intptr_t i = 0; i < num_named_args; i++) {
- arg_name ^= arg_desc.At(2*i + 2);
+ arg_name ^= arg_desc.NameAt(i);
if (arg_name.raw() == param_name.raw()) {
is_defined = true;
break;
« no previous file with comments | « no previous file | runtime/vm/code_patcher_ia32.cc » ('j') | runtime/vm/dart_entry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698