Revision: 16213
Author:   [email protected]
Date:     Mon Aug 19 09:36:44 2013 UTC
Log:      Version 3.21.0

Fixed GC-related crasher (Chromium issue 274438)

Reverted making Intl non-enumerable.

Performance and stability improvements on all platforms.
http://code.google.com/p/v8/source/detail?r=16213

Added:
 /trunk/test/mjsunit/regress/regress-convert-function-to-double.js
 /trunk/test/mjsunit/regress/regress-crbug-274438.js
Modified:
 /trunk/ChangeLog
 /trunk/src/accessors.cc
 /trunk/src/accessors.h
 /trunk/src/bootstrapper.cc
 /trunk/src/codegen.cc
 /trunk/src/extensions/i18n/footer.js
 /trunk/src/extensions/i18n/header.js
 /trunk/src/full-codegen.cc
 /trunk/src/handles.cc
 /trunk/src/handles.h
 /trunk/src/heap.cc
 /trunk/src/heap.h
 /trunk/src/hydrogen-instructions.h
 /trunk/src/ic.cc
 /trunk/src/lithium.cc
 /trunk/src/objects.cc
 /trunk/src/runtime.cc
 /trunk/src/runtime.h
 /trunk/src/version.cc
 /trunk/test/cctest/test-code-stubs-ia32.cc
 /trunk/test/cctest/test-code-stubs-x64.cc

=======================================
--- /dev/null
+++ /trunk/test/mjsunit/regress/regress-convert-function-to-double.js Mon Aug 19 09:36:44 2013 UTC
@@ -0,0 +1,36 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+function f(v) {
+  this.func = v;
+}
+
+var o1 = new f(f);
+var d = 1.4;
+var o2 = new f(d);
+o2.func = 1.8;
+assertEquals(1.4, d)
=======================================
--- /dev/null
+++ /trunk/test/mjsunit/regress/regress-crbug-274438.js Mon Aug 19 09:36:44 2013 UTC
@@ -0,0 +1,43 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax
+
+function f(a, b) {
+  var x = { a:a };
+  switch(b) { case "string": }
+  var y = { b:b };
+  return y;
+}
+
+f("a", "b");
+f("a", "b");
+%OptimizeFunctionOnNextCall(f);
+f("a", "b");
+%SetAllocationTimeout(100, 0);
+var killer = f("bang", "bo" + "om");
+assertEquals("boom", killer.b);
=======================================
--- /trunk/ChangeLog    Wed Aug 14 17:13:49 2013 UTC
+++ /trunk/ChangeLog    Mon Aug 19 09:36:44 2013 UTC
@@ -1,3 +1,12 @@
+2013-08-19: Version 3.21.0
+
+        Fixed GC-related crasher (Chromium issue 274438)
+
+        Reverted making Intl non-enumerable.
+
+        Performance and stability improvements on all platforms.
+
+
 2013-08-14: Version 3.20.17

         Fixed Math.round/floor that had bogus Smi representation
=======================================
--- /trunk/src/accessors.cc     Thu Aug  1 16:58:23 2013 UTC
+++ /trunk/src/accessors.cc     Mon Aug 19 09:36:44 2013 UTC
@@ -440,10 +440,21 @@
 //


