Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: test/cctest/trace-extension.cc

Issue 1631043002: Add CollectSample API function to CpuProfiler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tests. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-cpu-profiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 102
103 103
104 void TraceExtension::DoTrace(Address fp) { 104 void TraceExtension::DoTrace(Address fp) {
105 RegisterState regs; 105 RegisterState regs;
106 regs.fp = fp; 106 regs.fp = fp;
107 // sp is only used to define stack high bound 107 // sp is only used to define stack high bound
108 regs.sp = 108 regs.sp =
109 reinterpret_cast<Address>(trace_env.sample) - 10240; 109 reinterpret_cast<Address>(trace_env.sample) - 10240;
110 trace_env.sample->Init(CcTest::i_isolate(), regs, 110 trace_env.sample->Init(CcTest::i_isolate(), regs,
111 TickSample::kSkipCEntryFrame); 111 TickSample::kSkipCEntryFrame, true);
112 } 112 }
113 113
114 114
115 void TraceExtension::Trace(const v8::FunctionCallbackInfo<v8::Value>& args) { 115 void TraceExtension::Trace(const v8::FunctionCallbackInfo<v8::Value>& args) {
116 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); 116 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate());
117 i::VMState<EXTERNAL> state(isolate); 117 i::VMState<EXTERNAL> state(isolate);
118 Address address = reinterpret_cast<Address>( 118 Address address = reinterpret_cast<Address>(
119 reinterpret_cast<intptr_t>(&TraceExtension::Trace)); 119 reinterpret_cast<intptr_t>(&TraceExtension::Trace));
120 i::ExternalCallbackScope call_scope(isolate, address); 120 i::ExternalCallbackScope call_scope(isolate, address);
121 DoTrace(GetFP(args)); 121 DoTrace(GetFP(args));
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 v8::HandleScope scope(args.GetIsolate()); 161 v8::HandleScope scope(args.GetIsolate());
162 const Address js_entry_sp = GetJsEntrySp(); 162 const Address js_entry_sp = GetJsEntrySp();
163 CHECK(js_entry_sp); 163 CHECK(js_entry_sp);
164 CompileRun("js_entry_sp();"); 164 CompileRun("js_entry_sp();");
165 CHECK_EQ(js_entry_sp, GetJsEntrySp()); 165 CHECK_EQ(js_entry_sp, GetJsEntrySp());
166 } 166 }
167 167
168 168
169 } // namespace internal 169 } // namespace internal
170 } // namespace v8 170 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/test-cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698