| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1664 profile->Delete(); | 1664 profile->Delete(); |
| 1665 cpu_profiler->Dispose(); | 1665 cpu_profiler->Dispose(); |
| 1666 } | 1666 } |
| 1667 | 1667 |
| 1668 static void CheckFunctionDetails(v8::Isolate* isolate, | 1668 static void CheckFunctionDetails(v8::Isolate* isolate, |
| 1669 const v8::CpuProfileNode* node, | 1669 const v8::CpuProfileNode* node, |
| 1670 const char* name, const char* script_name, | 1670 const char* name, const char* script_name, |
| 1671 int script_id, int line, int column) { | 1671 int script_id, int line, int column) { |
| 1672 v8::Local<v8::Context> context = isolate->GetCurrentContext(); | 1672 v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
| 1673 CHECK(v8_str(name)->Equals(context, node->GetFunctionName()).FromJust()); | 1673 CHECK(v8_str(name)->Equals(context, node->GetFunctionName()).FromJust()); |
| 1674 CHECK_EQ(0, strcmp(name, node->GetFunctionNameStr())); |
| 1674 CHECK(v8_str(script_name) | 1675 CHECK(v8_str(script_name) |
| 1675 ->Equals(context, node->GetScriptResourceName()) | 1676 ->Equals(context, node->GetScriptResourceName()) |
| 1676 .FromJust()); | 1677 .FromJust()); |
| 1678 CHECK_EQ(0, strcmp(script_name, node->GetScriptResourceNameStr())); |
| 1677 CHECK_EQ(script_id, node->GetScriptId()); | 1679 CHECK_EQ(script_id, node->GetScriptId()); |
| 1678 CHECK_EQ(line, node->GetLineNumber()); | 1680 CHECK_EQ(line, node->GetLineNumber()); |
| 1679 CHECK_EQ(column, node->GetColumnNumber()); | 1681 CHECK_EQ(column, node->GetColumnNumber()); |
| 1680 } | 1682 } |
| 1681 | 1683 |
| 1682 | 1684 |
| 1683 TEST(FunctionDetails) { | 1685 TEST(FunctionDetails) { |
| 1684 i::FLAG_allow_natives_syntax = true; | 1686 i::FLAG_allow_natives_syntax = true; |
| 1685 v8::HandleScope scope(CcTest::isolate()); | 1687 v8::HandleScope scope(CcTest::isolate()); |
| 1686 v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION); | 1688 v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2083 iprofile->Print(); | 2085 iprofile->Print(); |
| 2084 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); | 2086 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); |
| 2085 | 2087 |
| 2086 const char* branch[] = {"", "test"}; | 2088 const char* branch[] = {"", "test"}; |
| 2087 const ProfileNode* itest_node = | 2089 const ProfileNode* itest_node = |
| 2088 GetSimpleBranch(env, profile, branch, arraysize(branch)); | 2090 GetSimpleBranch(env, profile, branch, arraysize(branch)); |
| 2089 CHECK_EQ(0U, itest_node->deopt_infos().size()); | 2091 CHECK_EQ(0U, itest_node->deopt_infos().size()); |
| 2090 | 2092 |
| 2091 iprofiler->DeleteProfile(iprofile); | 2093 iprofiler->DeleteProfile(iprofile); |
| 2092 } | 2094 } |
| OLD | NEW |