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

Unified Diff: runtime/vm/parser.h

Issue 1242343002: Remove more uses of Isolate::current_zone. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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/native_entry.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « runtime/vm/native_entry.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698