Revision: 23697
Author:   [email protected]
Date:     Thu Sep  4 13:45:05 2014 UTC
Log:      Remove deprecated PrintableUnique.

[email protected]

Review URL: https://codereview.chromium.org/543743002
https://code.google.com/p/v8/source/detail?r=23697

Modified:
 /branches/bleeding_edge/src/compiler/ast-graph-builder.cc
 /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc
 /branches/bleeding_edge/src/compiler/common-operator.h
 /branches/bleeding_edge/src/compiler/graph-builder.h
 /branches/bleeding_edge/src/compiler/graph-unittest.cc
 /branches/bleeding_edge/src/compiler/graph-unittest.h
 /branches/bleeding_edge/src/compiler/js-graph.cc
 /branches/bleeding_edge/src/compiler/js-graph.h
 /branches/bleeding_edge/src/compiler/js-operator.h
 /branches/bleeding_edge/src/compiler/machine-node-factory.h
 /branches/bleeding_edge/src/compiler/node-matchers.h
 /branches/bleeding_edge/src/compiler/operator.h
 /branches/bleeding_edge/src/compiler/raw-machine-assembler.h
 /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc
 /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h
 /branches/bleeding_edge/src/unique.h
 /branches/bleeding_edge/test/cctest/compiler/test-codegen-deopt.cc
 /branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc

