From: mstarzinger Date: Thu, 2 Jul 2015 09:22:46 +0000 (-0700) Subject: Prepare profiler test for try-catch being optimizable. X-Git-Tag: upstream/4.7.83~1600 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aaf56d601acfd8dcf47c744ce52bf5e765d23bae;p=platform%2Fupstream%2Fv8.git Prepare profiler test for try-catch being optimizable. This is an adaptation of test-profile-generator/BailoutReason to when try-catch statements are optimizable. They will no longer cause any bailout reason to be reported. R=yangguo@chromium.org TEST=cctest/test-profile-generator/BailoutReason Review URL: https://codereview.chromium.org/1213113007 Cr-Commit-Position: refs/heads/master@{#29440} --- diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc index 0a2c7a5..2217614 100644 --- a/test/cctest/test-profile-generator.cc +++ b/test/cctest/test-profile-generator.cc @@ -681,14 +681,13 @@ TEST(BailoutReason) { CHECK_EQ(0, iprofiler->GetProfilesCount()); v8::Handle script = v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), - "function TryCatch() {\n" - " try {\n" - " startProfiling();\n" - " } catch (e) { };\n" + "function Debugger() {\n" + " debugger;\n" + " startProfiling();\n" "}\n" "function TryFinally() {\n" " try {\n" - " TryCatch();\n" + " Debugger();\n" " } finally { };\n" "}\n" "TryFinally();\n" @@ -703,8 +702,8 @@ TEST(BailoutReason) { // The tree should look like this: // (root) // "" - // kTryFinally - // kTryCatch + // kTryFinallyStatement + // kDebuggerStatement current = PickChild(current, ""); CHECK(const_cast(current)); @@ -712,7 +711,7 @@ TEST(BailoutReason) { CHECK(const_cast(current)); CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); - current = PickChild(current, "TryCatch"); + current = PickChild(current, "Debugger"); CHECK(const_cast(current)); - CHECK(!strcmp("TryCatchStatement", current->GetBailoutReason())); + CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason())); }