Revision: 23496
Author:   [email protected]
Date:     Thu Aug 28 15:38:17 2014 UTC
Log:      Version 3.29.27 (based on bleeding_edge revision r23491)

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

Added:
 /trunk/test/cctest/compiler/c-signature.h
Modified:
 /trunk/.DEPS.git
 /trunk/ChangeLog
 /trunk/DEPS
 /trunk/src/compiler/change-lowering.cc
 /trunk/src/compiler/js-inlining.cc
 /trunk/src/compiler/linkage-impl.h
 /trunk/src/compiler/linkage.h
 /trunk/src/compiler/machine-operator.h
 /trunk/src/compiler/machine-type.h
 /trunk/src/compiler/raw-machine-assembler.h
 /trunk/src/compiler/simplified-lowering.cc
 /trunk/src/compiler/simplified-operator-reducer.cc
 /trunk/src/compiler/structured-machine-assembler.h
 /trunk/src/serialize.cc
 /trunk/src/version.cc
 /trunk/test/cctest/cctest.gyp
 /trunk/test/cctest/compiler/codegen-tester.h
 /trunk/test/cctest/compiler/instruction-selector-tester.h
 /trunk/test/cctest/compiler/test-run-inlining.cc
 /trunk/test/cctest/compiler/test-run-machops.cc
 /trunk/test/cctest/compiler/test-simplified-lowering.cc
 /trunk/test/cctest/compiler/test-structured-ifbuilder-fuzzer.cc
 /trunk/test/cctest/compiler/test-structured-machine-assembler.cc
 /trunk/test/compiler-unittests/instruction-selector-unittest.cc
 /trunk/test/mjsunit/mjsunit.status

