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

Unified Diff: runtime/vm/dart_entry.cc

Issue 9475031: Cleaned up usage of Function::code, since it may be misunderstood that it points to the only Code o… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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/compiler.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
===================================================================
--- runtime/vm/dart_entry.cc (revision 4655)
+++ runtime/vm/dart_entry.cc (working copy)
@@ -26,10 +26,6 @@
return error.raw();
}
}
- const Code& code = Code::Handle(function.code());
- ASSERT(!code.IsNull());
- const Instructions& instrs = Instructions::Handle(code.instructions());
- ASSERT(!instrs.IsNull());
// Set up arguments to include the receiver as the first argument.
const int num_arguments = arguments.length() + 1;
@@ -39,15 +35,16 @@
for (int i = 1; i < num_arguments; i++) {
args.Add(arguments[i - 1]);
}
-
// Now Call the invoke stub which will invoke the dart function.
invokestub entrypoint = reinterpret_cast<invokestub>(
StubCode::InvokeDartCodeEntryPoint());
const Context& context =
Context::ZoneHandle(Isolate::Current()->object_store()->empty_context());
ASSERT(context.isolate() == Isolate::Current());
+ const Code& code = Code::Handle(function.CurrentCode());
+ ASSERT(!code.IsNull());
return entrypoint(
- instrs.EntryPoint(),
+ code.EntryPoint(),
CodeGenerator::ArgumentsDescriptor(num_arguments,
optional_arguments_names),
args.data(),
@@ -69,19 +66,16 @@
return error.raw();
}
}
- const Code& code = Code::Handle(function.code());
- ASSERT(!code.IsNull());
- const Instructions& instrs = Instructions::Handle(code.instructions());
- ASSERT(!instrs.IsNull());
-
// Now Call the invoke stub which will invoke the dart function.
invokestub entrypoint = reinterpret_cast<invokestub>(
StubCode::InvokeDartCodeEntryPoint());
const Context& context =
Context::ZoneHandle(Isolate::Current()->object_store()->empty_context());
ASSERT(context.isolate() == Isolate::Current());
+ const Code& code = Code::Handle(function.CurrentCode());
+ ASSERT(!code.IsNull());
return entrypoint(
- instrs.EntryPoint(),
+ code.EntryPoint(),
CodeGenerator::ArgumentsDescriptor(arguments.length(),
optional_arguments_names),
arguments.data(),
@@ -106,17 +100,14 @@
return error.raw();
}
}
- const Code& code = Code::Handle(function.code());
- ASSERT(!code.IsNull());
- const Instructions& instrs = Instructions::Handle(code.instructions());
- ASSERT(!instrs.IsNull());
-
// Now Call the invoke stub which will invoke the closure.
invokestub entrypoint = reinterpret_cast<invokestub>(
StubCode::InvokeDartCodeEntryPoint());
ASSERT(context.isolate() == Isolate::Current());
+ const Code& code = Code::Handle(function.CurrentCode());
+ ASSERT(!code.IsNull());
return entrypoint(
- instrs.EntryPoint(),
+ code.EntryPoint(),
CodeGenerator::ArgumentsDescriptor(arguments.length(),
optional_arguments_names),
arguments.data(),
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698