Reviewers: Yury Semikhatsky,
Message:
Committed patchset #1 manually as r15431 (presubmit successful).
Description:
Revert "CPUProfiler: propagate scriptId to the front-end"
This reverts commit d575f6bc8b262dac08f02913ae6e7c504c9dd900.
Check is failing on debug bots.
TBR= [email protected]
Committed: https://code.google.com/p/v8/source/detail?r=15431
Please review this at https://chromiumcodereview.appspot.com/18332010/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M include/v8-profiler.h
M src/api.cc
M src/cpu-profiler.cc
M src/profile-generator-inl.h
M src/profile-generator.h
M src/profile-generator.cc
M test/cctest/test-profile-generator.cc
Index: include/v8-profiler.h
diff --git a/include/v8-profiler.h b/include/v8-profiler.h
index
8e6251aca50c2be9ce979d301dcd89d3829887f5..5338fcd59c2c7711ef475e9949b22411c6374b6c
100644
--- a/include/v8-profiler.h
+++ b/include/v8-profiler.h
@@ -75,9 +75,6 @@ class V8EXPORT CpuProfileNode {
/** Returns function name (empty string for anonymous functions.) */
Handle<String> GetFunctionName() const;
- /** Returns id of the script where function is located. */
- int GetScriptId() const;
-
/** Returns resource name for script from where the function originates.
*/
Handle<String> GetScriptResourceName() const;
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
ee8057920165ae7925129722abc3c1e845deaff9..4a24f4bc88313638e9d3c3b4174cc39363b78001
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -7326,15 +7326,6 @@ Handle<String> CpuProfileNode::GetFunctionName()
const {
}
-int CpuProfileNode::GetScriptId() const {
- i::Isolate* isolate = i::Isolate::Current();
- IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptId");
- const i::ProfileNode* node = reinterpret_cast<const
i::ProfileNode*>(this);
- const i::CodeEntry* entry = node->entry();
- return entry->script_id();
-}
-
-
Handle<String> CpuProfileNode::GetScriptResourceName() const {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptResourceName");
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index
55d81213e09b232037117b951fca80b31238ed47..270da8fc9774ec88484d4ec1c19260baaef9985b
100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -255,12 +255,9 @@ void
CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
CodeCreateEventRecord* rec = &evt_rec.CodeCreateEventRecord_;
rec->start = code->address();
rec->entry = profiles_->NewCodeEntry(tag,
profiles_->GetFunctionName(name));
- if (info) {
- rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
- }
- ASSERT(Script::cast(shared->script()));
- Script* script = Script::cast(shared->script());
- rec->entry->set_script_id(script->id()->value());
+ rec->entry->set_no_frame_ranges(info ?
+ info->ReleaseNoFrameRanges() :
+ NULL);
rec->size = code->ExecutableSize();
rec->shared = shared->address();
processor_->Enqueue(evt_rec);
@@ -283,12 +280,9 @@ void
CpuProfiler::CodeCreateEvent(Logger::LogEventsAndTags tag,
CodeEntry::kEmptyNamePrefix,
profiles_->GetName(source),
line);
- if (info) {
- rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
- }
- ASSERT(Script::cast(shared->script()));
- Script* script = Script::cast(shared->script());
- rec->entry->set_script_id(script->id()->value());
+ rec->entry->set_no_frame_ranges(info ?
+ info->ReleaseNoFrameRanges() :
+ NULL);
rec->size = code->ExecutableSize();
rec->shared = shared->address();
processor_->Enqueue(evt_rec);
Index: src/profile-generator-inl.h
diff --git a/src/profile-generator-inl.h b/src/profile-generator-inl.h
index
20c1aec731b6a7f644bdd658173dafa746122a26..115e8139d8d05ca5bb62b87738269a142b290f21
100644
--- a/src/profile-generator-inl.h
+++ b/src/profile-generator-inl.h
@@ -56,7 +56,6 @@ CodeEntry::CodeEntry(Logger::LogEventsAndTags tag,
resource_name_(resource_name),
line_number_(line_number),
shared_id_(0),
- script_id_(v8::Script::kNoScriptId),
security_token_id_(security_token_id),
no_frame_ranges_(NULL) {
}
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index
aeb80a3bc625f6b42db8e35797163572c855a274..13544871aa82815c70beac30484bcd711805b42a
100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -273,13 +273,12 @@ double ProfileNode::GetTotalMillis() const {
void ProfileNode::Print(int indent) {
- OS::Print("%5u %5u %*c %s%s [%d] #%d %d",
+ OS::Print("%5u %5u %*c %s%s [%d] #%d",
total_ticks_, self_ticks_,
indent, ' ',
entry_->name_prefix(),
entry_->name(),
entry_->security_token_id(),
- entry_->script_id(),
id());
if (entry_->resource_name()[0] != '\0')
OS::Print(" %s:%d", entry_->resource_name(), entry_->line_number());
Index: src/profile-generator.h
diff --git a/src/profile-generator.h b/src/profile-generator.h
index
411cbdbab270c700f528a7a9ecd6077b995a0210..2783a08806e1b00fe73db35e2dcc761225429c8b
100644
--- a/src/profile-generator.h
+++ b/src/profile-generator.h
@@ -111,8 +111,6 @@ class CodeEntry {
INLINE(const char* resource_name() const) { return resource_name_; }
INLINE(int line_number() const) { return line_number_; }
INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; }
- INLINE(int script_id() const) { return script_id_; }
- INLINE(void set_script_id(int script_id)) { script_id_ = script_id; }
INLINE(int security_token_id() const) { return security_token_id_; }
INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag));
@@ -140,7 +138,6 @@ class CodeEntry {
const char* resource_name_;
int line_number_;
int shared_id_;
- int script_id_;
int security_token_id_;
List<OffsetRange>* no_frame_ranges_;
Index: test/cctest/test-profile-generator.cc
diff --git a/test/cctest/test-profile-generator.cc
b/test/cctest/test-profile-generator.cc
index
dfcc75ce13ff1f117f88d85ad94001e71f6aab62..e9197896734da11548615e2424bafff2608e494f
100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -905,62 +905,3 @@ TEST(Issue51919) {
for (int i = 0; i < CpuProfilesCollection::kMaxSimultaneousProfiles; ++i)
i::DeleteArray(titles[i]);
}
-
-
-static const v8::CpuProfileNode* PickChild(const v8::CpuProfileNode*
parent,
- const char* name) {
- for (int i = 0; i < parent->GetChildrenCount(); ++i) {
- const v8::CpuProfileNode* child = parent->GetChild(i);
- v8::String::AsciiValue function_name(child->GetFunctionName());
- if (strcmp(*function_name, name) == 0) return child;
- }
- return NULL;
-}
-
-
-TEST(ProfileNodeScriptId) {
- // This test does not pass with inlining enabled since inlined functions
- // don't appear in the stack trace.
- i::FLAG_use_inlining = false;
-
- const char* extensions[] = { "v8/profiler" };
- v8::ExtensionConfiguration config(1, extensions);
- LocalContext env(&config);
- v8::HandleScope hs(env->GetIsolate());
-
- v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler();
- CHECK_EQ(0, profiler->GetProfileCount());
- v8::Handle<v8::Script> script_a = v8::Script::Compile(v8::String::New(
- "function a() { startProfiling(); }\n"));
- script_a->Run();
- v8::Handle<v8::Script> script_b = v8::Script::Compile(v8::String::New(
- "function b() { a(); }\n"
- "b();\n"
- "stopProfiling();\n"));
- script_b->Run();
- CHECK_EQ(1, profiler->GetProfileCount());
- const v8::CpuProfile* profile = profiler->GetCpuProfile(0);
- const v8::CpuProfileNode* current = profile->GetTopDownRoot();
- reinterpret_cast<ProfileNode*>(
- const_cast<v8::CpuProfileNode*>(current))->Print(0);
- // The tree should look like this:
- // (root)
- // (anonymous function)
- // b
- // a
- // There can also be:
- // startProfiling
- // if the sampler managed to get a tick.
- current = PickChild(current,
i::ProfileGenerator::kAnonymousFunctionName);
- CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current));
-
- current = PickChild(current, "b");
- CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current));
- CHECK_EQ(script_b->GetId(), current->GetScriptId());
-
- current = PickChild(current, "a");
- CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current));
- CHECK_EQ(script_a->GetId(), current->GetScriptId());
-}
-
-
--
--
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/groups/opt_out.