A debug code assert needed to be behind the new optimize_constructed_arrays flag.
authormvstanton@chromium.org <mvstanton@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 1 Mar 2013 16:59:53 +0000 (16:59 +0000)
committermvstanton@chromium.org <mvstanton@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 1 Mar 2013 16:59:53 +0000 (16:59 +0000)
BUG=

Review URL: https://codereview.chromium.org/12385050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13791 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/builtins-arm.cc
src/ia32/builtins-ia32.cc
src/x64/builtins-x64.cc

index ec27bd6..466c890 100644 (file)
@@ -557,18 +557,20 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
     __ CompareObjectType(r1, r3, r4, MAP_TYPE);
     __ Assert(eq, "Unexpected initial map for Array function");
 
-    // We should either have undefined in r2 or a valid jsglobalpropertycell
-    Label okay_here;
-    Handle<Object> undefined_sentinel(
-        masm->isolate()->heap()->undefined_value(), masm->isolate());
-    Handle<Map> global_property_cell_map(
-        masm->isolate()->heap()->global_property_cell_map());
-    __ cmp(r2, Operand(undefined_sentinel));
-    __ b(eq, &okay_here);
-    __ ldr(r3, FieldMemOperand(r2, 0));
-    __ cmp(r3, Operand(global_property_cell_map));
-    __ Assert(eq, "Expected property cell in register ebx");
-    __ bind(&okay_here);
+    if (FLAG_optimize_constructed_arrays) {
+      // We should either have undefined in r2 or a valid jsglobalpropertycell
+      Label okay_here;
+      Handle<Object> undefined_sentinel(
+          masm->isolate()->heap()->undefined_value(), masm->isolate());
+      Handle<Map> global_property_cell_map(
+          masm->isolate()->heap()->global_property_cell_map());
+      __ cmp(r2, Operand(undefined_sentinel));
+      __ b(eq, &okay_here);
+      __ ldr(r3, FieldMemOperand(r2, 0));
+      __ cmp(r3, Operand(global_property_cell_map));
+      __ Assert(eq, "Expected property cell in register ebx");
+      __ bind(&okay_here);
+    }
   }
 
   if (FLAG_optimize_constructed_arrays) {
index bcd713d..e3b2b7b 100644 (file)
@@ -1496,17 +1496,19 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
     __ CmpObjectType(ecx, MAP_TYPE, ecx);
     __ Assert(equal, "Unexpected initial map for Array function");
 
-    // We should either have undefined in ebx or a valid jsglobalpropertycell
-    Label okay_here;
-    Handle<Object> undefined_sentinel(
-        masm->isolate()->heap()->undefined_value(), masm->isolate());
-    Handle<Map> global_property_cell_map(
-        masm->isolate()->heap()->global_property_cell_map());
-    __ cmp(ebx, Immediate(undefined_sentinel));
-    __ j(equal, &okay_here);
-    __ cmp(FieldOperand(ebx, 0), Immediate(global_property_cell_map));
-    __ Assert(equal, "Expected property cell in register ebx");
-    __ bind(&okay_here);
+    if (FLAG_optimize_constructed_arrays) {
+      // We should either have undefined in ebx or a valid jsglobalpropertycell
+      Label okay_here;
+      Handle<Object> undefined_sentinel(
+          masm->isolate()->heap()->undefined_value(), masm->isolate());
+      Handle<Map> global_property_cell_map(
+          masm->isolate()->heap()->global_property_cell_map());
+      __ cmp(ebx, Immediate(undefined_sentinel));
+      __ j(equal, &okay_here);
+      __ cmp(FieldOperand(ebx, 0), Immediate(global_property_cell_map));
+      __ Assert(equal, "Expected property cell in register ebx");
+      __ bind(&okay_here);
+    }
   }
 
   if (FLAG_optimize_constructed_arrays) {
index c3d757a..144962b 100644 (file)
@@ -1524,17 +1524,19 @@ void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
     __ CmpObjectType(rcx, MAP_TYPE, rcx);
     __ Check(equal, "Unexpected initial map for Array function");
 
-    // We should either have undefined in ebx or a valid jsglobalpropertycell
-    Label okay_here;
-    Handle<Object> undefined_sentinel(
-        masm->isolate()->factory()->undefined_value());
-    Handle<Map> global_property_cell_map(
-        masm->isolate()->heap()->global_property_cell_map());
-    __ Cmp(rbx, undefined_sentinel);
-    __ j(equal, &okay_here);
-    __ Cmp(FieldOperand(rbx, 0), global_property_cell_map);
-    __ Assert(equal, "Expected property cell in register rbx");
-    __ bind(&okay_here);
+    if (FLAG_optimize_constructed_arrays) {
+      // We should either have undefined in ebx or a valid jsglobalpropertycell
+      Label okay_here;
+      Handle<Object> undefined_sentinel(
+          masm->isolate()->factory()->undefined_value());
+      Handle<Map> global_property_cell_map(
+          masm->isolate()->heap()->global_property_cell_map());
+      __ Cmp(rbx, undefined_sentinel);
+      __ j(equal, &okay_here);
+      __ Cmp(FieldOperand(rbx, 0), global_property_cell_map);
+      __ Assert(equal, "Expected property cell in register rbx");
+      __ bind(&okay_here);
+    }
   }
 
   if (FLAG_optimize_constructed_arrays) {