Reviewers: yurys, jochen,

Description:
DevTools: Unflake test-cpu-profiler/JsNativeJsRuntimeJsSample

BUG=v8:3308
LOG=N

Please review this at https://codereview.chromium.org/271683002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+11, -6 lines):
  M src/profile-generator.cc
  M test/cctest/cctest.status
  M test/cctest/test-cpu-profiler.cc


Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index 957f5dbae0660c5e9a1c3f09b6c97a7855400416..e1e5236eb98f72c272073992cf7b9cd79a2b185e 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -208,9 +208,9 @@ ProfileNode* ProfileNode::FindOrAddChild(CodeEntry* entry) {


 void ProfileNode::Print(int indent) {
-  OS::Print("%5u %*c %s%s %d #%d %s",
+  OS::Print("%5u %*s %s%s %d #%d %s",
             self_ticks_,
-            indent, ' ',
+            indent, "",
             entry_->name_prefix(),
             entry_->name(),
             entry_->script_id(),
Index: test/cctest/cctest.status
diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status
index 98b7294f9b777bfb62718f4347b7ec29d93995db..5fa31564f12cc31fbc3f9c6907e5ebc2222d8df4 100644
--- a/test/cctest/cctest.status
+++ b/test/cctest/cctest.status
@@ -76,8 +76,6 @@
   'test-cpu-profiler/CollectCpuProfile': [PASS, FLAKY],
   # BUG(3287).
   'test-cpu-profiler/SampleWhenFrameIsNotSetup': [PASS, FLAKY],
-  # BUG(3308).
-  'test-cpu-profiler/JsNativeJsRuntimeJsSample': [PASS, FLAKY],

############################################################################
   # Slow tests.
Index: test/cctest/test-cpu-profiler.cc
diff --git a/test/cctest/test-cpu-profiler.cc b/test/cctest/test-cpu-profiler.cc index 6cff7424b7bf7bb8fcd79e4400da66baec0861c7..52e0fd652122e2b4137e06101f97367f28846f85 100644
--- a/test/cctest/test-cpu-profiler.cc
+++ b/test/cctest/test-cpu-profiler.cc
@@ -1158,9 +1158,12 @@ TEST(FunctionApplySample) {
     const v8::CpuProfileNode* testNode =
         FindChild(env->GetIsolate(), startNode, "test");
     if (testNode) {
-      ScopedVector<v8::Handle<v8::String> > names(2);
+      ScopedVector<v8::Handle<v8::String> > names(3);
       names[0] = v8::String::NewFromUtf8(env->GetIsolate(), "bar");
       names[1] = v8::String::NewFromUtf8(env->GetIsolate(), "apply");
+      // apply calls "get length" before invoking the function itself
+      // and we may get hit into it.
+      names[2] = v8::String::NewFromUtf8(env->GetIsolate(), "get length");
       CheckChildrenNames(testNode, names);
     }

@@ -1343,7 +1346,11 @@ TEST(JsNativeJsRuntimeJsSample) {
   const v8::CpuProfileNode* barNode =
       GetChild(env->GetIsolate(), nativeFunctionNode, "bar");

-  CHECK_EQ(1, barNode->GetChildrenCount());
+  // The child is in fact a bound foo.
+  // A bound function has a wrapper that may make calls to
+  // other functions e.g. "get length".
+  CHECK_LE(1, barNode->GetChildrenCount());
+  CHECK_GE(2, barNode->GetChildrenCount());
   GetChild(env->GetIsolate(), barNode, "foo");

   profile->Delete();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to