| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 |
| 332 static void CFuncDoTrace(byte dummy_parameter) { | 332 static void CFuncDoTrace(byte dummy_parameter) { |
| 333 Address fp; | 333 Address fp; |
| 334 #ifdef __GNUC__ | 334 #ifdef __GNUC__ |
| 335 fp = reinterpret_cast<Address>(__builtin_frame_address(0)); | 335 fp = reinterpret_cast<Address>(__builtin_frame_address(0)); |
| 336 #elif defined _MSC_VER | 336 #elif defined _MSC_VER |
| 337 // Approximate a frame pointer address. We compile without base pointers, | 337 // Approximate a frame pointer address. We compile without base pointers, |
| 338 // so we can't trust ebp/rbp. | 338 // so we can't trust ebp/rbp. |
| 339 fp = &dummy_parameter - 2 * kPointerSize; | 339 fp = &dummy_parameter - 2 * sizeof(&dummy_parameter); |
| 340 #else | 340 #else |
| 341 #error Unexpected platform. | 341 #error Unexpected platform. |
| 342 #endif | 342 #endif |
| 343 DoTrace(fp); | 343 DoTrace(fp); |
| 344 } | 344 } |
| 345 | 345 |
| 346 | 346 |
| 347 static int CFunc(int depth) { | 347 static int CFunc(int depth) { |
| 348 if (depth <= 0) { | 348 if (depth <= 0) { |
| 349 CFuncDoTrace(0); | 349 CFuncDoTrace(0); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 368 CHECK_EQ(0, GetJsEntrySp()); | 368 CHECK_EQ(0, GetJsEntrySp()); |
| 369 CompileRun("a = 1; b = a + 1;"); | 369 CompileRun("a = 1; b = a + 1;"); |
| 370 CHECK_EQ(0, GetJsEntrySp()); | 370 CHECK_EQ(0, GetJsEntrySp()); |
| 371 CompileRun("js_entry_sp();"); | 371 CompileRun("js_entry_sp();"); |
| 372 CHECK_EQ(0, GetJsEntrySp()); | 372 CHECK_EQ(0, GetJsEntrySp()); |
| 373 CompileRun("js_entry_sp_level2();"); | 373 CompileRun("js_entry_sp_level2();"); |
| 374 CHECK_EQ(0, GetJsEntrySp()); | 374 CHECK_EQ(0, GetJsEntrySp()); |
| 375 } | 375 } |
| 376 | 376 |
| 377 #endif // ENABLE_LOGGING_AND_PROFILING | 377 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |