From 5344161ee6d17fc93b1d426377421be2bde0ff54 Mon Sep 17 00:00:00 2001 From: "danno@chromium.org" Date: Mon, 3 Jun 2013 15:25:28 +0000 Subject: [PATCH] Revert 14916: Mark test-cpu-profiler/SampleWhenFrameIsNotSetup as flaky on MIPS simulator Revert 14915: CPU profiler should support names of accessors set via v8::Object::SetAccessor Due to Windows failures R=rossberg@chromium.org Review URL: https://codereview.chromium.org/16335005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects.cc | 4 -- test/cctest/cctest.status | 6 -- test/cctest/test-cpu-profiler.cc | 147 --------------------------------------- 3 files changed, 157 deletions(-) diff --git a/src/objects.cc b/src/objects.cc index f914e15..c94a697 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -344,8 +344,6 @@ MaybeObject* JSObject::GetPropertyWithCallback(Object* receiver, { // Leaving JavaScript. VMState state(isolate); - ExternalCallbackScope call_scope(isolate, - v8::ToCData
(fun_obj)); result = args.Call(call_fun, v8::Utils::ToLocal(key)); } RETURN_IF_SCHEDULED_EXCEPTION(isolate); @@ -2791,8 +2789,6 @@ MaybeObject* JSObject::SetPropertyWithCallback(Object* structure, { // Leaving JavaScript. VMState state(isolate); - ExternalCallbackScope call_scope(isolate, - v8::ToCData
(call_obj)); args.Call(call_fun, v8::Utils::ToLocal(key), v8::Utils::ToLocal(value_handle)); diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index 595293b..84a1a70 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -70,12 +70,6 @@ test-serialize/DeserializeAndRunScript2: SKIP test-serialize/DeserializeFromSecondSerialization: SKIP ############################################################################## -[ $arch == mipsel ] - -# BUG(2628): The test sometimes fails on MIPS simulator. -test-cpu-profiler/SampleWhenFrameIsNotSetup: PASS || FAIL - -############################################################################## [ $arch == android_arm || $arch == android_ia32 ] # Tests crash as there is no /tmp directory in Android. diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc index b423174..2234e11 100644 --- a/test/cctest/test-cpu-profiler.cc +++ b/test/cctest/test-cpu-profiler.cc @@ -638,150 +638,3 @@ TEST(SampleWhenFrameIsNotSetup) { cpu_profiler->DeleteAllCpuProfiles(); } - - -static const char* native_accessor_test_source = "function start(count) {\n" -" for (var i = 0; i < count; i++) {\n" -" var o = instance.foo;\n" -" instance.foo = o + 1;\n" -" }\n" -"}\n"; - - -class FooAccessorsData { - public: - explicit FooAccessorsData(int min_duration_us) - : min_duration_us_(min_duration_us) {} - - static v8::Handle Getter(v8::Local name, - const v8::AccessorInfo& info) { - FooAccessorsData* data = fromInfo(info); - data->Wait(); - return v8::Int32::New(2013); - } - - static void Setter(v8::Local name, - v8::Local value, - const v8::AccessorInfo& info) { - FooAccessorsData* data = fromInfo(info); - data->Wait(); - } - - private: - void Wait() { - int64_t start = i::OS::Ticks(); - for (int64_t duration = 0; duration < min_duration_us_; ) { - duration = i::OS::Ticks() - start; - } - } - - static FooAccessorsData* fromInfo(const v8::AccessorInfo& info) { - void* data = v8::External::Cast(*info.Data())->Value(); - return reinterpret_cast(data); - } - - int min_duration_us_; -}; - - -// Test that native accessors are properly reported in the CPU profile. -// This test checks the case when the long-running accessors are called -// only once and the optimizer doesn't have chance to change the invocation -// code. -TEST(NativeAccessorNameInProfile1) { - LocalContext env; - v8::HandleScope scope(env->GetIsolate()); - - - v8::Local func_template = v8::FunctionTemplate::New(); - v8::Local instance_template = - func_template->InstanceTemplate(); - - FooAccessorsData accessors(100 * 1000); - v8::Local data = v8::External::New(&accessors); - instance_template->SetAccessor( - v8::String::New("foo"), &FooAccessorsData::Getter, - &FooAccessorsData::Setter, data); - v8::Local func = func_template->GetFunction(); - v8::Local instance = func->NewInstance(); - env->Global()->Set(v8::String::New("instance"), instance); - - v8::Script::Compile(v8::String::New(native_accessor_test_source))->Run(); - v8::Local function = v8::Local::Cast( - env->Global()->Get(v8::String::New("start"))); - - v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); - v8::Local profile_name = v8::String::New("my_profile"); - - cpu_profiler->StartCpuProfiling(profile_name); - int32_t repeat_count = 1; - v8::Handle args[] = { v8::Integer::New(repeat_count) }; - function->Call(env->Global(), ARRAY_SIZE(args), args); - const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name); - - CHECK_NE(NULL, profile); - // Dump collected profile to have a better diagnostic in case of failure. - reinterpret_cast( - const_cast(profile))->Print(); - - const v8::CpuProfileNode* root = profile->GetTopDownRoot(); - const v8::CpuProfileNode* startNode = GetChild(root, "start"); - GetChild(startNode, "get foo"); - GetChild(startNode, "set foo"); - - cpu_profiler->DeleteAllCpuProfiles(); -} - - -// Test that native accessors are properly reported in the CPU profile. -// This test makes sure that the accessors are called enough times to become -// hot and to trigger optimizations. -TEST(NativeAccessorNameInProfile2) { - LocalContext env; - v8::HandleScope scope(env->GetIsolate()); - - - v8::Local func_template = v8::FunctionTemplate::New(); - v8::Local instance_template = - func_template->InstanceTemplate(); - - FooAccessorsData accessors(10); - v8::Local data = v8::External::New(&accessors); - instance_template->SetAccessor( - v8::String::New("foo"), &FooAccessorsData::Getter, - &FooAccessorsData::Setter, data); - v8::Local func = func_template->GetFunction(); - v8::Local instance = func->NewInstance(); - env->Global()->Set(v8::String::New("instance"), instance); - - v8::Script::Compile(v8::String::New(native_accessor_test_source))->Run(); - v8::Local function = v8::Local::Cast( - env->Global()->Get(v8::String::New("start"))); - - v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); - v8::Local profile_name = v8::String::New("my_profile"); - - cpu_profiler->StartCpuProfiling(profile_name); - int32_t repeat_count = 10 * 1000; -#if defined(USE_SIMULATOR) - // Simulators are much slower. - repeat_count = 100; -#endif - v8::Handle args[] = { v8::Integer::New(repeat_count) }; - function->Call(env->Global(), ARRAY_SIZE(args), args); - const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name); - - CHECK_NE(NULL, profile); - // Dump collected profile to have a better diagnostic in case of failure. - reinterpret_cast( - const_cast(profile))->Print(); - - const v8::CpuProfileNode* root = profile->GetTopDownRoot(); - const v8::CpuProfileNode* startNode = GetChild(root, "start"); - // TODO(yurys): in LoadIC should be changed to report external callback - // invocation. See r13768 where it was LoadCallbackProperty was removed. - // GetChild(startNode, "get foo"); - GetChild(startNode, "set foo"); - - cpu_profiler->DeleteAllCpuProfiles(); -} -- 2.7.4