Commit f20c7be0 authored by whesse@chromium.org's avatar whesse@chromium.org

Fix errors in test-heap.cc and test-decls.cc. Adjust cctest.status.

Review URL: http://codereview.chromium.org/172089

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e9365fb3
......@@ -63,15 +63,8 @@ test-api/TryCatchInTryFinally: FAIL
[ $arch == x64 ]
test-decls/Present: CRASH || FAIL
test-decls/Unknown: CRASH || FAIL
test-decls/Appearing: CRASH || FAIL
test-decls/Absent: CRASH || FAIL
test-debug/DebugStub: CRASH || FAIL
test-decls/AbsentInPrototype: CRASH || FAIL
test-decls/Reappearing: CRASH || FAIL
test-debug/DebugInfo: CRASH || FAIL
test-decls/ExistsInPrototype: CRASH || FAIL
test-debug/BreakPointICStore: CRASH || FAIL
test-debug/BreakPointICLoad: CRASH || FAIL
test-debug/BreakPointICCall: CRASH || FAIL
......
......@@ -111,7 +111,7 @@ void DeclarationContext::InitializeIfNeeded() {
if (is_initialized_) return;
HandleScope scope;
Local<FunctionTemplate> function = FunctionTemplate::New();
Local<Value> data = Integer::New(reinterpret_cast<intptr_t>(this));
Local<Value> data = External::New(this);
GetHolder(function)->SetNamedPropertyHandler(&HandleGet,
&HandleSet,
&HandleHas,
......@@ -179,8 +179,7 @@ v8::Handle<Boolean> DeclarationContext::HandleHas(Local<String> key,
DeclarationContext* DeclarationContext::GetInstance(const AccessorInfo& info) {
Local<Value> data = info.Data();
return reinterpret_cast<DeclarationContext*>(Int32::Cast(*data)->Value());
return static_cast<DeclarationContext*>(External::Unwrap(info.Data()));
}
......
......@@ -44,35 +44,26 @@ TEST(HeapMaps) {
static void CheckOddball(Object* obj, const char* string) {
CHECK(obj->IsOddball());
#ifndef V8_HOST_ARCH_64_BIT
// TODO(X64): Reenable when native builtins work.
bool exc;
Object* print_string = *Execution::ToString(Handle<Object>(obj), &exc);
CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string)));
#endif // V8_HOST_ARCH_64_BIT
}
static void CheckSmi(int value, const char* string) {
#ifndef V8_HOST_ARCH_64_BIT
// TODO(X64): Reenable when native builtins work.
bool exc;
Object* print_string =
*Execution::ToString(Handle<Object>(Smi::FromInt(value)), &exc);
CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string)));
#endif // V8_HOST_ARCH_64_BIT
}
static void CheckNumber(double value, const char* string) {
Object* obj = Heap::NumberFromDouble(value);
CHECK(obj->IsNumber());
#ifndef V8_HOST_ARCH_64_BIT
// TODO(X64): Reenable when native builtins work.
bool exc;
Object* print_string = *Execution::ToString(Handle<Object>(obj), &exc);
CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string)));
#endif // V8_HOST_ARCH_64_BIT
}
......@@ -492,8 +483,11 @@ static const char* not_so_random_string_table[] = {
static void CheckSymbols(const char** strings) {
for (const char* string = *strings; *strings != 0; string = *strings++) {
Object* a = Heap::LookupAsciiSymbol(string);
// LookupAsciiSymbol may return a failure if a GC is needed.
if (a->IsFailure()) continue;
CHECK(a->IsSymbol());
Object* b = Heap::LookupAsciiSymbol(string);
if (b->IsFailure()) continue;
CHECK_EQ(b, a);
CHECK(String::cast(b)->IsEqualTo(CStrVector(string)));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment