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

Unified Diff: runtime/vm/code_descriptors_test.cc

Issue 678763004: Make CTX allocatable by the register allocator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: incorporated latest comments Created 6 years, 2 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
Index: runtime/vm/code_descriptors_test.cc
===================================================================
--- runtime/vm/code_descriptors_test.cc (revision 41393)
+++ runtime/vm/code_descriptors_test.cc (working copy)
@@ -21,22 +21,8 @@
CODEGEN_TEST_GENERATE(StackmapCodegen, test) {
- Assembler assembler;
- const String& function_name = String::ZoneHandle(Symbols::New("test"));
- Class& cls = Class::ZoneHandle();
- const Script& script = Script::Handle();
- cls = Class::New(function_name, script, Scanner::kNoSourcePos);
- const Function& function = Function::ZoneHandle(
- Function::New(function_name, RawFunction::kRegularFunction,
- true, false, false, false, false, cls, 0));
- function.set_result_type(Type::Handle(Type::DynamicType()));
- const Array& functions = Array::Handle(Array::New(1));
- functions.SetAt(0, function);
- cls.SetFunctions(functions);
- Library& lib = Library::Handle(Library::CoreLibrary());
- lib.AddClass(cls);
ParsedFunction* parsed_function =
- new ParsedFunction(Isolate::Current(), function);
+ new ParsedFunction(Isolate::Current(), test->function());
LiteralNode* l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(1)));
test->node_sequence()->Add(new ReturnNode(kPos, l));
l = new LiteralNode(kPos, Smi::ZoneHandle(Smi::New(2)));
@@ -46,6 +32,11 @@
parsed_function->SetNodeSequence(test->node_sequence());
parsed_function->set_instantiator(NULL);
parsed_function->set_default_parameter_values(Object::null_array());
+ parsed_function->EnsureExpressionTemp();
+ test->node_sequence()->scope()->AddVariable(
+ parsed_function->expression_temp_var());
+ test->node_sequence()->scope()->AddVariable(
+ parsed_function->current_context_var());
parsed_function->AllocateVariables();
bool retval;
Isolate* isolate = Isolate::Current();
@@ -133,7 +124,7 @@
const Error& error =
Error::Handle(Compiler::CompileParsedFunction(parsed_function));
EXPECT(error.IsNull());
- const Code& code = Code::Handle(function.CurrentCode());
+ const Code& code = Code::Handle(test->function().CurrentCode());
const Array& stack_maps =
Array::Handle(stackmap_table_builder->FinalizeStackmaps(code));
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/compiler.cc » ('j') | runtime/vm/debugger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698