=======================================
--- /dev/null
+++ /trunk/test/cctest/compiler/c-signature.h   Thu Aug 28 15:38:17 2014 UTC
@@ -0,0 +1,133 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_COMPILER_C_SIGNATURE_H_
+#define V8_COMPILER_C_SIGNATURE_H_
+
+#include "src/compiler/machine-type.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+template <typename T>
+inline MachineType MachineTypeForC() {
+  CHECK(false);  // Instantiated with invalid type.
+  return kMachNone;
+}
+
+template <>
+inline MachineType MachineTypeForC<void>() {
+  return kMachNone;
+}
+
+template <>
+inline MachineType MachineTypeForC<int8_t>() {
+  return kMachInt8;
+}
+
+template <>
+inline MachineType MachineTypeForC<uint8_t>() {
+  return kMachUint8;
+}
+
+template <>
+inline MachineType MachineTypeForC<int16_t>() {
+  return kMachInt16;
+}
+
+template <>
+inline MachineType MachineTypeForC<uint16_t>() {
+  return kMachUint16;
+}
+
+template <>
+inline MachineType MachineTypeForC<int32_t>() {
+  return kMachInt32;
+}
+
+template <>
+inline MachineType MachineTypeForC<uint32_t>() {
+  return kMachUint32;
+}
+
+template <>
+inline MachineType MachineTypeForC<int64_t>() {
+  return kMachInt64;
+}
+
+template <>
+inline MachineType MachineTypeForC<uint64_t>() {
+  return kMachUint64;
+}
+
+template <>
+inline MachineType MachineTypeForC<double>() {
+  return kMachFloat64;
+}
+
+template <>
+inline MachineType MachineTypeForC<Object*>() {
+  return kMachAnyTagged;
+}
+
+template <typename Ret, uint16_t kParamCount>
+class CSignatureOf : public MachineSignature {
+ protected:
+  MachineType storage_[1 + kParamCount];
+
+  CSignatureOf()
+      : MachineSignature(MachineTypeForC<Ret>() != kMachNone ? 1 : 0,
+                         kParamCount,
+                         reinterpret_cast<MachineType*>(&storage_)) {
+    if (return_count_ == 1) storage_[0] = MachineTypeForC<Ret>();
+  }
+  void Set(int index, MachineType type) {
+    DCHECK(index >= 0 && index < kParamCount);
+    reps_[return_count_ + index] = type;
+  }
+};
+
+// Helper classes for instantiating Signature objects to be callable from C.
+template <typename Ret>
+class CSignature0 : public CSignatureOf<Ret, 0> {
+ public:
+  CSignature0() : CSignatureOf<Ret, 0>() {}
+};
+
+template <typename Ret, typename P1>
+class CSignature1 : public CSignatureOf<Ret, 1> {
+ public:
+  CSignature1() : CSignatureOf<Ret, 1>() {
+    this->Set(0, MachineTypeForC<P1>());
+  }
+};
+
+template <typename Ret, typename P1, typename P2>
+class CSignature2 : public CSignatureOf<Ret, 2> {
+ public:
+  CSignature2() : CSignatureOf<Ret, 2>() {
+    this->Set(0, MachineTypeForC<P1>());
+    this->Set(1, MachineTypeForC<P2>());
+  }
+};
+
+template <typename Ret, typename P1, typename P2, typename P3>
+class CSignature3 : public CSignatureOf<Ret, 3> {
+ public:
+  CSignature3() : CSignatureOf<Ret, 3>() {
+    this->Set(0, MachineTypeForC<P1>());
+    this->Set(1, MachineTypeForC<P2>());
+    this->Set(2, MachineTypeForC<P3>());
+  }
+};
+
+static const CSignature2<int32_t, int32_t, int32_t> int32_int32_to_int32;
+static const CSignature2<uint32_t, uint32_t, uint32_t> uint32_uint32_to_uint32; +static const CSignature2<double, double, double> float64_float64_to_float64;
+}
+}
+}  // namespace v8::internal::compiler
+
+#endif  // V8_COMPILER_C_SIGNATURE_H_
=======================================
--- /trunk/.DEPS.git    Fri Aug  8 15:46:17 2014 UTC
+++ /trunk/.DEPS.git    Thu Aug 28 15:38:17 2014 UTC
@@ -24,6 +24,11 @@
 }

 deps_os = {
+    'android':
+    {
+        'v8/third_party/android_tools':
+ Var('git_url') + '/android_tools.git@31869996507de16812bb53a3d0aaa15cd6194c16',
+    },
     'win':
     {
         'v8/third_party/cygwin':
=======================================
--- /trunk/ChangeLog    Thu Aug 28 09:24:16 2014 UTC
+++ /trunk/ChangeLog    Thu Aug 28 15:38:17 2014 UTC
@@ -1,3 +1,8 @@
+2014-08-28: Version 3.29.27
+
+        Performance and stability improvements on all platforms.
+
+
 2014-08-28: Version 3.29.25

         Performance and stability improvements on all platforms.
=======================================
--- /trunk/DEPS Fri Aug  8 15:46:17 2014 UTC
+++ /trunk/DEPS Thu Aug 28 15:38:17 2014 UTC
@@ -3,6 +3,8 @@
 # all paths in here must match this assumption.

 vars = {
+  "chromium_git": "https://chromium.googlesource.com";,
+
   "chromium_trunk": "https://src.chromium.org/svn/trunk";,

   "buildtools_revision": "fb782d4369d5ae04f17a2fceef7de5a63e50f07b",
@@ -28,6 +30,11 @@
 }

 deps_os = {
+  "android": {
+    "v8/third_party/android_tools":
+      Var("chromium_git") + "/android_tools.git" + "@" +
+          "31869996507de16812bb53a3d0aaa15cd6194c16",
+  },
   "win": {
     "v8/third_party/cygwin":
       Var("chromium_trunk") + "/deps/third_party/cygwin@66844",
=======================================
--- /trunk/src/compiler/change-lowering.cc      Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/src/compiler/change-lowering.cc      Thu Aug 28 15:38:17 2014 UTC
@@ -3,6 +3,7 @@
 // found in the LICENSE file.

 #include "src/compiler/change-lowering.h"
+#include "src/compiler/machine-operator.h"

 #include "src/compiler/js-graph.h"

=======================================
--- /trunk/src/compiler/js-inlining.cc  Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/compiler/js-inlining.cc  Thu Aug 28 15:38:17 2014 UTC
@@ -47,35 +47,6 @@
   InlinerVisitor visitor(this);
   jsgraph_->graph()->VisitNodeInputsFromEnd(&visitor);
 }
-
-
-static void MoveWithDependencies(Graph* graph, Node* node, Node* old_block,
-                                 Node* new_block) {
-  if (OperatorProperties::HasControlInput(node->op())) {
-    // Check if we have left the old_block.
-    if (NodeProperties::GetControlInput(node) != old_block) return;
-    // If not, move this node to the new_block.
-    NodeProperties::ReplaceControlInput(node, new_block);
-  }
-  // Independent of whether a node has a control input or not,
-  // it might have a dependency that is pinned to old_block.
- for (InputIter iter = node->inputs().begin(); iter != node->inputs().end();
-       ++iter) {
-    if (NodeProperties::IsControlEdge(iter.edge())) continue;
-    MoveWithDependencies(graph, *iter, old_block, new_block);
-  }
-}
-
-
-static void MoveAllControlNodes(Node* from, Node* to) {
-  for (UseIter iter = from->uses().begin(); iter != from->uses().end();) {
-    if (NodeProperties::IsControlEdge(iter.edge())) {
-      iter.UpdateToAndIncrement(to);
-    } else {
-      ++iter;
-    }
-  }
-}


// TODO(sigurds) Find a home for this function and reuse it everywhere (esp. in
@@ -187,13 +158,9 @@
 void Inlinee::InlineAtCall(JSGraph* jsgraph, Node* call) {
   MachineOperatorBuilder machine(jsgraph->zone());

+ // The scheduler is smart enough to place our code; we just ensure {control}
+  // becomes the control input of the start of the inlinee.
   Node* control = NodeProperties::GetControlInput(call);
-  // Move all the nodes to the end block.
-  MoveAllControlNodes(control, end_block());
-  // Now move the ones the call depends on back up.
-  // We have to do this back-and-forth to treat the case where the call is
-  // pinned to the start block.
-  MoveWithDependencies(graph(), call, end_block(), control);

   // The inlinee uses the context from the JSFunction object. This will
// also be the effect dependency for the inlinee as it produces an effect.
=======================================
--- /trunk/src/compiler/linkage-impl.h  Sun Aug 24 11:34:17 2014 UTC
+++ /trunk/src/compiler/linkage-impl.h  Thu Aug 28 15:38:17 2014 UTC
@@ -21,8 +21,7 @@
   }

   static inline LinkageLocation WordRegisterLocation(Register reg) {
-    return LinkageLocation(MachineOperatorBuilder::pointer_rep(),
-                           Register::ToAllocationIndex(reg));
+    return LinkageLocation(kMachPtr, Register::ToAllocationIndex(reg));
   }

   static LinkageLocation UnconstrainedRegister(MachineType rep) {
@@ -180,8 +179,7 @@
     int index = 0;
     locations[index++] =
         TaggedRegisterLocation(LinkageTraits::ReturnValueReg());
-    locations[index++] = LinkageHelper::UnconstrainedRegister(
-        MachineOperatorBuilder::pointer_rep());
+    locations[index++] = LinkageHelper::UnconstrainedRegister(kMachPtr);
     // TODO(dcarney): test with lots of parameters.
     int i = 0;
for (; i < LinkageTraits::CRegisterParametersLength() && i < num_params;
=======================================
--- /trunk/src/compiler/linkage.h       Sun Aug 24 11:34:17 2014 UTC
+++ /trunk/src/compiler/linkage.h       Thu Aug 28 15:38:17 2014 UTC
@@ -9,7 +9,7 @@

 #include "src/code-stubs.h"
 #include "src/compiler/frame.h"
-#include "src/compiler/machine-operator.h"
+#include "src/compiler/machine-type.h"
 #include "src/compiler/node.h"
 #include "src/compiler/operator.h"
 #include "src/zone.h"
=======================================
--- /trunk/src/compiler/machine-operator.h      Thu Aug 21 00:04:56 2014 UTC
+++ /trunk/src/compiler/machine-operator.h      Thu Aug 28 15:38:17 2014 UTC
@@ -31,7 +31,7 @@
 // for generating code to run on architectures such as ia32, x64, arm, etc.
 class MachineOperatorBuilder {
  public:
- explicit MachineOperatorBuilder(Zone* zone, MachineType word = pointer_rep())
+  explicit MachineOperatorBuilder(Zone* zone, MachineType word = kMachPtr)
       : zone_(zone), word_(word) {
     CHECK(word == kRepWord32 || word == kRepWord64);
   }
@@ -155,10 +155,6 @@
   inline bool is32() const { return word_ == kRepWord32; }
   inline bool is64() const { return word_ == kRepWord64; }
   inline MachineType word() const { return word_; }
-
-  static inline MachineType pointer_rep() {
-    return kPointerSize == 8 ? kRepWord64 : kRepWord32;
-  }

 #undef WORD_SIZE
 #undef UNOP
=======================================
--- /trunk/src/compiler/machine-type.h  Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/compiler/machine-type.h  Thu Aug 28 15:38:17 2014 UTC
@@ -108,6 +108,32 @@
   }
 }

+// Describes the inputs and outputs of a function or call in terms of machine
+// types.
+class MachineSignature {
+ public:
+  MachineSignature(uint8_t return_count, uint16_t param_count,
+                   MachineType* reps)
+ : return_count_(return_count), param_count_(param_count), reps_(reps) {}
+
+  int GetReturnCount() const { return return_count_; }
+  int GetParamCount() const { return param_count_; }
+
+  MachineType GetParameterType(int index) const {
+    DCHECK(index >= 0 && index < param_count_);
+    return reps_[return_count_ + index];
+  }
+
+  MachineType GetReturnType(int index = 0) const {
+    DCHECK(index >= 0 && index < return_count_);
+    return reps_[index];
+  }
+
+ protected:
+  uint8_t return_count_;
+  uint16_t param_count_;
+  MachineType* reps_;
+};
 }  // namespace compiler
 }  // namespace internal
 }  // namespace v8
=======================================
--- /trunk/src/compiler/raw-machine-assembler.h Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/src/compiler/raw-machine-assembler.h Thu Aug 28 15:38:17 2014 UTC
@@ -47,7 +47,7 @@

   RawMachineAssembler(Graph* graph,
MachineCallDescriptorBuilder* call_descriptor_builder, - MachineType word = MachineOperatorBuilder::pointer_rep());
+                      MachineType word = kMachPtr);
   virtual ~RawMachineAssembler() {}

   Isolate* isolate() const { return zone()->isolate(); }
