Chromium Code Reviews| Index: runtime/vm/compiler.cc |
| =================================================================== |
| --- runtime/vm/compiler.cc (revision 45548) |
| +++ 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,33 @@ |
| } |
| +void Compiler::ComputeLocalVarDescriptors(const Code& code) { |
|
hausner
2015/05/06 16:39:54
This code is now duplicated (also present in the F
srdjan
2015/05/06 20:00:47
Removed it from here; FlowGraphCompiler::FinalizeV
|
| + 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. |
| + var_descs = LocalVarDescriptors::New(1); |
|
hausner
2015/05/06 16:39:54
Should the code after UNREACHABLE() remain?
srdjan
2015/05/06 20:00:47
Removed, will add it back once functionality imple
|
| + RawLocalVarDescriptors::VarInfo info; |
| + info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); |
| + info.scope_id = 0; |
| + info.begin_pos = 0; |
| + info.end_pos = 0; |
| + info.set_index(parsed_function->current_context_var()->index()); |
| + var_descs.SetVar(0, Symbols::CurrentContextVar(), &info); |
| + } else { |
| + Parser::ParseFunction(parsed_function); |
| + parsed_function->AllocateVariables(); |
| + var_descs = |
| + parsed_function->node_sequence()->scope()->GetVarDescriptors( |
| + parsed_function->function()); |
|
hausner
2015/05/06 16:39:54
Could you not use function here instead of parsed_
srdjan
2015/05/06 20:00:47
Done.
|
| + } |
| + code.set_var_descriptors(var_descs); |
| +} |
| + |
| + |
| RawError* Compiler::CompileAllFunctions(const Class& cls) { |
| Thread* thread = Thread::Current(); |
| Zone* zone = thread->zone(); |