Index: runtime/vm/kernel.h |
diff --git a/runtime/vm/kernel.h b/runtime/vm/kernel.h |
index 54f1b9ab9b67b2eb59d4fe8780fc46b3ce3a6a43..e1263e09a4c6a94561f3655a67500fd6179c5040 100644 |
--- a/runtime/vm/kernel.h |
+++ b/runtime/vm/kernel.h |
@@ -260,6 +260,12 @@ class String { |
static String* ReadFrom(Reader* reader); |
static String* ReadFromImpl(Reader* reader); |
+ explicit String(const char* contents) { |
+ size_ = strlen(contents); |
+ buffer_ = new uint8_t[size_]; // No trailing '\0'. |
+ memmove(buffer_, contents, size_); |
+ } |
+ |
String(const uint8_t* utf8, int length) { |
buffer_ = new uint8_t[length]; |
size_ = length; |
@@ -397,10 +403,10 @@ class CanonicalName { |
private: |
CanonicalName(); |
- bool is_referenced_; |
- Ref<CanonicalName> parent_; |
- Ref<String> name_; |
+ CanonicalName* parent_; |
+ String* name_; |
MallocGrowableArray<CanonicalName*> children_; |
+ bool is_referenced_; |
DISALLOW_COPY_AND_ASSIGN(CanonicalName); |
}; |
@@ -970,7 +976,10 @@ class FunctionNode : public TreeNode { |
} |
List<VariableDeclaration>& named_parameters() { return named_parameters_; } |
DartType* return_type() { return return_type_; } |
+ |
Statement* body() { return body_; } |
+ void set_body(Statement* body) { body_ = body; } |
kustermann
2017/04/05 11:47:07
This only works if body_ is NULL before (Child<Sta
Kevin Millikin (Google)
2017/04/25 18:20:29
Yes. We could assert, but since operator= does it
|
+ |
TokenPosition position() { return position_; } |
TokenPosition end_position() { return end_position_; } |
@@ -1186,6 +1195,8 @@ class DirectPropertySet : public Expression { |
class StaticGet : public Expression { |
public: |
+ explicit StaticGet(CanonicalName* target) : target_reference_(target) {} |
+ |
static StaticGet* ReadFrom(Reader* reader); |
virtual ~StaticGet(); |
@@ -2312,6 +2323,8 @@ class IfStatement : public Statement { |
class ReturnStatement : public Statement { |
public: |
+ explicit ReturnStatement(Expression* expression) : expression_(expression) {} |
+ |
static ReturnStatement* ReadFrom(Reader* reader); |
virtual ~ReturnStatement(); |