=======================================
--- /trunk/src/compiler/simplified-lowering.cc  Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/src/compiler/simplified-lowering.cc  Thu Aug 28 15:38:17 2014 UTC
@@ -453,10 +453,9 @@
             DeferReplacement(node, node->InputAt(0));
           } else {
             // Require the input in float64 format and perform truncation.
- // TODO(turbofan): could also avoid the truncation with a tag check.
+            // TODO(turbofan): avoid a truncation with a smi check.
VisitUnop(node, kTypeInt32 | kRepFloat64, kTypeInt32 | kRepWord32);
-            // TODO(titzer): should be a truncation.
-            node->set_op(lowering->machine()->ChangeFloat64ToInt32());
+            node->set_op(lowering->machine()->TruncateFloat64ToInt32());
           }
         } else {
// Propagate a type to the input, but pass through representation.
@@ -475,11 +474,10 @@
             DeferReplacement(node, node->InputAt(0));
           } else {
             // Require the input in float64 format to perform truncation.
- // TODO(turbofan): could also avoid the truncation with a tag check.
+            // TODO(turbofan): avoid the truncation with a smi check.
             VisitUnop(node, kTypeUint32 | kRepFloat64,
                       kTypeUint32 | kRepWord32);
-            // TODO(titzer): should be a truncation.
-            node->set_op(lowering->machine()->ChangeFloat64ToUint32());
+            node->set_op(lowering->machine()->TruncateFloat64ToInt32());
           }
         } else {
// Propagate a type to the input, but pass through representation.
=======================================
--- /trunk/src/compiler/simplified-operator-reducer.cc Thu Aug 28 07:03:22 2014 UTC +++ /trunk/src/compiler/simplified-operator-reducer.cc Thu Aug 28 15:38:17 2014 UTC
@@ -4,6 +4,7 @@

 #include "src/compiler/generic-node-inl.h"
 #include "src/compiler/js-graph.h"
+#include "src/compiler/machine-operator.h"
 #include "src/compiler/node-matchers.h"
 #include "src/compiler/simplified-operator-reducer.h"

=======================================
--- /trunk/src/compiler/structured-machine-assembler.h Wed Aug 27 00:06:40 2014 UTC +++ /trunk/src/compiler/structured-machine-assembler.h Thu Aug 28 15:38:17 2014 UTC
@@ -63,7 +63,7 @@

   StructuredMachineAssembler(
       Graph* graph, MachineCallDescriptorBuilder* call_descriptor_builder,
-      MachineType word = MachineOperatorBuilder::pointer_rep());
+      MachineType word = kMachPtr);
   virtual ~StructuredMachineAssembler() {}

   Isolate* isolate() const { return zone()->isolate(); }
