Revision: 10524
Author:   [email protected]
Date:     Thu Jan 26 14:33:54 2012
Log: Add undefined check for default Array map in ArrayCodeGenericCommon

[email protected]
BUG=
TEST=

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

Modified:
 /branches/bleeding_edge/src/builtins.cc

=======================================
--- /branches/bleeding_edge/src/builtins.cc     Thu Jan 26 13:47:57 2012
+++ /branches/bleeding_edge/src/builtins.cc     Thu Jan 26 14:33:54 2012
@@ -198,8 +198,9 @@
     array->set_length(Smi::FromInt(0));
     array->set_elements(heap->empty_fixed_array());
     if (!FLAG_smi_only_arrays) {
-      if (array->GetElementsKind() == FAST_SMI_ONLY_ELEMENTS) {
-        Context* global_context = isolate->context()->global_context();
+      Context* global_context = isolate->context()->global_context();
+      if (array->GetElementsKind() == FAST_SMI_ONLY_ELEMENTS &&
+          !global_context->object_js_array_map()->IsUndefined()) {
         array->set_map(Map::cast(global_context->object_js_array_map()));
       }
     }

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

Reply via email to