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

Unified Diff: src/string-stream.h

Issue 109021: Add a temporary hack to FmtElm to truncate 64-bit pointers to 32-bits. (Closed)
Patch Set: Merge Created 11 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.h
diff --git a/src/string-stream.h b/src/string-stream.h
index 901f376a5aff5b735c7e498575c3b374b4f92da1..fa20064e4a528be3760483b3ea6992e2cf609bed 100644
--- a/src/string-stream.h
+++ b/src/string-stream.h
@@ -72,13 +72,36 @@ class NoAllocationStringAllocator: public StringAllocator {
class FmtElm {
public:
- FmtElm(int value) : type_(INT) { data_.u_int_ = value; } // NOLINT
- explicit FmtElm(double value) : type_(DOUBLE) { data_.u_double_ = value; } // NOLINT
- FmtElm(const char* value) : type_(C_STR) { data_.u_c_str_ = value; } // NOLINT
- FmtElm(const Vector<const uc16>& value) : type_(LC_STR) { data_.u_lc_str_ = &value; } // NOLINT
- FmtElm(Object* value) : type_(OBJ) { data_.u_obj_ = value; } // NOLINT
- FmtElm(Handle<Object> value) : type_(HANDLE) { data_.u_handle_ = value.location(); } // NOLINT
- FmtElm(void* value) : type_(INT) { data_.u_int_ = reinterpret_cast<int>(value); } // NOLINT
+ FmtElm(int value) : type_(INT) { // NOLINT
+ data_.u_int_ = value;
+ }
+ explicit FmtElm(double value) : type_(DOUBLE) {
+ data_.u_double_ = value;
+ }
+ FmtElm(const char* value) : type_(C_STR) { // NOLINT
+ data_.u_c_str_ = value;
+ }
+ FmtElm(const Vector<const uc16>& value) : type_(LC_STR) { // NOLINT
+ data_.u_lc_str_ = &value;
+ }
+ FmtElm(Object* value) : type_(OBJ) { // NOLINT
+ data_.u_obj_ = value;
+ }
+ FmtElm(Handle<Object> value) : type_(HANDLE) { // NOLINT
+ data_.u_handle_ = value.location();
+ }
+ FmtElm(void* value) : type_(INT) { // NOLINT
+#if V8_HOST_ARCH_64_BIT
+ // TODO(x64): FmtElm needs to treat pointers as pointers, and not as
+ // ints. This will require adding a pointer type, etc. For now just
+ // hack it and truncate the pointer.
+ // http://code.google.com/p/v8/issues/detail?id=335
+ data_.u_int_ = 0;
+ UNIMPLEMENTED();
+#else
+ data_.u_int_ = reinterpret_cast<int>(value);
+#endif
+ }
private:
friend class StringStream;
enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE };
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698