=======================================
--- /trunk/src/serialize.cc     Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/serialize.cc     Thu Aug 28 15:38:17 2014 UTC
@@ -1087,7 +1087,8 @@
       // current object.
       CASE_STATEMENT(kRootArray, kPlain, kStartOfObject, 0)
       CASE_BODY(kRootArray, kPlain, kStartOfObject, 0)
-#if V8_OOL_CONSTANT_POOL
+#if defined(V8_TARGET_ARCH_MIPS) || V8_OOL_CONSTANT_POOL || \
+    defined(V8_TARGET_ARCH_MIPS64)
// Find an object in the roots array and write a pointer to it to in code.
       CASE_STATEMENT(kRootArray, kFromCode, kStartOfObject, 0)
       CASE_BODY(kRootArray, kFromCode, kStartOfObject, 0)
@@ -1302,14 +1303,6 @@
   for (int i = 0; i < root_index_wave_front_; i++) {
     Object* root = heap->roots_array_start()[i];
     if (!root->IsSmi() && root == heap_object) {
-#if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64)
-      if (from == kFromCode) {
-        // In order to avoid code bloat in the deserializer we don't have
-        // support for the encoding that specifies a particular root should
-        // be written from within code.
-        return kInvalidRootIndex;
-      }
-#endif
       return i;
     }
   }
