From f20c7be069c48df3890a899d8db7565e20a80d50 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Tue, 18 Aug 2009 12:43:36 +0000 Subject: [PATCH] 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 --- test/cctest/cctest.status | 7 ------- test/cctest/test-decls.cc | 5 ++--- test/cctest/test-heap.cc | 12 +++--------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index 6c0a9df35..ead0d92d4 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -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 diff --git a/test/cctest/test-decls.cc b/test/cctest/test-decls.cc index 6c48f64f7..f083027d0 100644 --- a/test/cctest/test-decls.cc +++ b/test/cctest/test-decls.cc @@ -111,7 +111,7 @@ void DeclarationContext::InitializeIfNeeded() { if (is_initialized_) return; HandleScope scope; Local function = FunctionTemplate::New(); - Local data = Integer::New(reinterpret_cast(this)); + Local data = External::New(this); GetHolder(function)->SetNamedPropertyHandler(&HandleGet, &HandleSet, &HandleHas, @@ -179,8 +179,7 @@ v8::Handle DeclarationContext::HandleHas(Local key, DeclarationContext* DeclarationContext::GetInstance(const AccessorInfo& info) { - Local data = info.Data(); - return reinterpret_cast(Int32::Cast(*data)->Value()); + return static_cast(External::Unwrap(info.Data())); } diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc index 6b5907c2e..37dbdd7c6 100644 --- a/test/cctest/test-heap.cc +++ b/test/cctest/test-heap.cc @@ -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(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(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(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))); } -- 2.34.1