-Handle<Object> Accessors::FunctionGetPrototype(Handle<Object> object) {
-  Isolate* isolate = Isolate::Current();
-  CALL_HEAP_FUNCTION(
-      isolate, Accessors::FunctionGetPrototype(*object, 0), Object);
+Handle<Object> Accessors::FunctionGetPrototype(Handle<JSFunction> function) {
+  CALL_HEAP_FUNCTION(function->GetIsolate(),
+                     Accessors::FunctionGetPrototype(*function, NULL),
+                     Object);
+}
+
+
+Handle<Object> Accessors::FunctionSetPrototype(Handle<JSFunction> function,
+                                               Handle<Object> prototype) {
+  ASSERT(function->should_have_prototype());
+  CALL_HEAP_FUNCTION(function->GetIsolate(),
+                     Accessors::FunctionSetPrototype(*function,
+                                                     *prototype,
+                                                     NULL),
+                     Object);
 }


@@ -575,10 +586,10 @@
 //


-Handle<Object> Accessors::FunctionGetArguments(Handle<Object> object) {
-  Isolate* isolate = Isolate::Current();
-  CALL_HEAP_FUNCTION(
-      isolate, Accessors::FunctionGetArguments(*object, 0), Object);
+Handle<Object> Accessors::FunctionGetArguments(Handle<JSFunction> function) {
+  CALL_HEAP_FUNCTION(function->GetIsolate(),
+                     Accessors::FunctionGetArguments(*function, NULL),
+                     Object);
 }


=======================================
--- /trunk/src/accessors.h      Mon Jul 22 09:21:20 2013 UTC
+++ /trunk/src/accessors.h      Mon Aug 19 09:36:44 2013 UTC
@@ -77,12 +77,10 @@
   };

   // Accessor functions called directly from the runtime system.
-  static Handle<Object> FunctionGetPrototype(Handle<Object> object);
-  static Handle<Object> FunctionGetArguments(Handle<Object> object);
-
- MUST_USE_RESULT static MaybeObject* FunctionSetPrototype(JSObject* object,
-                                                      Object* value,
-                                                      void*);
+  static Handle<Object> FunctionSetPrototype(Handle<JSFunction> object,
+                                             Handle<Object> value);
+  static Handle<Object> FunctionGetPrototype(Handle<JSFunction> object);
+  static Handle<Object> FunctionGetArguments(Handle<JSFunction> object);

   // Accessor infos.
   static Handle<AccessorInfo> MakeModuleExport(
@@ -90,13 +88,13 @@

  private:
   // Accessor functions only used through the descriptor.
+ static MaybeObject* FunctionSetPrototype(JSObject* object, Object*, void*);
   static MaybeObject* FunctionGetPrototype(Object* object, void*);
   static MaybeObject* FunctionGetLength(Object* object, void*);
   static MaybeObject* FunctionGetName(Object* object, void*);
   static MaybeObject* FunctionGetArguments(Object* object, void*);
   static MaybeObject* FunctionGetCaller(Object* object, void*);
-  MUST_USE_RESULT static MaybeObject* ArraySetLength(JSObject* object,
-                                                     Object* value, void*);
+  static MaybeObject* ArraySetLength(JSObject* object, Object*, void*);
   static MaybeObject* ArrayGetLength(Object* object, void*);
   static MaybeObject* StringGetLength(Object* object, void*);
   static MaybeObject* ScriptGetName(Object* object, void*);
=======================================
--- /trunk/src/bootstrapper.cc  Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/bootstrapper.cc  Mon Aug 19 09:36:44 2013 UTC
@@ -491,7 +491,7 @@
     // prototype, otherwise the missing initial_array_prototype will cause
     // assertions during startup.
     native_context()->set_initial_array_prototype(*prototype);
-    SetPrototype(object_fun, prototype);
+    Accessors::FunctionSetPrototype(object_fun, prototype);
   }

   // Allocate the empty function as the prototype for function ECMAScript
@@ -1632,7 +1632,7 @@
                       true, true);
   Handle<JSObject> prototype =
       factory()->NewJSObject(isolate()->object_function(), TENURED);
-  SetPrototype(array_function, prototype);
+  Accessors::FunctionSetPrototype(array_function, prototype);

   InternalArrayConstructorStub internal_array_constructor_stub(isolate());
   Handle<Code> code = internal_array_constructor_stub.GetCode(isolate());
@@ -1730,7 +1730,7 @@
                         Builtins::kIllegal, false, false);
     Handle<JSObject> prototype =
         factory()->NewJSObject(isolate()->object_function(), TENURED);
-    SetPrototype(script_fun, prototype);
+    Accessors::FunctionSetPrototype(script_fun, prototype);
     native_context()->set_script_function(*script_fun);

     Handle<Map> script_map = Handle<Map>(script_fun->initial_map());
@@ -1886,7 +1886,7 @@
                         Builtins::kIllegal, false, false);
     Handle<JSObject> prototype =
         factory()->NewJSObject(isolate()->object_function(), TENURED);
-    SetPrototype(opaque_reference_fun, prototype);
+    Accessors::FunctionSetPrototype(opaque_reference_fun, prototype);
     native_context()->set_opaque_reference_function(*opaque_reference_fun);
   }