@@ -1539,7 +1532,8 @@
           current_contents == current[-1]) {
DCHECK(!serializer_->isolate()->heap()->InNewSpace(current_contents));
         int repeat_count = 1;
- while (current < end - 1 && current[repeat_count] == current_contents) {
+        while (&current[repeat_count] < end - 1 &&
+               current[repeat_count] == current_contents) {
           repeat_count++;
         }
         current += repeat_count;
@@ -1636,6 +1630,7 @@
   int skip = OutputRawData(rinfo->pc(), kCanReturnSkipInsteadOfSkipping);
   Cell* object = Cell::cast(rinfo->target_cell());
   serializer_->SerializeObject(object, kPlain, kInnerPointer, skip);
+  bytes_processed_so_far_ += kPointerSize;
 }


=======================================
--- /trunk/src/version.cc       Thu Aug 28 09:24:16 2014 UTC
+++ /trunk/src/version.cc       Thu Aug 28 15:38:17 2014 UTC
@@ -34,7 +34,7 @@
 // system so their names cannot be changed without changing the scripts.
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     29
-#define BUILD_NUMBER      25
+#define BUILD_NUMBER      27
 #define PATCH_LEVEL       0
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
=======================================
--- /trunk/test/cctest/cctest.gyp       Sun Aug 24 11:34:17 2014 UTC
+++ /trunk/test/cctest/cctest.gyp       Thu Aug 28 15:38:17 2014 UTC
@@ -44,6 +44,7 @@
       ],
       'sources': [  ### gcmole(all) ###
         '<(generated_file)',
+        'compiler/c-signature.h',
         'compiler/codegen-tester.cc',
         'compiler/codegen-tester.h',
         'compiler/function-tester.h',
=======================================
--- /trunk/test/cctest/compiler/codegen-tester.h Wed Aug 20 00:06:26 2014 UTC +++ /trunk/test/cctest/compiler/codegen-tester.h Thu Aug 28 15:38:17 2014 UTC
@@ -30,7 +30,7 @@
         MachineAssembler(new (main_zone()) Graph(main_zone()),
ToCallDescriptorBuilder(main_zone(), return_type, p0,
                                                  p1, p2, p3, p4),
-                         MachineOperatorBuilder::pointer_rep()) {}
+                         kMachPtr) {}

