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

Unified Diff: runtime/vm/kernel.h

Issue 2854393002: [kernel] [partial] Streaming of kernel binary without AST nodes (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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/kernel.h
diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h
index a7950be8d390a88bcda65c60bff3d8b0a9f762f0..6c18cc3d845524a6894efc716abaa169d4455718 100644
--- a/runtime/vm/kernel.h
+++ b/runtime/vm/kernel.h
@@ -229,6 +229,13 @@ class List {
T** raw_array() { return array_; }
+ bool cannot_stream() {
Kevin Millikin (Google) 2017/05/11 10:38:35 This should be CanStream. Capitalized because of
jensj 2017/05/11 12:59:25 Done.
+ for (intptr_t i = 0; i < length_; ++i) {
+ if (array_[i]->cannot_stream()) return true;
+ }
+ return false;
+ }
+
private:
T** array_;
int length_;
@@ -386,14 +393,17 @@ class TreeNode : public Node {
virtual void AcceptVisitor(Visitor* visitor);
virtual void AcceptTreeVisitor(TreeVisitor* visitor) = 0;
intptr_t kernel_offset() const { return kernel_offset_; }
+ bool cannot_stream() { return cannot_stream_; }
protected:
- TreeNode() : kernel_offset_(-1) {}
+ TreeNode() : kernel_offset_(-1), cannot_stream_(false) {}
// Offset for this node in the kernel-binary. If this node has a tag the
// offset includes the tag. Can be -1 to indicate "unknown" or invalid offset.
intptr_t kernel_offset_;
+ bool cannot_stream_;
+
private:
DISALLOW_COPY_AND_ASSIGN(TreeNode);
};
@@ -1019,6 +1029,7 @@ class VariableGet : public Expression {
VariableGet() {}
Ref<VariableDeclaration> variable_;
+ intptr_t variable_kernel_offset_;
DISALLOW_COPY_AND_ASSIGN(VariableGet);
};
@@ -1043,6 +1054,7 @@ class VariableSet : public Expression {
VariableSet() {}
Ref<VariableDeclaration> variable_;
+ intptr_t variable_kernel_offset_;
Child<Expression> expression_;
DISALLOW_COPY_AND_ASSIGN(VariableSet);
@@ -1153,7 +1165,10 @@ class DirectPropertySet : public Expression {
class StaticGet : public Expression {
public:
- explicit StaticGet(CanonicalName* target) : target_reference_(target) {}
+ StaticGet(CanonicalName* target, bool cannot_stream)
+ : target_reference_(target) {
+ cannot_stream_ = cannot_stream;
+ }
static StaticGet* ReadFrom(Reader* reader);
@@ -2173,12 +2188,12 @@ class BreakStatement : public Statement {
virtual void AcceptStatementVisitor(StatementVisitor* visitor);
virtual void VisitChildren(Visitor* visitor);
- LabeledStatement* target() { return target_; }
+ intptr_t target_index() { return target_index_; }
private:
BreakStatement() {}
- Ref<LabeledStatement> target_;
+ intptr_t target_index_;
DISALLOW_COPY_AND_ASSIGN(BreakStatement);
};
@@ -2364,12 +2379,12 @@ class ContinueSwitchStatement : public Statement {
virtual void AcceptStatementVisitor(StatementVisitor* visitor);
virtual void VisitChildren(Visitor* visitor);
- SwitchCase* target() { return target_; }
+ intptr_t target_index() { return target_index_; }
private:
ContinueSwitchStatement() {}
- Ref<SwitchCase> target_;
+ intptr_t target_index_;
DISALLOW_COPY_AND_ASSIGN(ContinueSwitchStatement);
};
@@ -2403,7 +2418,10 @@ class IfStatement : public Statement {
class ReturnStatement : public Statement {
public:
- explicit ReturnStatement(Expression* expression) : expression_(expression) {}
+ explicit ReturnStatement(Expression* expression, bool cannot_stream)
Kevin Millikin (Google) 2017/05/11 10:38:35 No need for explicit unless it takes only one argu
jensj 2017/05/11 12:59:25 Done.
+ : expression_(expression) {
+ cannot_stream_ = cannot_stream;
+ }
static ReturnStatement* ReadFrom(Reader* reader);

Powered by Google App Engine
This is Rietveld 408576698