| OLD | NEW |
| 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 29 matching lines...) Expand all Loading... |
| 40 TickSample* sample; | 40 TickSample* sample; |
| 41 } trace_env = { NULL }; | 41 } trace_env = { NULL }; |
| 42 | 42 |
| 43 | 43 |
| 44 static void InitTraceEnv(TickSample* sample) { | 44 static void InitTraceEnv(TickSample* sample) { |
| 45 trace_env.sample = sample; | 45 trace_env.sample = sample; |
| 46 } | 46 } |
| 47 | 47 |
| 48 | 48 |
| 49 static void DoTrace(Address fp) { | 49 static void DoTrace(Address fp) { |
| 50 trace_env.sample->fp = reinterpret_cast<uintptr_t>(fp); | 50 trace_env.sample->fp = fp; |
| 51 // sp is only used to define stack high bound | 51 // sp is only used to define stack high bound |
| 52 trace_env.sample->sp = | 52 trace_env.sample->sp = |
| 53 reinterpret_cast<uintptr_t>(trace_env.sample) - 10240; | 53 reinterpret_cast<Address>(trace_env.sample) - 10240; |
| 54 StackTracer::Trace(trace_env.sample); | 54 StackTracer::Trace(trace_env.sample); |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 // Hide c_entry_fp to emulate situation when sampling is done while | 58 // Hide c_entry_fp to emulate situation when sampling is done while |
| 59 // pure JS code is being executed | 59 // pure JS code is being executed |
| 60 static void DoTraceHideCEntryFPAddress(Address fp) { | 60 static void DoTraceHideCEntryFPAddress(Address fp) { |
| 61 v8::internal::Address saved_c_frame_fp = *(Top::c_entry_fp_address()); | 61 v8::internal::Address saved_c_frame_fp = *(Top::c_entry_fp_address()); |
| 62 CHECK(saved_c_frame_fp); | 62 CHECK(saved_c_frame_fp); |
| 63 *(Top::c_entry_fp_address()) = 0; | 63 *(Top::c_entry_fp_address()) = 0; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 CHECK_EQ(0, GetJsEntrySp()); | 363 CHECK_EQ(0, GetJsEntrySp()); |
| 364 CompileRun("a = 1; b = a + 1;"); | 364 CompileRun("a = 1; b = a + 1;"); |
| 365 CHECK_EQ(0, GetJsEntrySp()); | 365 CHECK_EQ(0, GetJsEntrySp()); |
| 366 CompileRun("js_entry_sp();"); | 366 CompileRun("js_entry_sp();"); |
| 367 CHECK_EQ(0, GetJsEntrySp()); | 367 CHECK_EQ(0, GetJsEntrySp()); |
| 368 CompileRun("js_entry_sp_level2();"); | 368 CompileRun("js_entry_sp_level2();"); |
| 369 CHECK_EQ(0, GetJsEntrySp()); | 369 CHECK_EQ(0, GetJsEntrySp()); |
| 370 } | 370 } |
| 371 | 371 |
| 372 #endif // ENABLE_LOGGING_AND_PROFILING | 372 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |