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

Unified Diff: src/json-parser.h

Issue 11358065: Improve handle allocation in JSON.parse. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 8 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index dc757c993606b4c6f64ee070ee43c9b0cc1d9435..6f8c71564d5f9dabab319d490401e9c3368f9079 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -176,8 +176,8 @@ Handle<Object> JsonParser<seq_ascii>::ParseJson(Handle<String> source,
Zone* zone) {
isolate_ = source->map()->GetHeap()->isolate();
factory_ = isolate_->factory();
- object_constructor_ =
- Handle<JSFunction>(isolate()->native_context()->object_function());
+ object_constructor_ = Handle<JSFunction>(
+ isolate()->native_context()->object_function(), isolate());
zone_ = zone;
FlattenString(source);
source_ = source;
@@ -611,7 +611,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
Advance();
if (c0_ == '"') {
AdvanceSkipWhitespace();
- return Handle<String>(isolate()->heap()->empty_string());
+ return factory()->empty_string();
}
if (seq_ascii && is_symbol) {
@@ -657,7 +657,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
position_ = position;
// Advance past the last '"'.
AdvanceSkipWhitespace();
- return Handle<String>(String::cast(element));
+ return Handle<String>(String::cast(element), isolate());
}
entry = SymbolTable::NextProbe(entry, count++, capacity);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698