=======================================
--- /trunk/src/codegen.cc       Fri Jul 26 10:27:09 2013 UTC
+++ /trunk/src/codegen.cc       Mon Aug 19 09:36:44 2013 UTC
@@ -114,11 +114,9 @@
   Handle<Code> code =
       isolate->factory()->NewCode(desc, flags, masm->CodeObject(),
                                   false, is_crankshafted);
-  if (!code.is_null()) {
-    isolate->counters()->total_compiled_code_size()->Increment(
-        code->instruction_size());
-    code->set_prologue_offset(info->prologue_offset());
-  }
+  isolate->counters()->total_compiled_code_size()->Increment(
+      code->instruction_size());
+  code->set_prologue_offset(info->prologue_offset());
   return code;
 }

=======================================
--- /trunk/src/extensions/i18n/footer.js        Thu Aug  1 16:58:23 2013 UTC
+++ /trunk/src/extensions/i18n/footer.js        Mon Aug 19 09:36:44 2013 UTC
@@ -37,4 +37,4 @@
 CLEANUP_RE.test('');

 return Intl;
-}())});
+}());
=======================================
--- /trunk/src/extensions/i18n/header.js        Thu Aug  1 16:58:23 2013 UTC
+++ /trunk/src/extensions/i18n/header.js        Mon Aug 19 09:36:44 2013 UTC
@@ -34,7 +34,7 @@
  * Intl object is a single object that has some named properties,
  * all of which are constructors.
  */
-Object.defineProperty(this, "Intl", { enumerable: false, value: (function() {
+var Intl = (function() {

 'use strict';

=======================================
--- /trunk/src/full-codegen.cc  Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/full-codegen.cc  Mon Aug 19 09:36:44 2013 UTC
@@ -350,21 +350,17 @@
   code->set_back_edge_table_offset(table_offset);
   code->set_back_edges_patched_for_osr(false);
   CodeGenerator::PrintCode(code, info);
-  info->SetCode(code);  // May be an empty handle.
+  info->SetCode(code);
 #ifdef ENABLE_GDB_JIT_INTERFACE
-  if (FLAG_gdbjit && !code.is_null()) {
+  if (FLAG_gdbjit) {
     GDBJITLineInfo* lineinfo =
         masm.positions_recorder()->DetachGDBJITLineInfo();
-
     GDBJIT(RegisterDetailedLineInfo(*code, lineinfo));
   }
 #endif
-  if (!code.is_null()) {
-    void* line_info =
-        masm.positions_recorder()->DetachJITHandlerData();
- LOG_CODE_EVENT(isolate, CodeEndLinePosInfoRecordEvent(*code, line_info));
-  }
-  return !code.is_null();
+  void* line_info = masm.positions_recorder()->DetachJITHandlerData();
+  LOG_CODE_EVENT(isolate, CodeEndLinePosInfoRecordEvent(*code, line_info));
+  return true;
 }


=======================================
--- /trunk/src/handles.cc       Mon Jul 22 09:21:20 2013 UTC
+++ /trunk/src/handles.cc       Mon Aug 19 09:36:44 2013 UTC
@@ -206,17 +206,6 @@
 Handle<String> FlattenGetString(Handle<String> string) {
   CALL_HEAP_FUNCTION(string->GetIsolate(), string->TryFlatten(), String);
 }
-
-
-Handle<Object> SetPrototype(Handle<JSFunction> function,
-                            Handle<Object> prototype) {
-  ASSERT(function->should_have_prototype());
-  CALL_HEAP_FUNCTION(function->GetIsolate(),
-                     Accessors::FunctionSetPrototype(*function,
-                                                     *prototype,
-                                                     NULL),
-                     Object);
-}


 Handle<Object> SetProperty(Isolate* isolate,
=======================================
--- /trunk/src/handles.h        Mon Jul 22 09:21:20 2013 UTC
+++ /trunk/src/handles.h        Mon Aug 19 09:36:44 2013 UTC
@@ -322,9 +322,6 @@
     Handle<JSFunction> constructor,
     Handle<JSGlobalProxy> global);

-Handle<Object> SetPrototype(Handle<JSFunction> function,
-                            Handle<Object> prototype);
-
 Handle<ObjectHashSet> ObjectHashSetAdd(Handle<ObjectHashSet> table,
                                        Handle<Object> key);

=======================================
--- /trunk/src/heap.cc  Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/heap.cc  Mon Aug 19 09:36:44 2013 UTC
@@ -4013,10 +4013,10 @@
     return AllocateByteArray(length);
   }
   int size = ByteArray::SizeFor(length);
+  AllocationSpace space =
+      (size > Page::kMaxNonCodeHeapObjectSize) ? LO_SPACE : OLD_DATA_SPACE;
   Object* result;
-  { MaybeObject* maybe_result = (size <= Page::kMaxNonCodeHeapObjectSize)
-                   ? old_data_space_->AllocateRaw(size)
-                   : lo_space_->AllocateRaw(size, NOT_EXECUTABLE);
+  { MaybeObject* maybe_result = AllocateRaw(size, space, space);
     if (!maybe_result->ToObject(&result)) return maybe_result;
   }

=======================================
--- /trunk/src/heap.h   Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/heap.h   Mon Aug 19 09:36:44 2013 UTC
@@ -1490,6 +1490,10 @@
inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; }

 #ifdef DEBUG
+  void set_allocation_timeout(int timeout) {
+    allocation_timeout_ = timeout;
+  }
+
   bool disallow_allocation_failure() {
     return disallow_allocation_failure_;
   }
=======================================
--- /trunk/src/hydrogen-instructions.h  Wed Aug 14 17:13:49 2013 UTC
+++ /trunk/src/hydrogen-instructions.h  Mon Aug 19 09:36:44 2013 UTC
@@ -3842,10 +3842,6 @@

   virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);

-  virtual Representation RequiredInputRepresentation(int index) {
-    return Representation::Integer32();
-  }
-
   DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv)

  protected:
@@ -4081,6 +4077,7 @@
     SetOperandAt(1, left);
     SetOperandAt(2, right);
     set_representation(Representation::Tagged());
+    SetGVNFlag(kChangesNewSpacePromotion);
   }

   HValue* context() { return OperandAt(0); }
=======================================
--- /trunk/src/ic.cc    Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/ic.cc    Mon Aug 19 09:36:44 2013 UTC
@@ -925,7 +925,7 @@
         if (FLAG_trace_ic) PrintF("[LoadIC : +#prototype /function]\n");
 #endif
       }
-      return *Accessors::FunctionGetPrototype(object);
+ return *Accessors::FunctionGetPrototype(Handle<JSFunction>::cast(object));
     }
   }

