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

Unified Diff: runtime/vm/kernel_binary_flowgraph.h

Issue 2776373002: Initial steps into streaming the kernel flowgraph (Closed)
Patch Set: Rebase + fix lint error 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
« no previous file with comments | « runtime/vm/kernel_binary.cc ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_binary_flowgraph.h
diff --git a/runtime/vm/kernel_binary_flowgraph.h b/runtime/vm/kernel_binary_flowgraph.h
new file mode 100644
index 0000000000000000000000000000000000000000..66ae657820be6cd38189535a915b6d06fb2081b3
--- /dev/null
+++ b/runtime/vm/kernel_binary_flowgraph.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
+#define RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+
+#include <map>
+
+#include "vm/kernel.h"
+#include "vm/kernel_binary.h"
+#include "vm/kernel_to_il.h"
+#include "vm/object.h"
+
+namespace dart {
+namespace kernel {
+
+class StreamingFlowGraphBuilder {
+ public:
+ StreamingFlowGraphBuilder(FlowGraphBuilder* flowGraph_builder,
+ const uint8_t* buffer,
+ intptr_t buffer_length)
+ : flow_graph_builder_(flowGraph_builder),
+ reader_(new kernel::Reader(buffer, buffer_length)) {}
+
+ virtual ~StreamingFlowGraphBuilder() { delete reader_; }
+
+ Fragment BuildAt(intptr_t kernel_offset);
+
+ private:
+ TokenPosition ReadPosition(bool record = true);
+
+ CatchBlock* catch_block();
+
+ Fragment DebugStepCheck(TokenPosition position);
+ Fragment LoadLocal(LocalVariable* variable);
+ Fragment PushArgument();
+ Fragment RethrowException(TokenPosition position, int catch_try_index);
+
+ Fragment BuildRethrow();
+
+ FlowGraphBuilder* flow_graph_builder_;
+ kernel::Reader* reader_;
+};
+
+} // namespace kernel
+} // namespace dart
+
+#endif // !defined(DART_PRECOMPILED_RUNTIME)
+#endif // RUNTIME_VM_KERNEL_BINARY_FLOWGRAPH_H_
« no previous file with comments | « runtime/vm/kernel_binary.cc ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698