Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: src/unique.h

Issue 543743002: Remove deprecated PrintableUnique. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-operator-reducer.cc ('k') | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/unique.h
diff --git a/src/unique.h b/src/unique.h
index 2943ffa6f94c2e184d76acf35cd96750acff864e..b73d7de6feeba2e9f1cc7a62982f02ec2c4faf69 100644
--- a/src/unique.h
+++ b/src/unique.h
@@ -118,8 +118,6 @@ class Unique {
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 @@ class Unique {
};
-// 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:
« no previous file with comments | « src/compiler/simplified-operator-reducer.cc ('k') | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698