=======================================
--- /trunk/src/lithium.cc       Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/lithium.cc       Mon Aug 19 09:36:44 2013 UTC
@@ -461,12 +461,10 @@
         CodeGenerator::MakeCodeEpilogue(&assembler, flags, info());
     generator.FinishCode(code);
     code->set_is_crankshafted(true);
-    if (!code.is_null()) {
-      void* jit_handler_data =
-          assembler.positions_recorder()->DetachJITHandlerData();
-      LOG_CODE_EVENT(info()->isolate(),
- CodeEndLinePosInfoRecordEvent(*code, jit_handler_data));
-    }
+    void* jit_handler_data =
+        assembler.positions_recorder()->DetachJITHandlerData();
+    LOG_CODE_EVENT(info()->isolate(),
+                   CodeEndLinePosInfoRecordEvent(*code, jit_handler_data));

     CodeGenerator::PrintCode(code, info());
     return code;
=======================================
--- /trunk/src/objects.cc       Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/objects.cc       Mon Aug 19 09:36:44 2013 UTC
@@ -2231,7 +2231,7 @@
   if (new_properties != NULL) {
     set_properties(new_properties);
   }
-  FastPropertyAtPut(index, new_value);
+  FastPropertyAtPut(index, storage);
   return new_value;
 }

=======================================
--- /trunk/src/runtime.cc       Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/runtime.cc       Mon Aug 19 09:36:44 2013 UTC
@@ -2780,16 +2780,13 @@


 RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetPrototype) {
-  SealHandleScope shs(isolate);
+  HandleScope scope(isolate);
   ASSERT(args.length() == 2);

-  CONVERT_ARG_CHECKED(JSFunction, fun, 0);
+  CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
+  CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
   ASSERT(fun->should_have_prototype());
-  Object* obj;
-  { MaybeObject* maybe_obj =
-        Accessors::FunctionSetPrototype(fun, args[1], NULL);
-    if (!maybe_obj->ToObject(&obj)) return maybe_obj;
-  }
+  Accessors::FunctionSetPrototype(fun, value);
   return args[0];  // return TOS
 }

