Fix threading problems in test-api when running on simulator
Sampler can retrieve current simulator for profiled isolate from its ThreadLocalTop without calls to Isolate::FindPerThreadDataForThread which sometimes leads to acquring same mutex second time. BUG=v8:2874 R=bmeurer@chromium.org Review URL: https://codereview.chromium.org/25053002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17047 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
54b3745503
commit
b3c440f8da
@ -120,11 +120,7 @@ void ThreadLocalTop::InitializeInternal() {
|
|||||||
void ThreadLocalTop::Initialize() {
|
void ThreadLocalTop::Initialize() {
|
||||||
InitializeInternal();
|
InitializeInternal();
|
||||||
#ifdef USE_SIMULATOR
|
#ifdef USE_SIMULATOR
|
||||||
#if V8_TARGET_ARCH_ARM
|
|
||||||
simulator_ = Simulator::current(isolate_);
|
simulator_ = Simulator::current(isolate_);
|
||||||
#elif V8_TARGET_ARCH_MIPS
|
|
||||||
simulator_ = Simulator::current(isolate_);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
thread_id_ = ThreadId::Current();
|
thread_id_ = ThreadId::Current();
|
||||||
}
|
}
|
||||||
@ -1670,11 +1666,7 @@ char* Isolate::RestoreThread(char* from) {
|
|||||||
// This might be just paranoia, but it seems to be needed in case a
|
// This might be just paranoia, but it seems to be needed in case a
|
||||||
// thread_local_top_ is restored on a separate OS thread.
|
// thread_local_top_ is restored on a separate OS thread.
|
||||||
#ifdef USE_SIMULATOR
|
#ifdef USE_SIMULATOR
|
||||||
#if V8_TARGET_ARCH_ARM
|
|
||||||
thread_local_top()->simulator_ = Simulator::current(this);
|
thread_local_top()->simulator_ = Simulator::current(this);
|
||||||
#elif V8_TARGET_ARCH_MIPS
|
|
||||||
thread_local_top()->simulator_ = Simulator::current(this);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
ASSERT(context() == NULL || context()->IsContext());
|
ASSERT(context() == NULL || context()->IsContext());
|
||||||
return from + sizeof(ThreadLocalTop);
|
return from + sizeof(ThreadLocalTop);
|
||||||
|
@ -273,10 +273,8 @@ class ThreadLocalTop BASE_EMBEDDED {
|
|||||||
Address handler_; // try-blocks are chained through the stack
|
Address handler_; // try-blocks are chained through the stack
|
||||||
|
|
||||||
#ifdef USE_SIMULATOR
|
#ifdef USE_SIMULATOR
|
||||||
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS
|
|
||||||
Simulator* simulator_;
|
Simulator* simulator_;
|
||||||
#endif
|
#endif
|
||||||
#endif // USE_SIMULATOR
|
|
||||||
|
|
||||||
Address js_entry_sp_; // the stack pointer of the bottom JS entry frame
|
Address js_entry_sp_; // the stack pointer of the bottom JS entry frame
|
||||||
// the external callback we're currently in
|
// the external callback we're currently in
|
||||||
|
@ -216,11 +216,7 @@ class Sampler::PlatformData : public PlatformDataCommon {
|
|||||||
class SimulatorHelper {
|
class SimulatorHelper {
|
||||||
public:
|
public:
|
||||||
inline bool Init(Sampler* sampler, Isolate* isolate) {
|
inline bool Init(Sampler* sampler, Isolate* isolate) {
|
||||||
ThreadId thread_id = sampler->platform_data()->profiled_thread_id();
|
simulator_ = isolate->thread_local_top()->simulator_;
|
||||||
Isolate::PerIsolateThreadData* per_thread_data = isolate->
|
|
||||||
FindPerThreadDataForThread(thread_id);
|
|
||||||
if (!per_thread_data) return false;
|
|
||||||
simulator_ = per_thread_data->simulator();
|
|
||||||
// Check if there is active simulator.
|
// Check if there is active simulator.
|
||||||
return simulator_ != NULL;
|
return simulator_ != NULL;
|
||||||
}
|
}
|
||||||
|
@ -82,9 +82,6 @@
|
|||||||
'test-serialize/DeserializeFromSecondSerializationAndRunScript2': [SKIP],
|
'test-serialize/DeserializeFromSecondSerializationAndRunScript2': [SKIP],
|
||||||
'test-serialize/DeserializeAndRunScript2': [SKIP],
|
'test-serialize/DeserializeAndRunScript2': [SKIP],
|
||||||
'test-serialize/DeserializeFromSecondSerialization': [SKIP],
|
'test-serialize/DeserializeFromSecondSerialization': [SKIP],
|
||||||
|
|
||||||
# BUG(2874): Threading problems.
|
|
||||||
'test-api/*': [PASS, FLAKY],
|
|
||||||
}], # 'arch == arm'
|
}], # 'arch == arm'
|
||||||
##############################################################################
|
##############################################################################
|
||||||
['arch == mipsel', {
|
['arch == mipsel', {
|
||||||
|
@ -77,19 +77,12 @@ using ::v8::V8;
|
|||||||
using ::v8::Value;
|
using ::v8::Value;
|
||||||
|
|
||||||
|
|
||||||
// TODO(bmeurer): Don't run profiled tests when using the simulator.
|
|
||||||
// This is a temporary work-around, until the profiler is fixed.
|
|
||||||
#if USE_SIMULATOR
|
|
||||||
#define THREADED_PROFILED_TEST(Name) \
|
|
||||||
THREADED_TEST(Name)
|
|
||||||
#else
|
|
||||||
#define THREADED_PROFILED_TEST(Name) \
|
#define THREADED_PROFILED_TEST(Name) \
|
||||||
static void Test##Name(); \
|
static void Test##Name(); \
|
||||||
TEST(Name##WithProfiler) { \
|
TEST(Name##WithProfiler) { \
|
||||||
RunWithProfiler(&Test##Name); \
|
RunWithProfiler(&Test##Name); \
|
||||||
} \
|
} \
|
||||||
THREADED_TEST(Name)
|
THREADED_TEST(Name)
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void RunWithProfiler(void (*test)()) {
|
void RunWithProfiler(void (*test)()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user