=======================================
--- /branches/bleeding_edge/src/compiler/ast-graph-builder.cc Wed Sep 3 14:10:20 2014 UTC +++ /branches/bleeding_edge/src/compiler/ast-graph-builder.cc Thu Sep 4 13:45:05 2014 UTC
@@ -900,7 +900,7 @@
           if (property->emit_store()) {
             VisitForValue(property->value());
             Node* value = environment()->Pop();
-            PrintableUnique<Name> name = MakeUnique(key->AsPropertyName());
+            Unique<Name> name = MakeUnique(key->AsPropertyName());
Node* store = NewNode(javascript()->StoreNamed(strict_mode(), name),
                                   literal, value);
             PrepareFrameState(store, key->id());
@@ -1025,7 +1025,7 @@
       VisitForValue(property->obj());
       Node* object = environment()->Pop();
       value = environment()->Pop();
-      PrintableUnique<Name> name =
+      Unique<Name> name =
           MakeUnique(property->key()->AsLiteral()->AsPropertyName());
       Node* store =
NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
@@ -1084,7 +1084,7 @@
       }
       case NAMED_PROPERTY: {
         Node* object = environment()->Top();
-        PrintableUnique<Name> name =
+        Unique<Name> name =
             MakeUnique(property->key()->AsLiteral()->AsPropertyName());
         old_value = NewNode(javascript()->LoadNamed(name), object);
         PrepareFrameState(old_value, property->LoadId(), kPushOutput);
@@ -1120,7 +1120,7 @@
     }
     case NAMED_PROPERTY: {
       Node* object = environment()->Pop();
-      PrintableUnique<Name> name =
+      Unique<Name> name =
           MakeUnique(property->key()->AsLiteral()->AsPropertyName());
       Node* store =
NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
@@ -1165,8 +1165,7 @@
   if (expr->key()->IsPropertyName()) {
     VisitForValue(expr->obj());
     Node* object = environment()->Pop();
-    PrintableUnique<Name> name =
-        MakeUnique(expr->key()->AsLiteral()->AsPropertyName());
+ Unique<Name> name = MakeUnique(expr->key()->AsLiteral()->AsPropertyName());
     value = NewNode(javascript()->LoadNamed(name), object);
   } else {
     VisitForValue(expr->obj());
@@ -1212,7 +1211,7 @@
       VisitForValue(property->obj());
       Node* object = environment()->Top();
       if (property->key()->IsPropertyName()) {
-        PrintableUnique<Name> name =
+        Unique<Name> name =
             MakeUnique(property->key()->AsLiteral()->AsPropertyName());
         callee_value = NewNode(javascript()->LoadNamed(name), object);
       } else {
@@ -1302,7 +1301,7 @@
   // before arguments are being evaluated.
   CallFunctionFlags flags = NO_CALL_FUNCTION_FLAGS;
   Node* receiver_value = BuildLoadBuiltinsObject();
-  PrintableUnique<String> unique = MakeUnique(name);
+  Unique<String> unique = MakeUnique(name);
Node* callee_value = NewNode(javascript()->LoadNamed(unique), receiver_value);
   // TODO(jarin): Find/create a bailout id to deoptimize to (crankshaft
   // refuses to optimize functions with jsruntime calls).
@@ -1385,7 +1384,7 @@
     case NAMED_PROPERTY: {
       VisitForValue(property->obj());
       Node* object = environment()->Top();
-      PrintableUnique<Name> name =
+      Unique<Name> name =
           MakeUnique(property->key()->AsLiteral()->AsPropertyName());
       old_value = NewNode(javascript()->LoadNamed(name), object);
       PrepareFrameState(old_value, property->LoadId(), kPushOutput);
@@ -1427,7 +1426,7 @@
     }
     case NAMED_PROPERTY: {
       Node* object = environment()->Pop();
-      PrintableUnique<Name> name =
+      Unique<Name> name =
           MakeUnique(property->key()->AsLiteral()->AsPropertyName());
       Node* store =
NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
@@ -1746,7 +1745,7 @@
     case Variable::UNALLOCATED: {
       // Global var, const, or let variable.
       Node* global = BuildLoadGlobalObject();
-      PrintableUnique<Name> name = MakeUnique(variable->name());
+      Unique<Name> name = MakeUnique(variable->name());
       Operator* op = javascript()->LoadNamed(name, contextual_mode);
       Node* node = NewNode(op, global);
       PrepareFrameState(node, bailout_id, kPushOutput);
@@ -1847,7 +1846,7 @@
     case Variable::UNALLOCATED: {
       // Global var, const, or let variable.
       Node* global = BuildLoadGlobalObject();
-      PrintableUnique<Name> name = MakeUnique(variable->name());
+      Unique<Name> name = MakeUnique(variable->name());
       Operator* op = javascript()->StoreNamed(strict_mode(), name);
       Node* store = NewNode(op, global, value);
       PrepareFrameState(store, bailout_id);
=======================================
--- /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc Thu Sep 4 08:44:03 2014 UTC +++ /branches/bleeding_edge/src/compiler/change-lowering-unittest.cc Thu Sep 4 13:45:05 2014 UTC
@@ -87,8 +87,8 @@
   Matcher<Node*> IsAllocateHeapNumber(const Matcher<Node*>& effect_matcher,
const Matcher<Node*>& control_matcher) {
     return IsCall(
-        _, IsHeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
-               zone(), CEntryStub(isolate(), 1).GetCode())),
+        _, IsHeapConstant(Unique<HeapObject>::CreateImmovable(
+               CEntryStub(isolate(), 1).GetCode())),
         IsExternalConstant(ExternalReference(
Runtime::FunctionForId(Runtime::kAllocateHeapNumber), isolate())),
         IsInt32Constant(0), IsNumberConstant(0.0), effect_matcher,
=======================================
--- /branches/bleeding_edge/src/compiler/common-operator.h Thu Sep 4 09:37:25 2014 UTC +++ /branches/bleeding_edge/src/compiler/common-operator.h Thu Sep 4 13:45:05 2014 UTC
@@ -138,8 +138,8 @@
         Operator1<double>(IrOpcode::kNumberConstant, Operator::kPure, 0, 1,
                           "NumberConstant", value);
   }
-  Operator* HeapConstant(PrintableUnique<Object> value) {
-    return new (zone_) Operator1<PrintableUnique<Object> >(
+  Operator* HeapConstant(Unique<Object> value) {
+    return new (zone_) Operator1<Unique<Object> >(
IrOpcode::kHeapConstant, Operator::kPure, 0, 1, "HeapConstant", value);
   }
   Operator* Phi(int arguments) {
@@ -289,23 +289,23 @@
 };

 template <typename T>
-struct CommonOperatorTraits<PrintableUnique<T> > {
+struct CommonOperatorTraits<Unique<T> > {
   static inline bool HasValue(const Operator* op) {
     return op->opcode() == IrOpcode::kHeapConstant;
   }
-  static inline PrintableUnique<T> ValueOf(const Operator* op) {
+  static inline Unique<T> ValueOf(const Operator* op) {
     CHECK_EQ(IrOpcode::kHeapConstant, op->opcode());
-    return OpParameter<PrintableUnique<T> >(op);
+    return OpParameter<Unique<T> >(op);
   }
 };

 template <typename T>
 struct CommonOperatorTraits<Handle<T> > {
   static inline bool HasValue(const Operator* op) {
-    return CommonOperatorTraits<PrintableUnique<T> >::HasValue(op);
+    return CommonOperatorTraits<Unique<T> >::HasValue(op);
   }
   static inline Handle<T> ValueOf(const Operator* op) {
-    return CommonOperatorTraits<PrintableUnique<T> >::ValueOf(op).handle();
+    return CommonOperatorTraits<Unique<T> >::ValueOf(op).handle();
   }
 };

=======================================
--- /branches/bleeding_edge/src/compiler/graph-builder.h Mon Sep 1 09:31:14 2014 UTC +++ /branches/bleeding_edge/src/compiler/graph-builder.h Thu Sep 4 13:45:05 2014 UTC
@@ -128,8 +128,8 @@

   // Helper to wrap a Handle<T> into a Unique<T>.
   template <class T>
-  PrintableUnique<T> MakeUnique(Handle<T> object) {
-    return PrintableUnique<T>::CreateUninitialized(zone(), object);
+  Unique<T> MakeUnique(Handle<T> object) {
+    return Unique<T>::CreateUninitialized(object);
   }

// Support for control flow builders. The concrete type of the environment
=======================================
--- /branches/bleeding_edge/src/compiler/graph-unittest.cc Tue Sep 2 07:07:52 2014 UTC +++ /branches/bleeding_edge/src/compiler/graph-unittest.cc Thu Sep 4 13:45:05 2014 UTC
@@ -19,9 +19,8 @@

 // TODO(bmeurer): Find a new home for these functions.
 template <typename T>
-inline std::ostream& operator<<(std::ostream& os,
-                                const PrintableUnique<T>& value) {
-  return os << value.string();
+inline std::ostream& operator<<(std::ostream& os, const Unique<T>& value) {
+  return os << *value.handle();
 }
 inline std::ostream& operator<<(std::ostream& os,
                                 const ExternalReference& value) {
@@ -65,32 +64,32 @@
 }


-Node* GraphTest::HeapConstant(const PrintableUnique<HeapObject>& value) {
+Node* GraphTest::HeapConstant(const Unique<HeapObject>& value) {
   return graph()->NewNode(common()->HeapConstant(value));
 }


 Node* GraphTest::FalseConstant() {
-  return HeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
-      zone(), factory()->false_value()));
+  return HeapConstant(
+      Unique<HeapObject>::CreateImmovable(factory()->false_value()));
 }


 Node* GraphTest::TrueConstant() {
-  return HeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
-      zone(), factory()->true_value()));
+  return HeapConstant(
+      Unique<HeapObject>::CreateImmovable(factory()->true_value()));
 }


 Matcher<Node*> GraphTest::IsFalseConstant() {
-  return IsHeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
-      zone(), factory()->false_value()));
+  return IsHeapConstant(
+      Unique<HeapObject>::CreateImmovable(factory()->false_value()));
 }


 Matcher<Node*> GraphTest::IsTrueConstant() {
-  return IsHeapConstant(PrintableUnique<HeapObject>::CreateImmovable(
-      zone(), factory()->true_value()));
+  return IsHeapConstant(
+      Unique<HeapObject>::CreateImmovable(factory()->true_value()));
 }

 namespace {
@@ -640,8 +639,8 @@


 Matcher<Node*> IsHeapConstant(
-    const Matcher<PrintableUnique<HeapObject> >& value_matcher) {
-  return MakeMatcher(new IsConstantMatcher<PrintableUnique<HeapObject> >(
+    const Matcher<Unique<HeapObject> >& value_matcher) {
+  return MakeMatcher(new IsConstantMatcher<Unique<HeapObject> >(
       IrOpcode::kHeapConstant, value_matcher));
 }

=======================================
--- /branches/bleeding_edge/src/compiler/graph-unittest.h Thu Sep 4 08:44:03 2014 UTC +++ /branches/bleeding_edge/src/compiler/graph-unittest.h Thu Sep 4 13:45:05 2014 UTC
@@ -17,7 +17,7 @@
 // Forward declarations.
 class HeapObject;
 template <class T>
-class PrintableUnique;
+class Unique;

 namespace compiler {

@@ -35,7 +35,7 @@
   Node* Int32Constant(int32_t value);
   Node* Int64Constant(int64_t value);
   Node* NumberConstant(double value);
-  Node* HeapConstant(const PrintableUnique<HeapObject>& value);
+  Node* HeapConstant(const Unique<HeapObject>& value);
   Node* FalseConstant();
   Node* TrueConstant();

@@ -64,7 +64,7 @@
 Matcher<Node*> IsExternalConstant(
     const Matcher<ExternalReference>& value_matcher);
 Matcher<Node*> IsHeapConstant(
-    const Matcher<PrintableUnique<HeapObject> >& value_matcher);
+    const Matcher<Unique<HeapObject> >& value_matcher);
 Matcher<Node*> IsFloat64Constant(const Matcher<double>& value_matcher);
 Matcher<Node*> IsInt32Constant(const Matcher<int32_t>& value_matcher);
 Matcher<Node*> IsInt64Constant(const Matcher<int64_t>& value_matcher);
=======================================
--- /branches/bleeding_edge/src/compiler/js-graph.cc Thu Sep 4 11:13:35 2014 UTC +++ /branches/bleeding_edge/src/compiler/js-graph.cc Thu Sep 4 13:45:05 2014 UTC
@@ -11,8 +11,7 @@
 namespace compiler {

 Node* JSGraph::ImmovableHeapConstant(Handle<Object> object) {
-  PrintableUnique<Object> unique =
-      PrintableUnique<Object>::CreateImmovable(zone(), object);
+  Unique<Object> unique = Unique<Object>::CreateImmovable(object);
   return NewNode(common()->HeapConstant(unique));
 }

@@ -94,7 +93,7 @@
 }


-Node* JSGraph::HeapConstant(PrintableUnique<Object> value) {
+Node* JSGraph::HeapConstant(Unique<Object> value) {
   // TODO(turbofan): canonicalize heap constants using Unique<T>
   return NewNode(common()->HeapConstant(value));
 }
@@ -104,13 +103,11 @@
   // TODO(titzer): We could also match against the addresses of immortable
   // immovables here, even without access to the heap, thus always
   // canonicalizing references to them.
-  // return HeapConstant(
-  //    PrintableUnique<Object>::CreateUninitialized(zone(), value));
+  // return HeapConstant(Unique<Object>::CreateUninitialized(value));
// TODO(turbofan): This is a work-around to make Unique::HashCode() work for // value numbering. We need some sane way to compute a unique hash code for
   // arbitrary handles here.
-  PrintableUnique<Object> unique(
-      zone(), reinterpret_cast<Address>(*value.location()), value);
+ Unique<Object> unique(reinterpret_cast<Address>(*value.location()), value);
   return HeapConstant(unique);
 }

=======================================
--- /branches/bleeding_edge/src/compiler/js-graph.h Mon Aug 18 06:54:07 2014 UTC +++ /branches/bleeding_edge/src/compiler/js-graph.h Thu Sep 4 13:45:05 2014 UTC
@@ -42,7 +42,7 @@

// Creates a HeapConstant node, possibly canonicalized, without inspecting the
   // object.
-  Node* HeapConstant(PrintableUnique<Object> value);
+  Node* HeapConstant(Unique<Object> value);

// Creates a HeapConstant node, possibly canonicalized, and may access the
   // heap to inspect the object.
=======================================
--- /branches/bleeding_edge/src/compiler/js-operator.h Thu Aug 28 08:39:24 2014 UTC +++ /branches/bleeding_edge/src/compiler/js-operator.h Thu Sep 4 13:45:05 2014 UTC
@@ -40,7 +40,7 @@
// Defines the property being loaded from an object by a named load. This is
 // used as a parameter by JSLoadNamed operators.
 struct LoadNamedParameters {
-  PrintableUnique<Name> name;
+  Unique<Name> name;
   ContextualMode contextual_mode;
 };

@@ -55,7 +55,7 @@
 // used as a parameter by JSStoreNamed operators.
 struct StoreNamedParameters {
   StrictMode strict_mode;
-  PrintableUnique<Name> name;
+  Unique<Name> name;
 };

// Interface for building JavaScript-level operators, e.g. directly from the
@@ -124,7 +124,7 @@
   }

   Operator* LoadProperty() { BINOP(JSLoadProperty); }
-  Operator* LoadNamed(PrintableUnique<Name> name,
+  Operator* LoadNamed(Unique<Name> name,
                       ContextualMode contextual_mode = NOT_CONTEXTUAL) {
     LoadNamedParameters parameters = {name, contextual_mode};
OP1(JSLoadNamed, LoadNamedParameters, parameters, Operator::kNoProperties,
@@ -136,7 +136,7 @@
         0);
   }

- Operator* StoreNamed(StrictMode strict_mode, PrintableUnique<Name> name) {
+  Operator* StoreNamed(StrictMode strict_mode, Unique<Name> name) {
     StoreNamedParameters parameters = {strict_mode, name};
OP1(JSStoreNamed, StoreNamedParameters, parameters, Operator::kNoProperties,
         2, 0);
@@ -165,9 +165,9 @@

// TODO(titzer): nail down the static parts of each of these context flavors. Operator* CreateFunctionContext() { NOPROPS(JSCreateFunctionContext, 1, 1); }
-  Operator* CreateCatchContext(PrintableUnique<String> name) {
-    OP1(JSCreateCatchContext, PrintableUnique<String>, name,
-        Operator::kNoProperties, 1, 1);
+  Operator* CreateCatchContext(Unique<String> name) {
+ OP1(JSCreateCatchContext, Unique<String>, name, Operator::kNoProperties, 1,
+        1);
   }
   Operator* CreateWithContext() { NOPROPS(JSCreateWithContext, 2, 1); }
   Operator* CreateBlockContext() { NOPROPS(JSCreateBlockContext, 2, 1); }
=======================================
--- /branches/bleeding_edge/src/compiler/machine-node-factory.h Wed Sep 3 13:39:37 2014 UTC +++ /branches/bleeding_edge/src/compiler/machine-node-factory.h Thu Sep 4 13:45:05 2014 UTC
@@ -55,8 +55,7 @@
     return NEW_NODE_0(COMMON()->Float64Constant(value));
   }
   Node* HeapConstant(Handle<Object> object) {
-    PrintableUnique<Object> val =
-        PrintableUnique<Object>::CreateUninitialized(ZONE(), object);
+    Unique<Object> val = Unique<Object>::CreateUninitialized(object);
     return NEW_NODE_0(COMMON()->HeapConstant(val));
   }

=======================================
--- /branches/bleeding_edge/src/compiler/node-matchers.h Thu Sep 4 09:37:25 2014 UTC +++ /branches/bleeding_edge/src/compiler/node-matchers.h Thu Sep 4 13:45:05 2014 UTC
@@ -94,13 +94,12 @@


 // A pattern matcher for heap object constants.
-struct HeapObjectMatcher FINAL
-    : public ValueMatcher<PrintableUnique<HeapObject> > {
+struct HeapObjectMatcher FINAL : public ValueMatcher<Handle<HeapObject> > {
   explicit HeapObjectMatcher(Node* node)
-      : ValueMatcher<PrintableUnique<HeapObject> >(node) {}
+      : ValueMatcher<Handle<HeapObject> >(node) {}

-  bool IsKnownGlobal(HeapObject* global) const {
-    return HasValue() && Value().IsKnownGlobal(global);
+  bool IsKnownGlobal(Handle<HeapObject> global) const {
+    return HasValue() && Value().is_identical_to(global);
   }
 };

=======================================
--- /branches/bleeding_edge/src/compiler/operator.h Thu Sep 4 09:37:25 2014 UTC +++ /branches/bleeding_edge/src/compiler/operator.h Thu Sep 4 13:45:05 2014 UTC
@@ -178,32 +178,26 @@
   }
 };

-// Specialization for static parameters of type {PrintableUnique<Object>}.
+// Specialization for static parameters of type {Unique<Object>}.
 template <>
-struct StaticParameterTraits<PrintableUnique<Object> > {
- static OStream& PrintTo(OStream& os, PrintableUnique<Object> val) { // NOLINT
-    return os << val.string();
+struct StaticParameterTraits<Unique<Object> > {
+  static OStream& PrintTo(OStream& os, Unique<Object> val) {  // NOLINT
+    return os << Brief(*val.handle());
   }
-  static int HashCode(PrintableUnique<Object> a) {
+  static int HashCode(Unique<Object> a) {
     return static_cast<int>(a.Hashcode());
   }
- static bool Equals(PrintableUnique<Object> a, PrintableUnique<Object> b) {
-    return a == b;
-  }
+  static bool Equals(Unique<Object> a, Unique<Object> b) { return a == b; }
 };

-// Specialization for static parameters of type {PrintableUnique<Name>}.
+// Specialization for static parameters of type {Unique<Name>}.
 template <>
-struct StaticParameterTraits<PrintableUnique<Name> > {
- static OStream& PrintTo(OStream& os, PrintableUnique<Name> val) { // NOLINT
-    return os << val.string();
-  }
-  static int HashCode(PrintableUnique<Name> a) {
-    return static_cast<int>(a.Hashcode());
-  }
-  static bool Equals(PrintableUnique<Name> a, PrintableUnique<Name> b) {
-    return a == b;
+struct StaticParameterTraits<Unique<Name> > {
+  static OStream& PrintTo(OStream& os, Unique<Name> val) {  // NOLINT
+    return os << Brief(*val.handle());
   }
+ static int HashCode(Unique<Name> a) { return static_cast<int>(a.Hashcode()); }
+  static bool Equals(Unique<Name> a, Unique<Name> b) { return a == b; }
 };

 #if DEBUG
@@ -212,15 +206,15 @@
 template <>
 struct StaticParameterTraits<Handle<Object> > {
   static OStream& PrintTo(OStream& os, Handle<Object> val) {  // NOLINT
-    UNREACHABLE();  // Should use PrintableUnique<Object> instead
+    UNREACHABLE();  // Should use Unique<Object> instead
     return os;
   }
   static int HashCode(Handle<Object> a) {
-    UNREACHABLE();  // Should use PrintableUnique<Object> instead
+    UNREACHABLE();  // Should use Unique<Object> instead
     return 0;
   }
   static bool Equals(Handle<Object> a, Handle<Object> b) {
-    UNREACHABLE();  // Should use PrintableUnique<Object> instead
+    UNREACHABLE();  // Should use Unique<Object> instead
     return false;
   }
 };
@@ -267,7 +261,7 @@
 };

 // Type definitions for operators with specific types of parameters.
-typedef Operator1<PrintableUnique<Name> > NameOperator;
+typedef Operator1<Unique<Name> > NameOperator;


 // Helper to extract parameters from Operator1<*> operator.
=======================================
--- /branches/bleeding_edge/src/compiler/raw-machine-assembler.h Wed Sep 3 14:10:20 2014 UTC +++ /branches/bleeding_edge/src/compiler/raw-machine-assembler.h Thu Sep 4 13:45:05 2014 UTC
@@ -58,8 +58,8 @@
   MachineSignature* machine_sig() const { return machine_sig_; }

   Node* UndefinedConstant() {
- PrintableUnique<Object> unique = PrintableUnique<Object>::CreateImmovable(
-        zone(), isolate()->factory()->undefined_value());
+    Unique<Object> unique = Unique<Object>::CreateImmovable(
+        isolate()->factory()->undefined_value());
     return NewNode(common()->HeapConstant(unique));
   }

=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc Thu Sep 4 10:55:58 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-operator-reducer.cc Thu Sep 4 13:45:05 2014 UTC
@@ -19,10 +19,10 @@
   switch (node->opcode()) {
     case IrOpcode::kBooleanNot: {
       HeapObjectMatcher m(node->InputAt(0));
-      if (m.IsKnownGlobal(heap()->false_value())) {
+      if (m.IsKnownGlobal(factory()->false_value())) {
         return Replace(jsgraph()->TrueConstant());
       }
-      if (m.IsKnownGlobal(heap()->true_value())) {
+      if (m.IsKnownGlobal(factory()->true_value())) {
         return Replace(jsgraph()->FalseConstant());
       }
       if (m.IsBooleanNot()) return Replace(m.node()->InputAt(0));
@@ -37,8 +37,8 @@
     }
     case IrOpcode::kChangeBoolToBit: {
       HeapObjectMatcher m(node->InputAt(0));
-      if (m.IsKnownGlobal(heap()->false_value())) return ReplaceInt32(0);
-      if (m.IsKnownGlobal(heap()->true_value())) return ReplaceInt32(1);
+ if (m.IsKnownGlobal(factory()->false_value())) return ReplaceInt32(0);
+      if (m.IsKnownGlobal(factory()->true_value())) return ReplaceInt32(1);
       if (m.IsChangeBitToBool()) return Replace(m.node()->InputAt(0));
       break;
     }
@@ -128,8 +128,8 @@
Graph* SimplifiedOperatorReducer::graph() const { return jsgraph()->graph(); }


-Heap* SimplifiedOperatorReducer::heap() const {
-  return jsgraph()->isolate()->heap();
+Factory* SimplifiedOperatorReducer::factory() const {
+  return jsgraph()->isolate()->factory();
 }

 }  // namespace compiler
=======================================
--- /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h Tue Sep 2 07:07:52 2014 UTC +++ /branches/bleeding_edge/src/compiler/simplified-operator-reducer.h Thu Sep 4 13:45:05 2014 UTC
@@ -38,7 +38,7 @@
   Reduction ReplaceNumber(int32_t value);

   Graph* graph() const;
-  Heap* heap() const;
+  Factory* factory() const;
   JSGraph* jsgraph() const { return jsgraph_; }
   MachineOperatorBuilder* machine() const { return machine_; }

=======================================
--- /branches/bleeding_edge/src/unique.h        Tue Sep  2 07:07:52 2014 UTC
+++ /branches/bleeding_edge/src/unique.h        Thu Sep  4 13:45:05 2014 UTC
@@ -118,8 +118,6 @@
   friend class UniqueSet<T>;  // Uses internal details for speed.
   template <class U>
   friend class Unique;  // For comparing raw_address values.
-  template <class U>
-  friend class PrintableUnique;  // For automatic up casting.

  protected:
   Unique<T>() : raw_address_(NULL) { }
@@ -131,73 +129,6 @@
 };


-// TODO(danno): At some point if all of the uses of Unique end up using
-// PrintableUnique, then we should merge PrintableUnique into Unique and
-// predicate generating the printable string on a "am I tracing" check.
-template <class T>
-class PrintableUnique : public Unique<T> {
- public:
-  // TODO(titzer): make private and introduce a uniqueness scope.
-  PrintableUnique() : string_("null") {}
-
-  // TODO(titzer): make private and introduce a uniqueness scope.
- explicit PrintableUnique(Zone* zone, Handle<T> handle) : Unique<T>(handle) {
-    InitializeString(zone);
-  }
-
-  // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
-  PrintableUnique(Zone* zone, Address raw_address, Handle<T> handle)
-      : Unique<T>(raw_address, handle) {
-    InitializeString(zone);
-  }
-
-  // Constructor for handling automatic up casting.
- // Eg. PrintableUnique<JSFunction> can be passed when PrintableUnique<Object>
-  // is expected.
-  template <class S>
-  PrintableUnique(PrintableUnique<S> uniq)  // NOLINT
-      : Unique<T>(Handle<T>()) {
-#ifdef DEBUG
-    T* a = NULL;
-    S* b = NULL;
-    a = b;  // Fake assignment to enforce type checks.
-    USE(a);
-#endif
-    this->raw_address_ = uniq.raw_address_;
-    this->handle_ = uniq.handle_;
-    string_ = uniq.string();
-  }
-
-  // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
- static PrintableUnique<T> CreateUninitialized(Zone* zone, Handle<T> handle) { - return PrintableUnique<T>(zone, reinterpret_cast<Address>(NULL), handle);
-  }
-
-  static PrintableUnique<T> CreateImmovable(Zone* zone, Handle<T> handle) {
- return PrintableUnique<T>(zone, reinterpret_cast<Address>(*handle), handle);
-  }
-
-  const char* string() const { return string_; }
-
- private:
-  const char* string_;
-
-  void InitializeString(Zone* zone) {
-    // The stringified version of the parameter must be calculated when the
-    // Operator is constructed to avoid accessing the heap.
-    HeapStringAllocator temp_allocator;
-    StringStream stream(&temp_allocator);
-    this->handle_->ShortPrint(&stream);
-    SmartArrayPointer<const char> desc_string = stream.ToCString();
-    const char* desc_chars = desc_string.get();
-    int length = static_cast<int>(strlen(desc_chars));
-    char* desc_copy = zone->NewArray<char>(length + 1);
-    memcpy(desc_copy, desc_chars, length + 1);
-    string_ = desc_copy;
-  }
-};
-
-
 template <typename T>
 class UniqueSet FINAL : public ZoneObject {
  public:
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-codegen-deopt.cc Wed Sep 3 14:10:20 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/test-codegen-deopt.cc Thu Sep 4 13:45:05 2014 UTC
@@ -135,13 +135,13 @@

     Handle<JSFunction> deopt_function =
NewFunction("function deopt() { %DeoptimizeFunction(foo); }; deopt");
-    PrintableUnique<Object> deopt_fun_constant =
- PrintableUnique<Object>::CreateUninitialized(zone(), deopt_function);
+    Unique<Object> deopt_fun_constant =
+        Unique<Object>::CreateUninitialized(deopt_function);
Node* deopt_fun_node = m.NewNode(common.HeapConstant(deopt_fun_constant));

Handle<Context> context(deopt_function->context(), CcTest::i_isolate());
-    PrintableUnique<Object> context_constant =
-        PrintableUnique<Object>::CreateUninitialized(zone(), context);
+    Unique<Object> context_constant =
+        Unique<Object>::CreateUninitialized(context);
     Node* context_node = m.NewNode(common.HeapConstant(context_constant));

     bailout_id = GetCallBailoutId();
@@ -244,13 +244,13 @@
     CSignature1<Object*, Object*> sig;
     RawMachineAssembler m(graph, &sig);

-    PrintableUnique<Object> this_fun_constant =
-        PrintableUnique<Object>::CreateUninitialized(zone(), function);
+    Unique<Object> this_fun_constant =
+        Unique<Object>::CreateUninitialized(function);
Node* this_fun_node = m.NewNode(common.HeapConstant(this_fun_constant));

     Handle<Context> context(function->context(), CcTest::i_isolate());
-    PrintableUnique<Object> context_constant =
-        PrintableUnique<Object>::CreateUninitialized(zone(), context);
+    Unique<Object> context_constant =
+        Unique<Object>::CreateUninitialized(context);
     Node* context_node = m.NewNode(common.HeapConstant(context_constant));

     bailout_id = GetCallBailoutId();
=======================================
--- /branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc Mon Sep 1 09:31:14 2014 UTC +++ /branches/bleeding_edge/test/cctest/compiler/test-scheduler.cc Thu Sep 4 13:45:05 2014 UTC
@@ -680,8 +680,7 @@

   Handle<Object> object =
       Handle<Object>(isolate->heap()->undefined_value(), isolate);
-  PrintableUnique<Object> unique_constant =
- PrintableUnique<Object>::CreateUninitialized(scope.main_zone(), object); + Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object);

   // Manually transcripted code for:
   // function turbo_fan_test(a, b, c, y) {
@@ -826,8 +825,7 @@

   Handle<Object> object =
       Handle<Object>(isolate->heap()->undefined_value(), isolate);
-  PrintableUnique<Object> unique_constant =
- PrintableUnique<Object>::CreateUninitialized(scope.main_zone(), object); + Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object);

   // Manually transcripted code for:
   // function turbo_fan_test(a, b) {
@@ -939,8 +937,7 @@

   Handle<Object> object =
       Handle<Object>(isolate->heap()->undefined_value(), isolate);
-  PrintableUnique<Object> unique_constant =
- PrintableUnique<Object>::CreateUninitialized(scope.main_zone(), object); + Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object);

   // Manually transcripted code for:
   // function turbo_fan_test(a, b, c) {
@@ -1187,8 +1184,7 @@

   Handle<Object> object =
       Handle<Object>(isolate->heap()->undefined_value(), isolate);
-  PrintableUnique<Object> unique_constant =
- PrintableUnique<Object>::CreateUninitialized(scope.main_zone(), object); + Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object);

   // Manually transcripted code for:
   // function turbo_fan_test(a, b, c) {
@@ -1518,8 +1514,7 @@

   Handle<Object> object =
       Handle<Object>(isolate->heap()->undefined_value(), isolate);
-  PrintableUnique<Object> unique_constant =
- PrintableUnique<Object>::CreateUninitialized(scope.main_zone(), object); + Unique<Object> unique_constant = Unique<Object>::CreateUninitialized(object);

   // Manually transcripted code for:
   // function turbo_fan_test(a, b, c) {

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