Index: runtime/vm/parser.h |
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h |
index 9cab860ca46fa309c9d15980512bc09d7d499d97..4fa8f7573f1c20a1968d1894561278602997d08d 100644 |
--- a/runtime/vm/parser.h |
+++ b/runtime/vm/parser.h |
@@ -42,6 +42,7 @@ class ParsedFunction : public ZoneAllocated { |
public: |
ParsedFunction(Thread* thread, const Function& function) |
: isolate_(thread->isolate()), |
+ thread_(thread), |
function_(function), |
code_(Code::Handle(zone(), function.unoptimized_code())), |
node_sequence_(NULL), |
@@ -151,10 +152,11 @@ class ParsedFunction : public ZoneAllocated { |
bool have_seen_await() const { return have_seen_await_expr_; } |
Isolate* isolate() const { return isolate_; } |
- Zone* zone() const { return isolate()->current_zone(); } |
+ Zone* zone() const { return thread_->zone(); } |
private: |
Isolate* isolate_; |
+ Thread* thread_; |
const Function& function_; |
Code& code_; |
SequenceNode* node_sequence_; |
@@ -807,9 +809,10 @@ class Parser : public ValueObject { |
RawInstance* TryCanonicalize(const Instance& instance, intptr_t token_pos); |
Isolate* isolate() const { return isolate_; } |
- Zone* zone() const { return isolate()->current_zone(); } |
+ Zone* zone() const { return thread_->zone(); } |
Isolate* isolate_; // Cached current isolate. |
siva
2015/07/21 15:47:20
Do you need to cache the current isolate like this
koda
2015/07/21 16:29:29
Done.
|
+ Thread* thread_; |
Script& script_; |
TokenStream::Iterator tokens_iterator_; |