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

Unified Diff: runtime/vm/code_generator_test.cc

Issue 293013005: Fix issue 18435 (2nd attempt). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/ast_printer.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_test.cc
===================================================================
--- runtime/vm/code_generator_test.cc (revision 36398)
+++ runtime/vm/code_generator_test.cc (working copy)
@@ -58,7 +58,7 @@
const int num_params = 1;
LocalVariable* parameter = NewTestLocalVariable("parameter");
LocalScope* local_scope = node_seq->scope();
- local_scope->AddVariable(parameter);
+ local_scope->InsertParameterAt(0, parameter);
ASSERT(local_scope->num_variables() == num_params);
const Function& function = test->function();
function.set_num_fixed_parameters(num_params);
@@ -88,8 +88,8 @@
const int num_locals = 1;
LocalVariable* sum = NewTestLocalVariable("sum");
LocalScope* local_scope = node_seq->scope();
- local_scope->AddVariable(param1);
- local_scope->AddVariable(param2);
+ local_scope->InsertParameterAt(0, param1);
+ local_scope->InsertParameterAt(1, param2);
local_scope->AddVariable(sum);
ASSERT(local_scope->num_variables() == num_params + num_locals);
const Function& function = test->function();
@@ -206,8 +206,8 @@
const int num_opt_params = 1;
const int num_params = num_fixed_params + num_opt_params;
LocalScope* local_scope = node_seq->scope();
- local_scope->AddVariable(NewTestLocalVariable("a"));
- local_scope->AddVariable(NewTestLocalVariable("b"));
+ local_scope->InsertParameterAt(0, NewTestLocalVariable("a"));
+ local_scope->InsertParameterAt(1, NewTestLocalVariable("b"));
ASSERT(local_scope->num_variables() == num_params);
const Array& default_values = Array::ZoneHandle(Array::New(num_opt_params));
default_values.SetAt(0, Smi::ZoneHandle(Smi::New(1))); // b = 1.
@@ -377,11 +377,11 @@
const int num_opt_params = 3;
const int num_params = num_fixed_params + num_opt_params;
LocalScope* local_scope = node_seq->scope();
- local_scope->AddVariable(NewTestLocalVariable("a"));
- local_scope->AddVariable(NewTestLocalVariable("b"));
- local_scope->AddVariable(NewTestLocalVariable("c"));
- local_scope->AddVariable(NewTestLocalVariable("d"));
- local_scope->AddVariable(NewTestLocalVariable("e"));
+ local_scope->InsertParameterAt(0, NewTestLocalVariable("a"));
+ local_scope->InsertParameterAt(1, NewTestLocalVariable("b"));
+ local_scope->InsertParameterAt(2, NewTestLocalVariable("c"));
+ local_scope->InsertParameterAt(3, NewTestLocalVariable("d"));
+ local_scope->InsertParameterAt(4, NewTestLocalVariable("e"));
ASSERT(local_scope->num_variables() == num_params);
const Array& default_values = Array::ZoneHandle(Array::New(num_opt_params));
default_values.SetAt(0, Smi::ZoneHandle(Smi::New(10)));
@@ -474,9 +474,9 @@
SequenceNode* node_seq = test->node_sequence();
const int num_params = 3;
LocalScope* local_scope = node_seq->scope();
- local_scope->AddVariable(NewTestLocalVariable("a"));
- local_scope->AddVariable(NewTestLocalVariable("b"));
- local_scope->AddVariable(NewTestLocalVariable("c"));
+ local_scope->InsertParameterAt(0, NewTestLocalVariable("a"));
+ local_scope->InsertParameterAt(1, NewTestLocalVariable("b"));
+ local_scope->InsertParameterAt(2, NewTestLocalVariable("c"));
ASSERT(local_scope->num_variables() == num_params);
const Function& function = test->function();
function.set_is_native(true);
« no previous file with comments | « runtime/vm/ast_printer.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698