Node* LoadFromPointer(void* address, MachineType rep, int32_t offset = 0) {
     return this->Load(rep, this->PointerConstant(address),
=======================================
--- /trunk/test/cctest/compiler/instruction-selector-tester.h Wed Aug 20 00:06:26 2014 UTC +++ /trunk/test/cctest/compiler/instruction-selector-tester.h Thu Aug 28 15:38:17 2014 UTC
@@ -40,7 +40,7 @@
             new (main_zone()) Graph(main_zone()),
             new (main_zone()) MachineCallDescriptorBuilder(
kMachInt32, kParameterCount, BuildParameterArray(main_zone())),
-            MachineOperatorBuilder::pointer_rep()) {}
+            kMachPtr) {}

   void SelectInstructions(CpuFeature feature) {
     SelectInstructions(InstructionSelector::Features(feature));
=======================================
--- /trunk/test/cctest/compiler/test-run-inlining.cc Thu Aug 28 09:24:16 2014 UTC +++ /trunk/test/cctest/compiler/test-run-inlining.cc Thu Aug 28 15:38:17 2014 UTC
@@ -162,33 +162,34 @@
 TEST(InlineTwiceDependentDiamond) {
   FunctionTester T(
       "(function () {"
-      "function foo(s) { if (true) {"
-      "                  return 12 } else { return 13; } };"
-      "function bar(s,t) { return foo(foo(1)); };"
+      "var x = 41;"
+      "function foo(s) { AssertStackDepth(1); if (s % 2 == 0) {"
+      "                  return x - s } else { return x + s; } };"
+      "function bar(s,t) { return foo(foo(s)); };"
       "return bar;"
       "})();",
       CompilationInfo::kInliningEnabled |
           CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
-  T.CheckCall(T.Val(12), T.undefined(), T.undefined());
+  T.CheckCall(T.Val(-11), T.Val(11), T.Val(4));
 }


-TEST(InlineTwiceDependentDiamondReal) {
+TEST(InlineTwiceDependentDiamondDifferent) {
   FunctionTester T(
       "(function () {"
       "var x = 41;"
-      "function foo(s) { AssertStackDepth(1); if (s % 2 == 0) {"
-      "                  return x - s } else { return x + s; } };"
-      "function bar(s,t) { return foo(foo(s)); };"
+      "function foo(s,t) { AssertStackDepth(1); if (s % 2 == 0) {"
+ " return x - s * t } else { return x + s * t; } };"
+      "function bar(s,t) { return foo(foo(s, 3), 5); };"
       "return bar;"
       "})();",
       CompilationInfo::kInliningEnabled |
           CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
-  T.CheckCall(T.Val(-11), T.Val(11), T.Val(4));
+  T.CheckCall(T.Val(-329), T.Val(11), T.Val(4));
 }

 #endif  // V8_TURBOFAN_TARGET
=======================================
--- /trunk/test/cctest/compiler/test-run-machops.cc Wed Aug 27 00:06:40 2014 UTC +++ /trunk/test/cctest/compiler/test-run-machops.cc Thu Aug 28 15:38:17 2014 UTC
@@ -3534,10 +3534,9 @@
     RawMachineAssemblerTester<int32_t> m;
     Node** args = NULL;
     MachineType* arg_types = NULL;
-    Node* function =
-        call_direct ? m.PointerConstant(function_address)
-                    : m.LoadFromPointer(&function_address,
- MachineOperatorBuilder::pointer_rep());
+    Node* function = call_direct
+                         ? m.PointerConstant(function_address)
+                         : m.LoadFromPointer(&function_address, kMachPtr);
     m.Return(m.CallC(function, kMachInt32, arg_types, args, 0));

     CHECK_EQ(7, m.Call());
@@ -3554,10 +3553,9 @@
     RawMachineAssemblerTester<int32_t> m(kMachInt32);
     Node* args[] = {m.Parameter(0)};
     MachineType arg_types[] = {kMachInt32};
-    Node* function =
-        call_direct ? m.PointerConstant(function_address)
-                    : m.LoadFromPointer(&function_address,
- MachineOperatorBuilder::pointer_rep());
+    Node* function = call_direct
+                         ? m.PointerConstant(function_address)
+                         : m.LoadFromPointer(&function_address, kMachPtr);
     m.Return(m.CallC(function, kMachInt32, arg_types, args, 1));

     FOR_INT32_INPUTS(i) {
@@ -3577,10 +3575,9 @@
     RawMachineAssemblerTester<int32_t> m(kMachInt32, kMachInt32);
     Node* args[] = {m.Parameter(0), m.Parameter(1)};
     MachineType arg_types[] = {kMachInt32, kMachInt32};
-    Node* function =
-        call_direct ? m.PointerConstant(function_address)
-                    : m.LoadFromPointer(&function_address,
- MachineOperatorBuilder::pointer_rep());
+    Node* function = call_direct
+                         ? m.PointerConstant(function_address)
+                         : m.LoadFromPointer(&function_address, kMachPtr);
     m.Return(m.CallC(function, kMachInt32, arg_types, args, 2));

     FOR_INT32_INPUTS(i) {
@@ -3819,8 +3816,7 @@

 static void IntPtrCompare(intptr_t left, intptr_t right) {
   for (int test = 0; test < 7; test++) {
- RawMachineAssemblerTester<bool> m(MachineOperatorBuilder::pointer_rep(), - MachineOperatorBuilder::pointer_rep());
+    RawMachineAssemblerTester<bool> m(kMachPtr, kMachPtr);
     Node* p0 = m.Parameter(0);
     Node* p1 = m.Parameter(1);
     Node* res = NULL;
=======================================
--- /trunk/test/cctest/compiler/test-simplified-lowering.cc Wed Aug 27 00:06:40 2014 UTC +++ /trunk/test/cctest/compiler/test-simplified-lowering.cc Thu Aug 28 15:38:17 2014 UTC
@@ -72,9 +72,8 @@

 FieldAccess ForArrayBufferBackingStore() {
   FieldAccess access = {
- kTaggedBase, JSArrayBuffer::kBackingStoreOffset,
-      Handle<Name>(),                        Type::UntaggedPtr(),
-      MachineOperatorBuilder::pointer_rep(),
+ kTaggedBase, JSArrayBuffer::kBackingStoreOffset, Handle<Name>(),
+      Type::UntaggedPtr(), kMachPtr,
   };
   return access;
 }
@@ -94,6 +93,66 @@
   return access;
 }
 }
+
+
+#ifndef V8_TARGET_ARCH_ARM64
+// TODO(titzer): these result in a stub call that doesn't work on ARM64.
+// TODO(titzer): factor these tests out to test-run-simplifiedops.cc.
+// TODO(titzer): test tagged representation for input to NumberToInt32.
+TEST(RunNumberToInt32_float64) {
+ // TODO(titzer): explicit load/stores here are only because of representations
+  double input;
+  int32_t result;
+  SimplifiedLoweringTester<Object*> t;
+  FieldAccess load = {kUntaggedBase, 0, Handle<Name>(), Type::Number(),
+                      kMachFloat64};
+  Node* loaded = t.LoadField(load, t.PointerConstant(&input));
+  Node* convert = t.NumberToInt32(loaded);
+  FieldAccess store = {kUntaggedBase, 0, Handle<Name>(), Type::Signed32(),
+                       kMachInt32};
+  t.StoreField(store, t.PointerConstant(&result), convert);
+  t.Return(t.jsgraph.TrueConstant());
+  t.LowerAllNodes();
+  t.GenerateCode();
+
+  if (Pipeline::SupportedTarget()) {
+    FOR_FLOAT64_INPUTS(i) {
+      input = *i;
+      int32_t expected = DoubleToInt32(*i);
+      t.Call();
+      CHECK_EQ(expected, result);
+    }
+  }
+}
+
+
+// TODO(titzer): test tagged representation for input to NumberToUint32.
+TEST(RunNumberToUint32_float64) {
+ // TODO(titzer): explicit load/stores here are only because of representations
+  double input;
+  uint32_t result;
+  SimplifiedLoweringTester<Object*> t;
+  FieldAccess load = {kUntaggedBase, 0, Handle<Name>(), Type::Number(),
+                      kMachFloat64};
+  Node* loaded = t.LoadField(load, t.PointerConstant(&input));
+  Node* convert = t.NumberToUint32(loaded);
+ FieldAccess store = {kUntaggedBase, 0, Handle<Name>(), Type::Unsigned32(),
+                       kMachUint32};
+  t.StoreField(store, t.PointerConstant(&result), convert);
+  t.Return(t.jsgraph.TrueConstant());
+  t.LowerAllNodes();
+  t.GenerateCode();
+
+  if (Pipeline::SupportedTarget()) {
+    FOR_FLOAT64_INPUTS(i) {
+      input = *i;
+      uint32_t expected = DoubleToUint32(*i);
+      t.Call();
+ CHECK_EQ(static_cast<int32_t>(expected), static_cast<int32_t>(result));
+    }
+  }
+}
+#endif


 // Create a simple JSObject with a unique map.
@@ -907,6 +966,33 @@
   t.Lower();
   CheckChangeOf(IrOpcode::kChangeTaggedToInt32, t.p0, use->InputAt(0));
 }
+
+
+TEST(LowerNumberToInt32_to_TruncateFloat64ToInt32) {
+  // NumberToInt32(x: kRepFloat64) used as kMachInt32
+  TestingGraph t(Type::Number());
+  Node* p0 = t.ExampleWithOutput(kMachFloat64);
+  Node* trunc = t.graph()->NewNode(t.simplified()->NumberToInt32(), p0);
+  Node* use = t.Use(trunc, kMachInt32);
+  t.Return(use);
+  t.Lower();
+  CheckChangeOf(IrOpcode::kTruncateFloat64ToInt32, p0, use->InputAt(0));
+}
+
+
+TEST(LowerNumberToInt32_to_TruncateFloat64ToInt32_with_change) {
+  // NumberToInt32(x: kTypeNumber | kRepTagged) used as kMachInt32
+  TestingGraph t(Type::Number());
+  Node* trunc = t.graph()->NewNode(t.simplified()->NumberToInt32(), t.p0);
+  Node* use = t.Use(trunc, kMachInt32);
+  t.Return(use);
+  t.Lower();
+  Node* node = use->InputAt(0);
+  CHECK_EQ(IrOpcode::kTruncateFloat64ToInt32, node->opcode());
+  Node* of = node->InputAt(0);
+  CHECK_EQ(IrOpcode::kChangeTaggedToFloat64, of->opcode());
+  CHECK_EQ(t.p0, of->InputAt(0));
+}


 TEST(LowerNumberToInt32_to_ChangeFloat64ToTagged) {
@@ -918,12 +1004,6 @@
// TODO(titzer): NumberToInt32(x: kRepFloat64 | kTypeInt32) used as kRepWord32
   // | kTypeInt32
 }
-
-
-TEST(LowerNumberToInt32_to_TruncateFloat64ToInt32) {
-  // TODO(titzer): NumberToInt32(x: kRepFloat64) used as kRepWord32 |
-  // kTypeUint32
-}


 TEST(LowerNumberToUint32_to_nop) {
@@ -957,6 +1037,33 @@
   t.Lower();
   CheckChangeOf(IrOpcode::kChangeTaggedToUint32, t.p0, use->InputAt(0));
 }
+
+
+TEST(LowerNumberToUint32_to_TruncateFloat64ToInt32) {
+  // NumberToUint32(x: kRepFloat64) used as kMachUint32
+  TestingGraph t(Type::Number());
+  Node* p0 = t.ExampleWithOutput(kMachFloat64);
+  Node* trunc = t.graph()->NewNode(t.simplified()->NumberToUint32(), p0);
+  Node* use = t.Use(trunc, kMachUint32);
+  t.Return(use);
+  t.Lower();
+  CheckChangeOf(IrOpcode::kTruncateFloat64ToInt32, p0, use->InputAt(0));
+}
+
+
+TEST(LowerNumberToUint32_to_TruncateFloat64ToInt32_with_change) {
+  // NumberToInt32(x: kTypeNumber | kRepTagged) used as kMachUint32
+  TestingGraph t(Type::Number());
+  Node* trunc = t.graph()->NewNode(t.simplified()->NumberToUint32(), t.p0);
+  Node* use = t.Use(trunc, kMachUint32);
+  t.Return(use);
+  t.Lower();
+  Node* node = use->InputAt(0);
+  CHECK_EQ(IrOpcode::kTruncateFloat64ToInt32, node->opcode());
+  Node* of = node->InputAt(0);
+  CHECK_EQ(IrOpcode::kChangeTaggedToFloat64, of->opcode());
+  CHECK_EQ(t.p0, of->InputAt(0));
+}


 TEST(LowerNumberToUint32_to_ChangeFloat64ToTagged) {
=======================================
--- /trunk/test/cctest/compiler/test-structured-ifbuilder-fuzzer.cc Wed Aug 27 00:06:40 2014 UTC +++ /trunk/test/cctest/compiler/test-structured-ifbuilder-fuzzer.cc Thu Aug 28 15:38:17 2014 UTC
@@ -267,9 +267,7 @@
class IfBuilderGenerator : public StructuredMachineAssemblerTester<int32_t> {
  public:
   IfBuilderGenerator()
-      : StructuredMachineAssemblerTester<int32_t>(
-            MachineOperatorBuilder::pointer_rep(),
-            MachineOperatorBuilder::pointer_rep()),
+      : StructuredMachineAssemblerTester<int32_t>(kMachPtr, kMachPtr),
         var_(NewVariable(Int32Constant(kInitalVar))),
         c_(this),
         m_(this->zone()),
=======================================
--- /trunk/test/cctest/compiler/test-structured-machine-assembler.cc Wed Aug 27 00:06:40 2014 UTC +++ /trunk/test/cctest/compiler/test-structured-machine-assembler.cc Thu Aug 28 15:38:17 2014 UTC
@@ -878,9 +878,8 @@
 class QuicksortHelper : public StructuredMachineAssemblerTester<int32_t> {
  public:
   QuicksortHelper()
-      : StructuredMachineAssemblerTester<int32_t>(
-            MachineOperatorBuilder::pointer_rep(), kMachInt32,
-            MachineOperatorBuilder::pointer_rep(), kMachInt32),
+      : StructuredMachineAssemblerTester<int32_t>(kMachPtr, kMachInt32,
+                                                  kMachPtr, kMachInt32),
         input_(NULL),
         stack_limit_(NULL),
         one_(Int32Constant(1)),
=======================================
--- /trunk/test/compiler-unittests/instruction-selector-unittest.cc Thu Aug 28 07:03:22 2014 UTC +++ /trunk/test/compiler-unittests/instruction-selector-unittest.cc Thu Aug 28 15:38:17 2014 UTC
@@ -316,7 +316,7 @@

// -----------------------------------------------------------------------------
 // Calls with deoptimization.
-TEST_F(InstructionSelectorTest, CallJSFunctionWithDeopt) {
+TARGET_TEST_F(InstructionSelectorTest, CallJSFunctionWithDeopt) {
   StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged, kMachAnyTagged);

   BailoutId bailout_id(42);
@@ -360,7 +360,7 @@
 }


-TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
+TARGET_TEST_F(InstructionSelectorTest, CallFunctionStubWithDeopt) {
   StreamBuilder m(this, kMachAnyTagged, kMachAnyTagged, kMachAnyTagged,
                   kMachAnyTagged);

=======================================
--- /trunk/test/mjsunit/mjsunit.status  Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/test/mjsunit/mjsunit.status  Thu Aug 28 15:38:17 2014 UTC
@@ -466,9 +466,6 @@

   # Currently always deopt on minus zero
   'math-floor-of-div-minus-zero': [SKIP],
-
-  # BUG(v8:3457).
-  'deserialize-reference': [SKIP],
 }],  # 'arch == mipsel or arch == mips'

##############################################################################
@@ -520,9 +517,6 @@

   # Currently always deopt on minus zero
   'math-floor-of-div-minus-zero': [SKIP],
-
-  # BUG(v8:3457).
-  'deserialize-reference': [SKIP],
 }],  # 'arch == mips64el'

 ['arch == mips64el and simulator_run == False', {

--
--
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/d/optout.

Reply via email to