| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 | 229 |
| 230 namespace v8 { | 230 namespace v8 { |
| 231 namespace internal { | 231 namespace internal { |
| 232 | 232 |
| 233 class CodeGeneratorPatcher { | 233 class CodeGeneratorPatcher { |
| 234 public: | 234 public: |
| 235 CodeGeneratorPatcher() { | 235 CodeGeneratorPatcher() { |
| 236 CodeGenerator::InlineRuntimeLUT genGetFramePointer = | 236 CodeGenerator::InlineRuntimeLUT genGetFramePointer = |
| 237 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer", 0}; | 237 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer", 0}; |
| 238 // _RandomPositiveSmi is not used in our tests. The one we replace need to | 238 // _RandomHeapNumber is just used as a dummy function that has zero |
| 239 // have the same number of arguments as the one we put in, which is zero in | 239 // arguments, the same as the _GetFramePointer function we actually patch |
| 240 // this case. | 240 // in. |
| 241 bool result = CodeGenerator::PatchInlineRuntimeEntry( | 241 bool result = CodeGenerator::PatchInlineRuntimeEntry( |
| 242 NewString("_RandomPositiveSmi"), | 242 NewString("_RandomHeapNumber"), |
| 243 genGetFramePointer, &oldInlineEntry); | 243 genGetFramePointer, &oldInlineEntry); |
| 244 CHECK(result); | 244 CHECK(result); |
| 245 } | 245 } |
| 246 | 246 |
| 247 ~CodeGeneratorPatcher() { | 247 ~CodeGeneratorPatcher() { |
| 248 CHECK(CodeGenerator::PatchInlineRuntimeEntry( | 248 CHECK(CodeGenerator::PatchInlineRuntimeEntry( |
| 249 NewString("_GetFramePointer"), | 249 NewString("_GetFramePointer"), |
| 250 oldInlineEntry, NULL)); | 250 oldInlineEntry, NULL)); |
| 251 } | 251 } |
| 252 | 252 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 CHECK_EQ(0, GetJsEntrySp()); | 408 CHECK_EQ(0, GetJsEntrySp()); |
| 409 CompileRun("a = 1; b = a + 1;"); | 409 CompileRun("a = 1; b = a + 1;"); |
| 410 CHECK_EQ(0, GetJsEntrySp()); | 410 CHECK_EQ(0, GetJsEntrySp()); |
| 411 CompileRun("js_entry_sp();"); | 411 CompileRun("js_entry_sp();"); |
| 412 CHECK_EQ(0, GetJsEntrySp()); | 412 CHECK_EQ(0, GetJsEntrySp()); |
| 413 CompileRun("js_entry_sp_level2();"); | 413 CompileRun("js_entry_sp_level2();"); |
| 414 CHECK_EQ(0, GetJsEntrySp()); | 414 CHECK_EQ(0, GetJsEntrySp()); |
| 415 } | 415 } |
| 416 | 416 |
| 417 #endif // ENABLE_LOGGING_AND_PROFILING | 417 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |