Reviewers: Toon Verwaest,

Message:
Hi, here is the handlefied change we discussed.

Description:
Bootstrapper code for constructed arrays needs to be handlefied

BUG=

Please review this at https://codereview.chromium.org/14008004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/bootstrapper.cc
  M src/objects.h
  M src/objects.cc


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index f81d240a0bb5fb28f3d67c2e643d956d79702fe3..85bf96e4d464bd1dd626e9d047364ef79143982b 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -892,10 +892,7 @@ bool Genesis::InitializeGlobal(Handle<GlobalObject> inner_global,

     if (FLAG_optimize_constructed_arrays) {
       // Cache the array maps, needed by ArrayConstructorStub
- MaybeObject* cache_result = CacheInitialJSArrayMaps(*native_context(),
-                                                          *initial_map);
-      if (cache_result->IsFailure()) return false;
-
+      CacheInitialJSArrayMaps(native_context(), initial_map);
       ArrayConstructorStub array_constructor_stub(isolate);
       Handle<Code> code = array_constructor_stub.GetCode(isolate);
       array_function->shared()->set_construct_stub(*code);
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 75d6e2f5bb9bc7079a66373d9be15885fd5ac4ce..6f052ff171073dc13c3a6a164721eae1ea5b91ff 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -8369,7 +8369,7 @@ MaybeObject* JSObject::OptimizeAsPrototype() {
 }


-MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
+static MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
     Context* native_context, Map* initial_map) {
// Replace all of the cached initial array maps in the native context with
   // the appropriate transitioned elements kind maps.
@@ -8398,6 +8398,14 @@ MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
 }


+Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context,
+                                       Handle<Map> initial_map) {
+  CALL_HEAP_FUNCTION(native_context->GetIsolate(),
+ CacheInitialJSArrayMaps(*native_context, *initial_map),
+                     Object);
+}
+
+
 MaybeObject* JSFunction::SetInstancePrototype(Object* value) {
   ASSERT(value->IsJSReceiver());
   Heap* heap = GetHeap();
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 92f2abfbce648a7ad935b127e79c746abc82b8f5..fa048655975574eb6937137f0c565d116c45d998 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -8753,8 +8753,8 @@ class JSArray: public JSObject {
 };


-MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
-    Context* native_context, Map* initial_map);
+Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context,
+                                       Handle<Map> initial_map);


 // JSRegExpResult is just a JSArray with a specific initial map.


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to