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

Unified Diff: src/parser.h

Issue 6685088: Merge isolates to bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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 | « src/objects-inl.h ('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
===================================================================
--- src/parser.h (revision 7267)
+++ src/parser.h (working copy)
@@ -388,6 +388,8 @@
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(); }
@@ -395,6 +397,7 @@
FlatStringReader* in() { return in_; }
void ScanForCaptures();
+ Isolate* isolate_;
Handle<String>* error_;
ZoneList<RegExpCapture*>* captures_;
FlatStringReader* in_;
@@ -449,6 +452,8 @@
PARSE_EAGERLY
};
+ Isolate* isolate() { return isolate_; }
+
// Called by ParseProgram after setting up the scanner.
FunctionLiteral* DoParseProgram(Handle<String> source,
bool in_global_context,
@@ -574,7 +579,7 @@
if (stack_overflow_) {
return Token::ILLEGAL;
}
- if (StackLimitCheck().HasOverflowed()) {
+ if (StackLimitCheck(isolate()).HasOverflowed()) {
// Any further calls to Next or peek will return the illegal token.
// The current call must return the next token, which might already
// have been peek'ed.
@@ -592,21 +597,21 @@
Handle<String> LiteralString(PretenureFlag tenured) {
if (scanner().is_literal_ascii()) {
- return Factory::NewStringFromAscii(scanner().literal_ascii_string(),
- tenured);
+ return isolate_->factory()->NewStringFromAscii(
+ scanner().literal_ascii_string(), tenured);
} else {
- return Factory::NewStringFromTwoByte(scanner().literal_uc16_string(),
- tenured);
+ return isolate_->factory()->NewStringFromTwoByte(
+ scanner().literal_uc16_string(), tenured);
}
}
Handle<String> NextLiteralString(PretenureFlag tenured) {
if (scanner().is_next_literal_ascii()) {
- return Factory::NewStringFromAscii(scanner().next_literal_ascii_string(),
- tenured);
+ return isolate_->factory()->NewStringFromAscii(
+ scanner().next_literal_ascii_string(), tenured);
} else {
- return Factory::NewStringFromTwoByte(scanner().next_literal_uc16_string(),
- tenured);
+ return isolate_->factory()->NewStringFromTwoByte(
+ scanner().next_literal_uc16_string(), tenured);
}
}
@@ -686,6 +691,7 @@
Handle<String> type,
Vector< Handle<Object> > arguments);
+ Isolate* isolate_;
ZoneList<Handle<String> > symbol_cache_;
Handle<Script> script_;
@@ -765,9 +771,11 @@
}
private:
- JsonParser() { }
+ JsonParser() : isolate_(Isolate::Current()), scanner_(isolate_) { }
~JsonParser() { }
+ Isolate* isolate() { return isolate_; }
+
// Parse a string containing a single JSON value.
Handle<Object> ParseJson(Handle<String> script, UC16CharacterStream* source);
// Parse a single JSON value from input (grammar production JSONValue).
@@ -794,6 +802,7 @@
// 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/objects-inl.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698