Commit 17fab1df authored by yangguo@chromium.org's avatar yangguo@chromium.org

Improve handle allocation in JSON.parse.

BUG=

Review URL: https://chromiumcodereview.appspot.com/11358065

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12850 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f3807ca1
...@@ -176,8 +176,8 @@ Handle<Object> JsonParser<seq_ascii>::ParseJson(Handle<String> source, ...@@ -176,8 +176,8 @@ Handle<Object> JsonParser<seq_ascii>::ParseJson(Handle<String> source,
Zone* zone) { Zone* zone) {
isolate_ = source->map()->GetHeap()->isolate(); isolate_ = source->map()->GetHeap()->isolate();
factory_ = isolate_->factory(); factory_ = isolate_->factory();
object_constructor_ = object_constructor_ = Handle<JSFunction>(
Handle<JSFunction>(isolate()->native_context()->object_function()); isolate()->native_context()->object_function(), isolate());
zone_ = zone; zone_ = zone;
FlattenString(source); FlattenString(source);
source_ = source; source_ = source;
...@@ -611,7 +611,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() { ...@@ -611,7 +611,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
Advance(); Advance();
if (c0_ == '"') { if (c0_ == '"') {
AdvanceSkipWhitespace(); AdvanceSkipWhitespace();
return Handle<String>(isolate()->heap()->empty_string()); return factory()->empty_string();
} }
if (seq_ascii && is_symbol) { if (seq_ascii && is_symbol) {
...@@ -657,7 +657,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() { ...@@ -657,7 +657,7 @@ Handle<String> JsonParser<seq_ascii>::ScanJsonString() {
position_ = position; position_ = position;
// Advance past the last '"'. // Advance past the last '"'.
AdvanceSkipWhitespace(); AdvanceSkipWhitespace();
return Handle<String>(String::cast(element)); return Handle<String>(String::cast(element), isolate());
} }
entry = SymbolTable::NextProbe(entry, count++, capacity); entry = SymbolTable::NextProbe(entry, count++, capacity);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment