| Index: runtime/vm/flow_graph_compiler.cc
|
| diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
|
| index 5bb8e098ba2873e0f5a3a4d6bf5e93fc4ce60fc4..1a7854f55314e1edf14c4e4de7d806203dc0b6b0 100644
|
| --- a/runtime/vm/flow_graph_compiler.cc
|
| +++ b/runtime/vm/flow_graph_compiler.cc
|
| @@ -19,6 +19,7 @@
|
| #include "vm/longjump.h"
|
| #include "vm/object_store.h"
|
| #include "vm/parser.h"
|
| +#include "vm/raw_object.h"
|
| #include "vm/stack_frame.h"
|
| #include "vm/stub_code.h"
|
| #include "vm/symbols.h"
|
| @@ -228,7 +229,8 @@ static bool IsEmptyBlock(BlockEntryInstr* block) {
|
| return !block->IsCatchBlockEntry() &&
|
| !block->HasNonRedundantParallelMove() &&
|
| block->next()->IsGoto() &&
|
| - !block->next()->AsGoto()->HasNonRedundantParallelMove();
|
| + !block->next()->AsGoto()->HasNonRedundantParallelMove() &&
|
| + !block->IsIndirectEntry();
|
| }
|
|
|
|
|
| @@ -355,6 +357,7 @@ void FlowGraphCompiler::VisitBlocks() {
|
|
|
| LoopInfoComment(assembler(), *entry, *loop_headers);
|
|
|
| + entry->set_offset(assembler()->CodeSize());
|
| entry->EmitNativeCode(this);
|
| // Compile all successors until an exit, branch, or a block entry.
|
| for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
|
| @@ -827,9 +830,22 @@ void FlowGraphCompiler::FinalizeStackmaps(const Code& code) {
|
|
|
|
|
| void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) {
|
| - const LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle(
|
| - parsed_function_.node_sequence()->scope()->GetVarDescriptors(
|
| - parsed_function_.function()));
|
| + LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle();
|
| + if (parsed_function().node_sequence() == NULL) {
|
| + ASSERT(flow_graph().IsIrregexpFunction());
|
| + var_descs = LocalVarDescriptors::New(1);
|
| + 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 {
|
| + var_descs =
|
| + parsed_function_.node_sequence()->scope()->GetVarDescriptors(
|
| + parsed_function_.function());
|
| + }
|
| code.set_var_descriptors(var_descs);
|
| }
|
|
|
|
|