| Index: runtime/vm/kernel_to_il.cc
 | 
| diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
 | 
| index 1e0a4064281dc05de46799efd2c132fd3fa5ad7c..0fc5196ca90ca2f30cd5e5e512aedfbd20607d1c 100644
 | 
| --- a/runtime/vm/kernel_to_il.cc
 | 
| +++ b/runtime/vm/kernel_to_il.cc
 | 
| @@ -61,8 +61,7 @@ static void DiscoverEnclosingElements(Zone* zone,
 | 
|  void ScopeBuilder::EnterScope(TreeNode* node, TokenPosition start_position) {
 | 
|    scope_ = new (Z) LocalScope(scope_, depth_.function_, depth_.loop_);
 | 
|    scope_->set_begin_token_pos(start_position);
 | 
| -  ASSERT(node->kernel_offset() >= 0);
 | 
| -  result_->scopes.Insert(node->kernel_offset(), scope_);
 | 
| +  result_->scopes.Insert(node, scope_);
 | 
|  }
 | 
|  
 | 
|  
 | 
| @@ -101,7 +100,7 @@ void ScopeBuilder::AddParameter(VariableDeclaration* declaration,
 | 
|      variable->set_is_final();
 | 
|    }
 | 
|    scope_->InsertParameterAt(pos, variable);
 | 
| -  result_->locals.Insert(declaration->kernel_offset(), variable);
 | 
| +  result_->locals.Insert(declaration, variable);
 | 
|  
 | 
|    // The default value may contain 'let' bindings for which the constant
 | 
|    // evaluator needs scope bindings.
 | 
| @@ -186,8 +185,7 @@ void ScopeBuilder::AddIteratorVariable() {
 | 
|  
 | 
|  
 | 
|  void ScopeBuilder::LookupVariable(VariableDeclaration* declaration) {
 | 
| -  LocalVariable* variable =
 | 
| -      result_->locals.Lookup(declaration->kernel_offset());
 | 
| +  LocalVariable* variable = result_->locals.Lookup(declaration);
 | 
|    if (variable == NULL) {
 | 
|      // We have not seen a declaration of the variable, so it must be the
 | 
|      // case that we are compiling a nested function and the variable is
 | 
| @@ -197,7 +195,7 @@ void ScopeBuilder::LookupVariable(VariableDeclaration* declaration) {
 | 
|      const dart::String& name = H.DartSymbol(declaration->name());
 | 
|      variable = current_function_scope_->parent()->LookupVariable(name, true);
 | 
|      ASSERT(variable != NULL);
 | 
| -    result_->locals.Insert(declaration->kernel_offset(), variable);
 | 
| +    result_->locals.Insert(declaration, variable);
 | 
|    }
 | 
|    if (variable->owner()->function_level() < scope_->function_level()) {
 | 
|      // We call `LocalScope->CaptureVariable(variable)` in two scenarios for two
 | 
| @@ -251,7 +249,7 @@ void ScopeBuilder::AddVariable(VariableDeclaration* declaration) {
 | 
|      variable->set_is_final();
 | 
|    }
 | 
|    scope_->AddVariable(variable);
 | 
| -  result_->locals.Insert(declaration->kernel_offset(), variable);
 | 
| +  result_->locals.Insert(declaration, variable);
 | 
|  }
 | 
|  
 | 
|  
 | 
| @@ -494,7 +492,7 @@ void ScopeBuilder::HandleLocalFunction(TreeNode* parent,
 | 
|    current_function_scope_ = scope_;
 | 
|    current_function_node_ = function;
 | 
|    if (depth_.function_ == 1) {
 | 
| -    FunctionScope function_scope = {function->kernel_offset(), scope_};
 | 
| +    FunctionScope function_scope = {function, scope_};
 | 
|      result_->function_scopes.Add(function_scope);
 | 
|    }
 | 
|    AddParameters(function);
 | 
| @@ -2016,7 +2014,7 @@ Fragment FlowGraphBuilder::TranslateFinallyFinalizers(
 | 
|  Fragment FlowGraphBuilder::EnterScope(TreeNode* node, bool* new_context) {
 | 
|    Fragment instructions;
 | 
|    const intptr_t context_size =
 | 
| -      scopes_->scopes.Lookup(node->kernel_offset())->num_context_variables();
 | 
| +      scopes_->scopes.Lookup(node)->num_context_variables();
 | 
|    if (context_size > 0) {
 | 
|      instructions += PushContext(context_size);
 | 
|      instructions += Drop();
 | 
| @@ -2031,7 +2029,7 @@ Fragment FlowGraphBuilder::EnterScope(TreeNode* node, bool* new_context) {
 | 
|  Fragment FlowGraphBuilder::ExitScope(TreeNode* node) {
 | 
|    Fragment instructions;
 | 
|    const intptr_t context_size =
 | 
| -      scopes_->scopes.Lookup(node->kernel_offset())->num_context_variables();
 | 
| +      scopes_->scopes.Lookup(node)->num_context_variables();
 | 
|    if (context_size > 0) {
 | 
|      instructions += PopContext();
 | 
|    }
 | 
| @@ -2884,7 +2882,7 @@ intptr_t FlowGraphBuilder::CurrentTryIndex() {
 | 
|  
 | 
|  dart::LocalVariable* FlowGraphBuilder::LookupVariable(
 | 
|      VariableDeclaration* var) {
 | 
| -  LocalVariable* local = scopes_->locals.Lookup(var->kernel_offset());
 | 
| +  LocalVariable* local = scopes_->locals.Lookup(var);
 | 
|    ASSERT(local != NULL);
 | 
|    return local;
 | 
|  }
 | 
| @@ -6259,9 +6257,7 @@ Fragment FlowGraphBuilder::TranslateFunctionNode(FunctionNode* node,
 | 
|    // function and token position.
 | 
|    Function& function = Function::ZoneHandle(Z);
 | 
|    for (intptr_t i = 0; i < scopes_->function_scopes.length(); ++i) {
 | 
| -    if (scopes_->function_scopes[i].kernel_offset != node->kernel_offset()) {
 | 
| -      continue;
 | 
| -    }
 | 
| +    if (scopes_->function_scopes[i].function != node) continue;
 | 
|  
 | 
|      TokenPosition position = node->position();
 | 
|      if (parent->IsFunctionDeclaration()) {
 | 
| 
 |