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

Unified Diff: src/preparser.h

Issue 868883002: Remove the dependency of Zone on Isolate (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation issues 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 | « src/parser.cc ('k') | src/prettyprinter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 5e37d632fdb8bffbf9e767da466a1eff34ec3c1e..e2929b827d238d120528f2393a0160b1b3c4aaa0 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -68,9 +68,9 @@ class ParserBase : public Traits {
typedef typename Traits::Type::Literal LiteralT;
typedef typename Traits::Type::ObjectLiteralProperty ObjectLiteralPropertyT;
- ParserBase(Scanner* scanner, uintptr_t stack_limit, v8::Extension* extension,
- ParserRecorder* log, typename Traits::Type::Zone* zone,
- typename Traits::Type::Parser this_object)
+ ParserBase(Isolate* isolate, typename Traits::Type::Zone* zone,
+ Scanner* scanner, uintptr_t stack_limit, v8::Extension* extension,
+ ParserRecorder* log, typename Traits::Type::Parser this_object)
: Traits(this_object),
parenthesized_function_(false),
scope_(NULL),
@@ -80,6 +80,8 @@ class ParserBase : public Traits {
log_(log),
mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly.
stack_limit_(stack_limit),
+ isolate_(isolate),
+ zone_(zone),
scanner_(scanner),
stack_overflow_(false),
allow_lazy_(false),
@@ -87,8 +89,7 @@ class ParserBase : public Traits {
allow_harmony_arrow_functions_(false),
allow_harmony_object_literals_(false),
allow_harmony_sloppy_(false),
- allow_harmony_computed_property_names_(false),
- zone_(zone) {}
+ allow_harmony_computed_property_names_(false) {}
// Getters that indicate whether certain syntactical constructs are
// allowed to be parsed by this instance of the parser.
@@ -296,6 +297,7 @@ class ParserBase : public Traits {
Mode old_mode_;
};
+ Isolate* isolate() const { return isolate_; }
Scanner* scanner() const { return scanner_; }
int position() { return scanner_->location().beg_pos; }
int peek_position() { return scanner_->peek_location().beg_pos; }
@@ -608,6 +610,9 @@ class ParserBase : public Traits {
uintptr_t stack_limit_;
private:
+ Isolate* isolate_;
+ typename Traits::Type::Zone* zone_; // Only used by Parser.
+
Scanner* scanner_;
bool stack_overflow_;
@@ -617,8 +622,6 @@ class ParserBase : public Traits {
bool allow_harmony_object_literals_;
bool allow_harmony_sloppy_;
bool allow_harmony_computed_property_names_;
-
- typename Traits::Type::Zone* zone_; // Only used by Parser.
};
@@ -1494,9 +1497,10 @@ class PreParser : public ParserBase<PreParserTraits> {
kPreParseSuccess
};
- PreParser(Scanner* scanner, ParserRecorder* log, uintptr_t stack_limit)
- : ParserBase<PreParserTraits>(scanner, stack_limit, NULL, log, NULL,
- this) {}
+ PreParser(Isolate* isolate, Scanner* scanner, ParserRecorder* log,
+ uintptr_t stack_limit)
+ : ParserBase<PreParserTraits>(isolate, NULL, scanner, stack_limit, NULL,
+ log, this) {}
// Pre-parse the program from the character stream; returns true on
// success (even if parsing failed, the pre-parse data successfully
@@ -2807,9 +2811,10 @@ ParserBase<Traits>::ParseMemberExpressionContinuation(ExpressionT expression,
template <class Traits>
-typename ParserBase<Traits>::ExpressionT ParserBase<
- Traits>::ParseArrowFunctionLiteral(int start_pos, ExpressionT params_ast,
- bool* ok) {
+typename ParserBase<Traits>::ExpressionT
+ParserBase<Traits>::ParseArrowFunctionLiteral(int start_pos,
+ ExpressionT params_ast,
+ bool* ok) {
typename Traits::Type::ScopePtr scope = this->NewScope(scope_, ARROW_SCOPE);
typename Traits::Type::StatementList body;
int num_parameters = -1;
« no previous file with comments | « src/parser.cc ('k') | src/prettyprinter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698