Add a temporary hack to FmtElm to truncate 64-bit pointers to 32-bits.
We will have to do some more work to get the code to handle pointers correctly. Also clean up the constructors, and reduce the long lines. Review URL: http://codereview.chromium.org/109021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
3fef1866cc
commit
4b26e7e5af
@ -72,13 +72,36 @@ class NoAllocationStringAllocator: public StringAllocator {
|
|||||||
|
|
||||||
class FmtElm {
|
class FmtElm {
|
||||||
public:
|
public:
|
||||||
FmtElm(int value) : type_(INT) { data_.u_int_ = value; } // NOLINT
|
FmtElm(int value) : type_(INT) { // NOLINT
|
||||||
explicit FmtElm(double value) : type_(DOUBLE) { data_.u_double_ = value; } // NOLINT
|
data_.u_int_ = value;
|
||||||
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
|
explicit FmtElm(double value) : type_(DOUBLE) {
|
||||||
FmtElm(Object* value) : type_(OBJ) { data_.u_obj_ = value; } // NOLINT
|
data_.u_double_ = value;
|
||||||
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(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:
|
private:
|
||||||
friend class StringStream;
|
friend class StringStream;
|
||||||
enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE };
|
enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE };
|
||||||
|
Loading…
Reference in New Issue
Block a user