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

Unified Diff: runtime/vm/compiler.cc

Issue 1128803002: Lazily generate local var descriptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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/compiler.h ('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/compiler.cc
===================================================================
--- runtime/vm/compiler.cc (revision 45580)
+++ runtime/vm/compiler.cc (working copy)
@@ -890,7 +890,7 @@
ISL_Print("Variable Descriptors for function '%s' {\n",
function_fullname);
const LocalVarDescriptors& var_descriptors =
- LocalVarDescriptors::Handle(code.var_descriptors());
+ LocalVarDescriptors::Handle(code.GetLocalVarDescriptors());
intptr_t var_desc_length =
var_descriptors.IsNull() ? 0 : var_descriptors.Length();
String& var_name = String::Handle();
@@ -1129,6 +1129,24 @@
}
+void Compiler::ComputeLocalVarDescriptors(const Code& code) {
+ ASSERT(!code.is_optimized());
+ const Function& function = Function::Handle(code.function());
+ ParsedFunction* parsed_function = new ParsedFunction(
+ Thread::Current(), Function::ZoneHandle(function.raw()));
+ LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle();
+ if (function.IsIrregexpFunction()) {
+ UNREACHABLE(); // Special parsing needed, not yet implemented.
+ } else {
+ Parser::ParseFunction(parsed_function);
+ parsed_function->AllocateVariables();
+ var_descs =
+ parsed_function->node_sequence()->scope()->GetVarDescriptors(function);
+ }
+ code.set_var_descriptors(var_descs);
+}
+
+
RawError* Compiler::CompileAllFunctions(const Class& cls) {
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698