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

Unified Diff: runtime/vm/parser.h

Issue 1051713005: Avoid caching thread in parser. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « no previous file | 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
===================================================================
--- runtime/vm/parser.h (revision 44851)
+++ runtime/vm/parser.h (working copy)
@@ -41,7 +41,7 @@
class ParsedFunction : public ZoneAllocated {
public:
ParsedFunction(Thread* thread, const Function& function)
- : thread_(thread),
+ : isolate_(thread->isolate()),
function_(function),
code_(Code::Handle(zone(), function.unoptimized_code())),
node_sequence_(NULL),
@@ -150,12 +150,11 @@
void record_await() { have_seen_await_expr_ = true; }
bool have_seen_await() const { return have_seen_await_expr_; }
- Thread* thread() const { return thread_; }
- Isolate* isolate() const { return thread()->isolate(); }
- Zone* zone() const { return thread()->zone(); }
+ Isolate* isolate() const { return isolate_; }
+ Zone* zone() const { return isolate()->current_zone(); }
private:
- Thread* thread_;
+ Isolate* isolate_;
const Function& function_;
Code& code_;
SequenceNode* node_sequence_;
@@ -797,11 +796,10 @@
RawInstance* TryCanonicalize(const Instance& instance, intptr_t token_pos);
- Thread* thread() const { return thread_; }
- Isolate* isolate() const { return thread()->isolate(); }
- Zone* zone() const { return thread()->zone(); }
+ Isolate* isolate() const { return isolate_; }
+ Zone* zone() const { return isolate()->current_zone(); }
- Thread* thread_; // Cached current thread.
+ Isolate* isolate_; // Cached current isolate.
Script& script_;
TokenStream::Iterator tokens_iterator_;
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698