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

Side by Side Diff: test/cctest/test-log-ia32.cc

Issue 39009: Dump more stack frames to perf log when executing a C++ function. (Closed)
Patch Set: Changes according to Soren's comments Created 11 years, 9 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 | « src/top.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // 2 //
3 // Tests of profiler-related functions from log.h 3 // Tests of profiler-related functions from log.h
4 4
5 #ifdef ENABLE_LOGGING_AND_PROFILING 5 #ifdef ENABLE_LOGGING_AND_PROFILING
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "v8.h" 9 #include "v8.h"
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 static void InitTraceEnv(StackTracer* tracer, TickSample* sample) { 37 static void InitTraceEnv(StackTracer* tracer, TickSample* sample) {
38 trace_env.tracer = tracer; 38 trace_env.tracer = tracer;
39 trace_env.sample = sample; 39 trace_env.sample = sample;
40 } 40 }
41 41
42 42
43 static void DoTrace(unsigned int fp) { 43 static void DoTrace(unsigned int fp) {
44 trace_env.sample->fp = fp; 44 trace_env.sample->fp = fp;
45 // something that is less than fp 45 // something that is less than fp
46 trace_env.sample->sp = trace_env.sample->fp - sizeof(unsigned int); 46 trace_env.sample->sp = trace_env.sample->fp - 100;
47 trace_env.tracer->Trace(trace_env.sample); 47 trace_env.tracer->Trace(trace_env.sample);
48 } 48 }
49 49
50 50
51 static void CFuncDoTrace() { 51 static void CFuncDoTrace() {
52 unsigned int fp; 52 unsigned int fp;
53 #ifdef __GNUC__ 53 #ifdef __GNUC__
54 fp = reinterpret_cast<unsigned int>(__builtin_frame_address(0)); 54 fp = reinterpret_cast<unsigned int>(__builtin_frame_address(0));
55 #elif defined _MSC_VER 55 #elif defined _MSC_VER
56 __asm mov [fp], ebp // NOLINT 56 __asm mov [fp], ebp // NOLINT
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 call_trace_code->instruction_size(), 210 call_trace_code->instruction_size(),
211 original, patch, sizeof(patch))); 211 original, patch, sizeof(patch)));
212 212
213 SetGlobalProperty("JSFuncDoTrace", v8::ToApi<Value>(call_trace)); 213 SetGlobalProperty("JSFuncDoTrace", v8::ToApi<Value>(call_trace));
214 214
215 CompileRun( 215 CompileRun(
216 "function JSTrace() {" 216 "function JSTrace() {"
217 " JSFuncDoTrace();" 217 " JSFuncDoTrace();"
218 "};\n" 218 "};\n"
219 "JSTrace();"); 219 "JSTrace();");
220 CHECK_NE(0, *(sample.stack));
221 CheckRetAddrIsInFunction(
222 reinterpret_cast<unsigned int>(sample.stack[0]),
223 reinterpret_cast<unsigned int>(call_trace_code->instruction_start()),
224 call_trace_code->instruction_size());
220 Handle<JSFunction> js_trace(JSFunction::cast(*(v8::Utils::OpenHandle( 225 Handle<JSFunction> js_trace(JSFunction::cast(*(v8::Utils::OpenHandle(
221 *GetGlobalProperty("JSTrace"))))); 226 *GetGlobalProperty("JSTrace")))));
222 v8::internal::Code* js_trace_code = js_trace->code(); 227 v8::internal::Code* js_trace_code = js_trace->code();
223 CheckRetAddrIsInFunction( 228 CheckRetAddrIsInFunction(
224 reinterpret_cast<unsigned int>(sample.stack[0]), 229 reinterpret_cast<unsigned int>(sample.stack[1]),
225 reinterpret_cast<unsigned int>(js_trace_code->instruction_start()), 230 reinterpret_cast<unsigned int>(js_trace_code->instruction_start()),
226 js_trace_code->instruction_size()); 231 js_trace_code->instruction_size());
227 CHECK_EQ(0, sample.stack[1]);
228 } 232 }
229 233
230 #endif // ENABLE_LOGGING_AND_PROFILING 234 #endif // ENABLE_LOGGING_AND_PROFILING
231
OLDNEW
« no previous file with comments | « src/top.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698