From: kasperl@chromium.org Date: Mon, 8 Sep 2008 07:24:10 +0000 (+0000) Subject: Fix broken build. Sorry about that. X-Git-Tag: upstream/4.7.83~25439 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd3bf78bca7ec58fefeac8182a6b95af843492c5;p=platform%2Fupstream%2Fv8.git Fix broken build. Sorry about that. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/include/v8.h b/include/v8.h index 4646e812c..3ca8ec629 100644 --- a/include/v8.h +++ b/include/v8.h @@ -2123,11 +2123,11 @@ class EXPORT Locker { */ static void StopPreemption(); -#ifdef DEBUG - static void AssertIsLocked(); -#else - static inline void AssertIsLocked() { } -#endif + /** + * Returns whether or not the locker is locked by the current thread. + */ + static bool IsLocked(); + private: bool has_lock_; bool top_level_; diff --git a/src/debug.h b/src/debug.h index a26a1bfcb..33b6c57fe 100644 --- a/src/debug.h +++ b/src/debug.h @@ -25,8 +25,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef V8_DEBUG_H_ -#define V8_DEBUG_H_ +#ifndef V8_V8_DEBUG_H_ +#define V8_V8_DEBUG_H_ #include "../include/v8-debug.h" #include "assembler.h" @@ -574,4 +574,4 @@ class Debug_Address { } } // namespace v8::internal -#endif // V8_DEBUG_H_ +#endif // V8_V8_DEBUG_H_ diff --git a/src/v8threads.cc b/src/v8threads.cc index 89c791872..fd1e72eba 100644 --- a/src/v8threads.cc +++ b/src/v8threads.cc @@ -54,11 +54,9 @@ Locker::Locker() : has_lock_(false), top_level_(true) { } -#ifdef DEBUG -void Locker::AssertIsLocked() { - ASSERT(internal::ThreadManager::IsLockedByCurrentThread()); +bool Locker::IsLocked() { + return internal::ThreadManager::IsLockedByCurrentThread(); } -#endif Locker::~Locker() { @@ -282,7 +280,7 @@ static v8::internal::ContextSwitcher* switcher; void ContextSwitcher::StartPreemption(int every_n_ms) { - Locker::AssertIsLocked(); + ASSERT(Locker::IsLocked()); if (switcher == NULL) { switcher = new ContextSwitcher(every_n_ms); switcher->Start(); @@ -293,7 +291,7 @@ void ContextSwitcher::StartPreemption(int every_n_ms) { void ContextSwitcher::StopPreemption() { - Locker::AssertIsLocked(); + ASSERT(Locker::IsLocked()); if (switcher != NULL) { switcher->Stop(); delete(switcher); @@ -312,7 +310,7 @@ void ContextSwitcher::Run() { void ContextSwitcher::Stop() { - Locker::AssertIsLocked(); + ASSERT(Locker::IsLocked()); keep_going_ = false; preemption_semaphore_->Signal(); Join(); @@ -325,7 +323,7 @@ void ContextSwitcher::WaitForPreemption() { void ContextSwitcher::PreemptionReceived() { - Locker::AssertIsLocked(); + ASSERT(Locker::IsLocked()); switcher->preemption_semaphore_->Signal(); } diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index aa6736f40..1b27d37e6 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -4563,7 +4563,7 @@ void ApiTestFuzzer::CallTest() { static v8::Handle ThrowInJS(const v8::Arguments& args) { - v8::Locker::AssertIsLocked(); + CHECK(v8::Locker::IsLocked()); ApiTestFuzzer::Fuzz(); v8::Unlocker unlocker; const char* code = "throw 7;"; @@ -4586,7 +4586,7 @@ static v8::Handle ThrowInJS(const v8::Arguments& args) { static v8::Handle ThrowInJSNoCatch(const v8::Arguments& args) { - v8::Locker::AssertIsLocked(); + CHECK(v8::Locker::IsLocked()); ApiTestFuzzer::Fuzz(); v8::Unlocker unlocker; const char* code = "throw 7;"; @@ -4604,7 +4604,7 @@ static v8::Handle ThrowInJSNoCatch(const v8::Arguments& args) { // as part of the locking aggregation tests. TEST(NestedLockers) { v8::Locker locker; - v8::Locker::AssertIsLocked(); + CHECK(v8::Locker::IsLocked()); v8::HandleScope scope; LocalContext env; Local fun_templ = v8::FunctionTemplate::New(ThrowInJS); @@ -4648,7 +4648,7 @@ THREADED_TEST(RecursiveLocking) { v8::Locker locker; { v8::Locker locker2; - v8::Locker::AssertIsLocked(); + CHECK(v8::Locker::IsLocked()); } }