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

Side by Side Diff: runtime/vm/kernel_to_il.cc

Issue 2790093002: Hacky streaming of VariableGet (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 8
9 #include "vm/kernel_to_il.h" 9 #include "vm/kernel_to_il.h"
10 10
(...skipping 2896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 2907
2908 2908
2909 dart::LocalVariable* FlowGraphBuilder::LookupVariable( 2909 dart::LocalVariable* FlowGraphBuilder::LookupVariable(
2910 VariableDeclaration* var) { 2910 VariableDeclaration* var) {
2911 LocalVariable* local = scopes_->locals.Lookup(var->kernel_offset()); 2911 LocalVariable* local = scopes_->locals.Lookup(var->kernel_offset());
2912 ASSERT(local != NULL); 2912 ASSERT(local != NULL);
2913 return local; 2913 return local;
2914 } 2914 }
2915 2915
2916 2916
2917 dart::LocalVariable* FlowGraphBuilder::LookupVariable(intptr_t kernel_offset) {
2918 LocalVariable* local = scopes_->locals.Lookup(kernel_offset);
2919 ASSERT(local != NULL);
2920 return local;
2921 }
2922
2923
2917 void FlowGraphBuilder::SetTempIndex(Definition* definition) { 2924 void FlowGraphBuilder::SetTempIndex(Definition* definition) {
2918 definition->set_temp_index( 2925 definition->set_temp_index(
2919 stack_ == NULL ? 0 : stack_->definition()->temp_index() + 1); 2926 stack_ == NULL ? 0 : stack_->definition()->temp_index() + 1);
2920 } 2927 }
2921 2928
2922 2929
2923 void FlowGraphBuilder::Push(Definition* definition) { 2930 void FlowGraphBuilder::Push(Definition* definition) {
2924 SetTempIndex(definition); 2931 SetTempIndex(definition);
2925 Value::AddToList(new (Z) Value(definition), &stack_); 2932 Value::AddToList(new (Z) Value(definition), &stack_);
2926 } 2933 }
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
4632 instructions += Constant(type); 4639 instructions += Constant(type);
4633 } else { 4640 } else {
4634 instructions += LoadInstantiatorTypeArguments(); 4641 instructions += LoadInstantiatorTypeArguments();
4635 instructions += InstantiateType(type); 4642 instructions += InstantiateType(type);
4636 } 4643 }
4637 fragment_ = instructions; 4644 fragment_ = instructions;
4638 } 4645 }
4639 4646
4640 4647
4641 void FlowGraphBuilder::VisitVariableGet(VariableGet* node) { 4648 void FlowGraphBuilder::VisitVariableGet(VariableGet* node) {
4642 fragment_ = LoadLocal(LookupVariable(node->variable())); 4649 fragment_ = streaming_flow_graph_builder_->BuildAt(node->kernel_offset());
4643 } 4650 }
4644 4651
4645 4652
4646 void FlowGraphBuilder::VisitVariableSet(VariableSet* node) { 4653 void FlowGraphBuilder::VisitVariableSet(VariableSet* node) {
4647 Fragment instructions = TranslateExpression(node->expression()); 4654 Fragment instructions = TranslateExpression(node->expression());
4648 if (NeedsDebugStepCheck(stack_, node->position())) { 4655 if (NeedsDebugStepCheck(stack_, node->position())) {
4649 instructions = DebugStepCheck(node->position()) + instructions; 4656 instructions = DebugStepCheck(node->position()) + instructions;
4650 } 4657 }
4651 instructions += CheckVariableTypeInCheckedMode(node->variable()); 4658 instructions += CheckVariableTypeInCheckedMode(node->variable());
4652 instructions += 4659 instructions +=
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after
6464 thread->clear_sticky_error(); 6471 thread->clear_sticky_error();
6465 return error.raw(); 6472 return error.raw();
6466 } 6473 }
6467 } 6474 }
6468 6475
6469 6476
6470 } // namespace kernel 6477 } // namespace kernel
6471 } // namespace dart 6478 } // namespace dart
6472 6479
6473 #endif // !defined(DART_PRECOMPILED_RUNTIME) 6480 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« pkg/kernel/lib/binary/ast_to_binary.dart ('K') | « runtime/vm/kernel_to_il.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698