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

Unified Diff: runtime/vm/kernel_binary_flowgraph.cc

Issue 2790093002: Hacky streaming of VariableGet (Closed)
Patch Set: Created 3 years, 9 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
Index: runtime/vm/kernel_binary_flowgraph.cc
diff --git a/runtime/vm/kernel_binary_flowgraph.cc b/runtime/vm/kernel_binary_flowgraph.cc
index 3fdd7a26aba7510267d8ee8b9e0e6a81561bb2f8..000edc55b485c995654244c0cfd2bfe521015c47 100644
--- a/runtime/vm/kernel_binary_flowgraph.cc
+++ b/runtime/vm/kernel_binary_flowgraph.cc
@@ -214,10 +214,10 @@ Fragment StreamingFlowGraphBuilder::BuildAt(intptr_t kernel_offset) {
switch (tag) {
case kInvalidExpression:
return BuildInvalidExpression();
- // case kVariableGet:
- // return VariableGet::ReadFrom(reader_);
- // case kSpecializedVariableGet:
- // return VariableGet::ReadFrom(reader_, payload);
+ case kVariableGet:
+ return BuildVariableGet();
+ case kSpecializedVariableGet:
+ return BuildVariableGet(payload);
// case kVariableSet:
// return VariableSet::ReadFrom(reader_);
// case kSpecializedVariableSet:
@@ -483,6 +483,11 @@ String* StreamingFlowGraphBuilder::KernelString(intptr_t str_index) {
return new String(data, bytes);
}
+dart::LocalVariable* StreamingFlowGraphBuilder::LookupVariable(
+ intptr_t kernel_offset) {
+ return flow_graph_builder_->LookupVariable(kernel_offset);
+}
+
Fragment StreamingFlowGraphBuilder::DebugStepCheck(TokenPosition position) {
return flow_graph_builder_->DebugStepCheck(position);
}
@@ -529,6 +534,27 @@ Fragment StreamingFlowGraphBuilder::BuildInvalidExpression() {
return ThrowNoSuchMethodError();
}
+Fragment StreamingFlowGraphBuilder::BuildVariableGet() {
+ ReadPosition();
+ intptr_t variable_kernel_position = ReadUInt();
+ ReadUInt(); // Variable index.
+
+ // TODO(jensj): This is actually a "reader->ReadOptional<DartType>();".
+ // Optional type below: Not currently implemented.
+ Tag tag = ReadTag();
+ if (tag != kNothing) {
+ UNIMPLEMENTED();
+ }
+
+ return LoadLocal(LookupVariable(variable_kernel_position));
+}
+
+Fragment StreamingFlowGraphBuilder::BuildVariableGet(uint8_t payload) {
+ ReadPosition();
+ intptr_t variable_kernel_position = ReadUInt();
+ return LoadLocal(LookupVariable(variable_kernel_position));
+}
+
Fragment StreamingFlowGraphBuilder::BuildStaticGet() {
intptr_t saved_offset = ReaderOffset() - 1; // Include the tag.
TokenPosition position = ReadPosition();

Powered by Google App Engine
This is Rietveld 408576698