}
break;
}
- case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': case 'X': {
+ case 'i': case 'd': case 'u': case 'x': case 'c': case 'X': {
int value = current.data_.u_int_;
EmbeddedVector<char, 24> formatted;
int length = OS::SNPrintF(formatted, temp.start(), value);
Add(formatted.start());
break;
}
+ case 'p': {
+ void* value = current.data_.u_pointer_;
+ EmbeddedVector<char, 20> formatted;
+ OS::SNPrintF(formatted, temp.start(), value);
+ Add(formatted.start());
+ break;
+ }
default:
UNREACHABLE();
break;
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
+ FmtElm(void* value) : type_(POINTER) { // NOLINT
+ data_.u_pointer_ = value;
}
private:
friend class StringStream;
- enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE };
+ enum Type { INT, DOUBLE, C_STR, LC_STR, OBJ, HANDLE, POINTER };
Type type_;
union {
int u_int_;
const Vector<const uc16>* u_lc_str_;
Object* u_obj_;
Object** u_handle_;
+ void* u_pointer_;
} data_;
};
// Check that the key is a smi.
__ testl(rbx, Immediate(kSmiTagMask));
__ j(not_zero, &slow);
+ // If it is a smi, make sure it is zero-extended, so it can be
+ // used as an index in a memory operand.
+ __ movl(rbx, rbx); // Clear the high bits of rbx.
__ CmpInstanceType(rcx, JS_ARRAY_TYPE);
__ j(equal, &array);
// Object case: Check key against length in the elements array.
// rax: value
// rdx: JSObject
- // rbx: index (as a smi)
+ // rbx: index (as a smi), zero-extended.
__ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
// Check that the object is in fast mode (not dictionary).
__ Cmp(FieldOperand(rcx, HeapObject::kMapOffset), Factory::fixed_array_map());
[ $arch == x64 ]
-test-regexp/Graph: PASS || CRASH || FAIL
test-decls/Present: CRASH || FAIL
test-decls/Unknown: CRASH || FAIL
test-decls/Appearing: CRASH || FAIL