Commit cd3bf78b authored by kasperl@chromium.org's avatar kasperl@chromium.org

Fix broken build. Sorry about that.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6d13d986
...@@ -2123,11 +2123,11 @@ class EXPORT Locker { ...@@ -2123,11 +2123,11 @@ class EXPORT Locker {
*/ */
static void StopPreemption(); static void StopPreemption();
#ifdef DEBUG /**
static void AssertIsLocked(); * Returns whether or not the locker is locked by the current thread.
#else */
static inline void AssertIsLocked() { } static bool IsLocked();
#endif
private: private:
bool has_lock_; bool has_lock_;
bool top_level_; bool top_level_;
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef V8_DEBUG_H_ #ifndef V8_V8_DEBUG_H_
#define V8_DEBUG_H_ #define V8_V8_DEBUG_H_
#include "../include/v8-debug.h" #include "../include/v8-debug.h"
#include "assembler.h" #include "assembler.h"
...@@ -574,4 +574,4 @@ class Debug_Address { ...@@ -574,4 +574,4 @@ class Debug_Address {
} } // namespace v8::internal } } // namespace v8::internal
#endif // V8_DEBUG_H_ #endif // V8_V8_DEBUG_H_
...@@ -54,11 +54,9 @@ Locker::Locker() : has_lock_(false), top_level_(true) { ...@@ -54,11 +54,9 @@ Locker::Locker() : has_lock_(false), top_level_(true) {
} }
#ifdef DEBUG bool Locker::IsLocked() {
void Locker::AssertIsLocked() { return internal::ThreadManager::IsLockedByCurrentThread();
ASSERT(internal::ThreadManager::IsLockedByCurrentThread());
} }
#endif
Locker::~Locker() { Locker::~Locker() {
...@@ -282,7 +280,7 @@ static v8::internal::ContextSwitcher* switcher; ...@@ -282,7 +280,7 @@ static v8::internal::ContextSwitcher* switcher;
void ContextSwitcher::StartPreemption(int every_n_ms) { void ContextSwitcher::StartPreemption(int every_n_ms) {
Locker::AssertIsLocked(); ASSERT(Locker::IsLocked());
if (switcher == NULL) { if (switcher == NULL) {
switcher = new ContextSwitcher(every_n_ms); switcher = new ContextSwitcher(every_n_ms);
switcher->Start(); switcher->Start();
...@@ -293,7 +291,7 @@ void ContextSwitcher::StartPreemption(int every_n_ms) { ...@@ -293,7 +291,7 @@ void ContextSwitcher::StartPreemption(int every_n_ms) {
void ContextSwitcher::StopPreemption() { void ContextSwitcher::StopPreemption() {
Locker::AssertIsLocked(); ASSERT(Locker::IsLocked());
if (switcher != NULL) { if (switcher != NULL) {
switcher->Stop(); switcher->Stop();
delete(switcher); delete(switcher);
...@@ -312,7 +310,7 @@ void ContextSwitcher::Run() { ...@@ -312,7 +310,7 @@ void ContextSwitcher::Run() {
void ContextSwitcher::Stop() { void ContextSwitcher::Stop() {
Locker::AssertIsLocked(); ASSERT(Locker::IsLocked());
keep_going_ = false; keep_going_ = false;
preemption_semaphore_->Signal(); preemption_semaphore_->Signal();
Join(); Join();
...@@ -325,7 +323,7 @@ void ContextSwitcher::WaitForPreemption() { ...@@ -325,7 +323,7 @@ void ContextSwitcher::WaitForPreemption() {
void ContextSwitcher::PreemptionReceived() { void ContextSwitcher::PreemptionReceived() {
Locker::AssertIsLocked(); ASSERT(Locker::IsLocked());
switcher->preemption_semaphore_->Signal(); switcher->preemption_semaphore_->Signal();
} }
......
...@@ -4563,7 +4563,7 @@ void ApiTestFuzzer::CallTest() { ...@@ -4563,7 +4563,7 @@ void ApiTestFuzzer::CallTest() {
static v8::Handle<Value> ThrowInJS(const v8::Arguments& args) { static v8::Handle<Value> ThrowInJS(const v8::Arguments& args) {
v8::Locker::AssertIsLocked(); CHECK(v8::Locker::IsLocked());
ApiTestFuzzer::Fuzz(); ApiTestFuzzer::Fuzz();
v8::Unlocker unlocker; v8::Unlocker unlocker;
const char* code = "throw 7;"; const char* code = "throw 7;";
...@@ -4586,7 +4586,7 @@ static v8::Handle<Value> ThrowInJS(const v8::Arguments& args) { ...@@ -4586,7 +4586,7 @@ static v8::Handle<Value> ThrowInJS(const v8::Arguments& args) {
static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) { static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) {
v8::Locker::AssertIsLocked(); CHECK(v8::Locker::IsLocked());
ApiTestFuzzer::Fuzz(); ApiTestFuzzer::Fuzz();
v8::Unlocker unlocker; v8::Unlocker unlocker;
const char* code = "throw 7;"; const char* code = "throw 7;";
...@@ -4604,7 +4604,7 @@ static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) { ...@@ -4604,7 +4604,7 @@ static v8::Handle<Value> ThrowInJSNoCatch(const v8::Arguments& args) {
// as part of the locking aggregation tests. // as part of the locking aggregation tests.
TEST(NestedLockers) { TEST(NestedLockers) {
v8::Locker locker; v8::Locker locker;
v8::Locker::AssertIsLocked(); CHECK(v8::Locker::IsLocked());
v8::HandleScope scope; v8::HandleScope scope;
LocalContext env; LocalContext env;
Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(ThrowInJS); Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(ThrowInJS);
...@@ -4648,7 +4648,7 @@ THREADED_TEST(RecursiveLocking) { ...@@ -4648,7 +4648,7 @@ THREADED_TEST(RecursiveLocking) {
v8::Locker locker; v8::Locker locker;
{ {
v8::Locker locker2; v8::Locker locker2;
v8::Locker::AssertIsLocked(); CHECK(v8::Locker::IsLocked());
} }
} }
......
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