Revision: 12850
Author:   [email protected]
Date:     Mon Nov  5 02:50:36 2012
Log:      Improve handle allocation in JSON.parse.

BUG=

Review URL: https://chromiumcodereview.appspot.com/11358065
http://code.google.com/p/v8/source/detail?r=12850

Modified:
 /branches/bleeding_edge/src/json-parser.h

=======================================
--- /branches/bleeding_edge/src/json-parser.h   Mon Oct 29 05:01:29 2012
+++ /branches/bleeding_edge/src/json-parser.h   Mon Nov  5 02:50:36 2012
@@ -176,8 +176,8 @@
                                                 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 @@
   Advance();
   if (c0_ == '"') {
     AdvanceSkipWhitespace();
-    return Handle<String>(isolate()->heap()->empty_string());
+    return factory()->empty_string();
   }

   if (seq_ascii && is_symbol) {
@@ -657,7 +657,7 @@
         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);
     }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to