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

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

Issue 2189513002: Move SimulatorHelper into V8 out of profiler clients. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 trace_env.sample = sample; 96 trace_env.sample = sample;
97 } 97 }
98 98
99 99
100 void TraceExtension::DoTrace(Address fp) { 100 void TraceExtension::DoTrace(Address fp) {
101 RegisterState regs; 101 RegisterState regs;
102 regs.fp = fp; 102 regs.fp = fp;
103 // sp is only used to define stack high bound 103 // sp is only used to define stack high bound
104 regs.sp = 104 regs.sp =
105 reinterpret_cast<Address>(trace_env.sample) - 10240; 105 reinterpret_cast<Address>(trace_env.sample) - 10240;
106 trace_env.sample->Init(CcTest::isolate(), regs, 106 RegisterState updated_regs;
107 trace_env.sample->Init(CcTest::isolate(), regs, updated_regs,
107 v8::TickSample::kSkipCEntryFrame, true); 108 v8::TickSample::kSkipCEntryFrame, true);
108 } 109 }
109 110
110 111
111 void TraceExtension::Trace(const v8::FunctionCallbackInfo<v8::Value>& args) { 112 void TraceExtension::Trace(const v8::FunctionCallbackInfo<v8::Value>& args) {
112 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); 113 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate());
113 i::VMState<EXTERNAL> state(isolate); 114 i::VMState<EXTERNAL> state(isolate);
114 Address address = reinterpret_cast<Address>( 115 Address address = reinterpret_cast<Address>(
115 reinterpret_cast<intptr_t>(&TraceExtension::Trace)); 116 reinterpret_cast<intptr_t>(&TraceExtension::Trace));
116 i::ExternalCallbackScope call_scope(isolate, address); 117 i::ExternalCallbackScope call_scope(isolate, address);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 v8::HandleScope scope(args.GetIsolate()); 158 v8::HandleScope scope(args.GetIsolate());
158 const Address js_entry_sp = GetJsEntrySp(); 159 const Address js_entry_sp = GetJsEntrySp();
159 CHECK(js_entry_sp); 160 CHECK(js_entry_sp);
160 CompileRun("js_entry_sp();"); 161 CompileRun("js_entry_sp();");
161 CHECK_EQ(js_entry_sp, GetJsEntrySp()); 162 CHECK_EQ(js_entry_sp, GetJsEntrySp());
162 } 163 }
163 164
164 165
165 } // namespace internal 166 } // namespace internal
166 } // namespace v8 167 } // namespace v8
OLDNEW
« include/v8-profiler.h ('K') | « test/cctest/libsampler/test-sampler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698