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

Unified Diff: src/parser.h

Issue 6542061: [Isolates] Less TLS reads in parser and full codegens. (Closed)
Patch Set: Created 9 years, 10 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/ia32/full-codegen-ia32.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index da8193099ec6aa3ad11262779c87c70d60c181ab..797ac32cdd2dba18d893a11783ff38684c84f46d 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -391,6 +391,8 @@ class RegExpParser {
int disjunction_capture_index_;
};
+ Isolate* isolate() { return isolate_; }
+
uc32 current() { return current_; }
bool has_more() { return has_more_; }
bool has_next() { return next_pos_ < in()->length(); }
@@ -398,6 +400,7 @@ class RegExpParser {
FlatStringReader* in() { return in_; }
void ScanForCaptures();
+ Isolate* isolate_;
Handle<String>* error_;
ZoneList<RegExpCapture*>* captures_;
FlatStringReader* in_;
@@ -440,6 +443,8 @@ class Parser {
PARSE_EAGERLY
};
+ Isolate* isolate() { return isolate_; }
+
// Report syntax error
void ReportUnexpectedToken(Token::Value token);
void ReportInvalidPreparseData(Handle<String> name, bool* ok);
@@ -558,7 +563,7 @@ class Parser {
if (stack_overflow_) {
return Token::ILLEGAL;
}
- if (StackLimitCheck(isolate_).HasOverflowed()) {
+ if (StackLimitCheck(isolate()).HasOverflowed()) {
// Any further calls to Next or peek will return the illegal token.
stack_overflow_ = true;
}
@@ -707,9 +712,11 @@ class JsonParser BASE_EMBEDDED {
}
private:
- JsonParser() { }
+ JsonParser() : isolate_(Isolate::Current()) { }
~JsonParser() { }
+ Isolate* isolate() { return isolate_; }
+
// Parse a string containing a single JSON value.
Handle<Object> ParseJson(Handle<String>);
// Parse a single JSON value from input (grammar production JSONValue).
@@ -736,6 +743,7 @@ class JsonParser BASE_EMBEDDED {
// Converts the currently parsed literal to a JavaScript String.
Handle<String> GetString();
+ Isolate* isolate_;
JsonScanner scanner_;
bool stack_overflow_;
};
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698