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

Unified Diff: runtime/vm/parser.h

Issue 868913002: Add Zone-based handle allocation interface and reduce use of Isolate-based interfaces. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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/object.h ('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
===================================================================
--- runtime/vm/parser.h (revision 43075)
+++ runtime/vm/parser.h (working copy)
@@ -40,13 +40,14 @@
// The class ParsedFunction holds the result of parsing a function.
class ParsedFunction : public ZoneAllocated {
public:
- ParsedFunction(Isolate* isolate, const Function& function)
- : function_(function),
- code_(Code::Handle(isolate, function.unoptimized_code())),
+ ParsedFunction(Thread* thread, const Function& function)
+ : thread_(thread),
+ function_(function),
+ code_(Code::Handle(zone(), function.unoptimized_code())),
node_sequence_(NULL),
regexp_compile_data_(NULL),
instantiator_(NULL),
- default_parameter_values_(Array::ZoneHandle(isolate, Array::null())),
+ default_parameter_values_(Array::ZoneHandle(zone(), Array::null())),
current_context_var_(NULL),
expression_temp_var_(NULL),
finally_return_temp_var_(NULL),
@@ -58,14 +59,13 @@
num_stack_locals_(0),
have_seen_await_expr_(false),
saved_try_ctx_(NULL),
- async_saved_try_ctx_name_(String::ZoneHandle(isolate, String::null())),
- isolate_(isolate) {
+ async_saved_try_ctx_name_(String::ZoneHandle(zone(), String::null())) {
ASSERT(function.IsZoneHandle());
// Every function has a local variable for the current context.
- LocalVariable* temp = new(isolate) LocalVariable(
+ LocalVariable* temp = new(zone()) LocalVariable(
function.token_pos(),
Symbols::CurrentContextVar(),
- Type::ZoneHandle(isolate, Type::DynamicType()));
+ Type::ZoneHandle(zone(), Type::DynamicType()));
ASSERT(temp != NULL);
current_context_var_ = temp;
}
@@ -170,9 +170,12 @@
async_saved_try_ctx_name_ = String::null();
}
- Isolate* isolate() const { return isolate_; }
+ Thread* thread() const { return thread_; }
+ Isolate* isolate() const { return thread()->isolate(); }
+ Zone* zone() const { return thread()->zone(); }
private:
+ Thread* thread_;
const Function& function_;
Code& code_;
SequenceNode* node_sequence_;
@@ -193,8 +196,6 @@
LocalVariable* saved_try_ctx_;
String& async_saved_try_ctx_name_;
- Isolate* isolate_;
-
friend class Parser;
DISALLOW_COPY_AND_ASSIGN(ParsedFunction);
};
@@ -769,9 +770,11 @@
RawInstance* TryCanonicalize(const Instance& instance, intptr_t token_pos);
- Isolate* isolate() const { return isolate_; }
+ Thread* thread() const { return thread_; }
+ Isolate* isolate() const { return thread()->isolate(); }
+ Zone* zone() const { return thread()->zone(); }
- Isolate* isolate_; // Cached current isolate.
+ Thread* thread_; // Cached current thread.
Script& script_;
TokenStream::Iterator tokens_iterator_;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698