@@ -8633,6 +8630,19 @@
     return Smi::FromInt(-1);
   }
 }
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_SetAllocationTimeout) {
+  SealHandleScope shs(isolate);
+  ASSERT(args.length() == 2);
+#ifdef DEBUG
+  CONVERT_SMI_ARG_CHECKED(interval, 0);
+  CONVERT_SMI_ARG_CHECKED(timeout, 1);
+  isolate->heap()->set_allocation_timeout(timeout);
+  FLAG_gc_interval = interval;
+#endif
+  return isolate->heap()->undefined_value();
+}


 RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) {
=======================================
--- /trunk/src/runtime.h        Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/src/runtime.h        Mon Aug 19 09:36:44 2013 UTC
@@ -101,6 +101,7 @@
   F(GetOptimizationStatus, -1, 1) \
   F(GetOptimizationCount, 1, 1) \
   F(CompileForOnStackReplacement, 1, 1) \
+  F(SetAllocationTimeout, 2, 1) \
   F(AllocateInNewSpace, 1, 1) \
   F(AllocateInOldPointerSpace, 1, 1) \
   F(AllocateInOldDataSpace, 1, 1) \
=======================================
--- /trunk/src/version.cc       Thu Aug 15 08:05:35 2013 UTC
+++ /trunk/src/version.cc       Mon Aug 19 09:36:44 2013 UTC
@@ -33,9 +33,9 @@
 // NOTE these macros are used by some of the tool scripts and the build
 // system so their names cannot be changed without changing the scripts.
 #define MAJOR_VERSION     3
-#define MINOR_VERSION     20
-#define BUILD_NUMBER      17
-#define PATCH_LEVEL       1
+#define MINOR_VERSION     21
+#define BUILD_NUMBER      0
+#define PATCH_LEVEL       0
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
=======================================
--- /trunk/test/cctest/test-code-stubs-ia32.cc  Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/test/cctest/test-code-stubs-ia32.cc  Mon Aug 19 09:36:44 2013 UTC
@@ -136,46 +136,15 @@
   RunAllTruncationTests(&ConvertDToICVersion);
 #endif

-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, eax));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, ebx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, ecx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, edx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, edi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esp, esi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, eax));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, ebx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, ecx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, edx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, edi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, eax, esi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, eax));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, ebx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, ecx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, edx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, edi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ebx, esi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, eax));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, ebx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, ecx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, edx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, edi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, ecx, esi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, eax));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, ebx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, ecx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, edx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, edi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edx, esi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, eax));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, ebx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, ecx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, edx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, edi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, esi, esi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, eax));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, ebx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, ecx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, edx));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, edi));
-  RunAllTruncationTests(MakeConvertDToIFuncTrampoline(isolate, edi, esi));
+  Register source_registers[] = {esp, eax, ebx, ecx, edx, edi, esi};
+  Register dest_registers[] = {eax, ebx, ecx, edx, edi, esi};
+
+ for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { + for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
+      RunAllTruncationTests(
+          MakeConvertDToIFuncTrampoline(isolate,
+                                        source_registers[s],
+                                        dest_registers[d]));
+    }
+  }
 }
=======================================
--- /trunk/test/cctest/test-code-stubs-x64.cc   Tue Aug 13 17:09:37 2013 UTC
+++ /trunk/test/cctest/test-code-stubs-x64.cc   Mon Aug 19 09:36:44 2013 UTC
@@ -138,8 +138,8 @@
Register source_registers[] = {rsp, rax, rbx, rcx, rdx, rsi, rdi, r8, r9};
   Register dest_registers[] = {rax, rbx, rcx, rdx, rsi, rdi, r8, r9};

-  for (size_t s = 0; s < sizeof(*source_registers); s++) {
-    for (size_t d = 0; d < sizeof(*dest_registers); d++) {
+ for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { + for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) {
       RunAllTruncationTests(
           MakeConvertDToIFuncTrampoline(isolate,
                                         source_registers[s],

--
--
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