From 0f590eb45f7a944b5c0a5fc6ad3db7fbe0d9d991 Mon Sep 17 00:00:00 2001 From: "mstarzinger@chromium.org" Date: Wed, 18 Apr 2012 17:49:53 +0000 Subject: [PATCH] Revert r11376 and r11379 due to compile failures on Windows. TBR=jkummerow@chromium.org Review URL: https://chromiumcodereview.appspot.com/10116030 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11380 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 58 ------------------------------------------------- src/heap.h | 9 ++------ src/isolate.cc | 3 --- src/isolate.h | 2 +- test/cctest/test-api.cc | 55 ---------------------------------------------- 5 files changed, 3 insertions(+), 124 deletions(-) diff --git a/include/v8.h b/include/v8.h index eb87488..430f410 100644 --- a/include/v8.h +++ b/include/v8.h @@ -2561,11 +2561,6 @@ Handle V8EXPORT Null(); Handle V8EXPORT True(); Handle V8EXPORT False(); -inline Handle Undefined(Isolate* isolate); -inline Handle Null(Isolate* isolate); -inline Handle True(Isolate* isolate); -inline Handle False(Isolate* isolate); - /** * A set of constraints that specifies the limits of the runtime's memory use. @@ -3909,13 +3904,6 @@ class Internals { static const int kFullStringRepresentationMask = 0x07; static const int kExternalTwoByteRepresentationTag = 0x02; - static const int kIsolateStateOffset = 0; - static const int kIsolateRootsOffset = 2 * kApiPointerSize; - static const int kUndefinedValueRootIndex = 5; - static const int kNullValueRootIndex = 7; - static const int kTrueValueRootIndex = 8; - static const int kFalseValueRootIndex = 9; - static const int kJSObjectType = 0xaa; static const int kFirstNonstringType = 0x80; static const int kOddballType = 0x82; @@ -3968,16 +3956,6 @@ class Internals { return representation == kExternalTwoByteRepresentationTag; } - static inline bool IsInitialized(v8::Isolate* isolate) { - uint8_t* addr = reinterpret_cast(isolate) + kIsolateStateOffset; - return *reinterpret_cast(addr) == 1; - } - - static inline internal::Object** GetRoot(v8::Isolate* isolate, int index) { - uint8_t* addr = reinterpret_cast(isolate) + kIsolateRootsOffset; - return reinterpret_cast(addr + index * kApiPointerSize); - } - template static inline T ReadField(Object* ptr, int offset) { uint8_t* addr = reinterpret_cast(ptr) + offset - kHeapObjectTag; @@ -4400,42 +4378,6 @@ Local AccessorInfo::Holder() const { } -Handle Undefined(Isolate* isolate) { - typedef internal::Object* S; - typedef internal::Internals I; - if (!I::IsInitialized(isolate)) return Undefined(); - S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex); - return Handle(reinterpret_cast(slot)); -} - - -Handle Null(Isolate* isolate) { - typedef internal::Object* S; - typedef internal::Internals I; - if (!I::IsInitialized(isolate)) return Null(); - S* slot = I::GetRoot(isolate, I::kNullValueRootIndex); - return Handle(reinterpret_cast(slot)); -} - - -Handle True(Isolate* isolate) { - typedef internal::Object* S; - typedef internal::Internals I; - if (!I::IsInitialized(isolate)) return True(); - S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex); - return Handle(reinterpret_cast(slot)); -} - - -Handle False(Isolate* isolate) { - typedef internal::Object* S; - typedef internal::Internals I; - if (!I::IsInitialized(isolate)) return False(); - S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex); - return Handle(reinterpret_cast(slot)); -} - - /** * \example shell.cc * A simple shell that takes a list of expressions on the diff --git a/src/heap.h b/src/heap.h index 83f69ff..af86f44 100644 --- a/src/heap.h +++ b/src/heap.h @@ -1418,11 +1418,6 @@ class Heap { kRootListLength }; - STATIC_CHECK(kUndefinedValueRootIndex == Internals::kUndefinedValueRootIndex); - STATIC_CHECK(kNullValueRootIndex == Internals::kNullValueRootIndex); - STATIC_CHECK(kTrueValueRootIndex == Internals::kTrueValueRootIndex); - STATIC_CHECK(kFalseValueRootIndex == Internals::kFalseValueRootIndex); - MUST_USE_RESULT MaybeObject* NumberToString( Object* number, bool check_number_string_cache = true); MUST_USE_RESULT MaybeObject* Uint32ToString( @@ -1617,8 +1612,6 @@ class Heap { // more expedient to get at the isolate directly from within Heap methods. Isolate* isolate_; - Object* roots_[kRootListLength]; - intptr_t code_range_size_; int reserved_semispace_size_; int max_semispace_size_; @@ -1734,6 +1727,8 @@ class Heap { // last GC. int old_gen_exhausted_; + Object* roots_[kRootListLength]; + Object* global_contexts_list_; StoreBufferRebuilder store_buffer_rebuilder_; diff --git a/src/isolate.cc b/src/isolate.cc index a8bbc2f..bf9b345 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -1854,9 +1854,6 @@ bool Isolate::Init(Deserializer* des) { LOG(this, LogCompiledFunctions()); } - CHECK(OFFSET_OF(Isolate, state_) == Internals::kIsolateStateOffset); - CHECK(OFFSET_OF(Isolate, heap_.roots_) == Internals::kIsolateRootsOffset); - state_ = INITIALIZED; time_millis_at_init_ = OS::TimeCurrentMillis(); return true; diff --git a/src/isolate.h b/src/isolate.h index c0ecafa..2ff1318 100644 --- a/src/isolate.h +++ b/src/isolate.h @@ -1101,7 +1101,6 @@ class Isolate { }; State state_; - Heap heap_; EntryStackItem* entry_stack_; // Allocate and insert PerIsolateThreadData into the ThreadDataTable @@ -1162,6 +1161,7 @@ class Isolate { Mutex* break_access_; Atomic32 debugger_initialized_; Mutex* debugger_access_; + Heap heap_; Logger* logger_; StackGuard stack_guard_; StatsTable* stats_table_; diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index 0952176..ed5de37 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -16408,58 +16408,3 @@ TEST(PrimaryStubCache) { StubCacheHelper(false); } - -TEST(StaticGetters) { - v8::HandleScope scope; - LocalContext context; - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - i::Handle undefined_value = FACTORY->undefined_value(); - CHECK(*v8::Utils::OpenHandle(*v8::Undefined()) == *undefined_value); - CHECK(*v8::Utils::OpenHandle(*v8::Undefined(isolate)) == *undefined_value); - i::Handle null_value = FACTORY->null_value(); - CHECK(*v8::Utils::OpenHandle(*v8::Null()) == *null_value); - CHECK(*v8::Utils::OpenHandle(*v8::Null(isolate)) == *null_value); - i::Handle true_value = FACTORY->true_value(); - CHECK(*v8::Utils::OpenHandle(*v8::True()) == *true_value); - CHECK(*v8::Utils::OpenHandle(*v8::True(isolate)) == *true_value); - i::Handle false_value = FACTORY->false_value(); - CHECK(*v8::Utils::OpenHandle(*v8::False()) == *false_value); - CHECK(*v8::Utils::OpenHandle(*v8::False(isolate)) == *false_value); -} - - -static int fatal_error_callback_counter = 0; -static void CountingErrorCallback(const char* location, const char* message) { - printf("CountingErrorCallback(\"%s\", \"%s\")\n", location, message); - fatal_error_callback_counter++; -} - - -TEST(StaticGettersAfterDeath) { - v8::HandleScope scope; - LocalContext context; - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - CHECK(i::Internals::IsInitialized(isolate)); - CHECK_EQ(0, fatal_error_callback_counter); - v8::V8::SetFatalErrorHandler(CountingErrorCallback); - v8::Utils::ReportApiFailure("StaticGettersAfterDeath()", "Kill V8"); - i::Isolate::Current()->TearDown(); - CHECK(!i::Internals::IsInitialized(isolate)); - CHECK_EQ(1, fatal_error_callback_counter); - CHECK(v8::Undefined().IsEmpty()); - CHECK_EQ(2, fatal_error_callback_counter); - CHECK(v8::Undefined(isolate).IsEmpty()); - CHECK_EQ(3, fatal_error_callback_counter); - CHECK(v8::Null().IsEmpty()); - CHECK_EQ(4, fatal_error_callback_counter); - CHECK(v8::Null(isolate).IsEmpty()); - CHECK_EQ(5, fatal_error_callback_counter); - CHECK(v8::True().IsEmpty()); - CHECK_EQ(6, fatal_error_callback_counter); - CHECK(v8::True(isolate).IsEmpty()); - CHECK_EQ(7, fatal_error_callback_counter); - CHECK(v8::False().IsEmpty()); - CHECK_EQ(8, fatal_error_callback_counter); - CHECK(v8::False(isolate).IsEmpty()); - CHECK_EQ(9, fatal_error_callback_counter); -} -- 2.7.4