| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 | 226 |
| 227 | 227 |
| 228 namespace v8 { | 228 namespace v8 { |
| 229 namespace internal { | 229 namespace internal { |
| 230 | 230 |
| 231 class CodeGeneratorPatcher { | 231 class CodeGeneratorPatcher { |
| 232 public: | 232 public: |
| 233 CodeGeneratorPatcher() { | 233 CodeGeneratorPatcher() { |
| 234 CodeGenerator::InlineRuntimeLUT genGetFramePointer = | 234 CodeGenerator::InlineRuntimeLUT genGetFramePointer = |
| 235 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer"}; | 235 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer", 0}; |
| 236 // _FastCharCodeAt is not used in our tests. | 236 // _RandomPositiveSmi is not used in our tests. The one we replace need to |
| 237 // have the same noumer of arguments as the one we put in, which is zero in |
| 238 // this case. |
| 237 bool result = CodeGenerator::PatchInlineRuntimeEntry( | 239 bool result = CodeGenerator::PatchInlineRuntimeEntry( |
| 238 NewString("_FastCharCodeAt"), | 240 NewString("_RandomPositiveSmi"), |
| 239 genGetFramePointer, &oldInlineEntry); | 241 genGetFramePointer, &oldInlineEntry); |
| 240 CHECK(result); | 242 CHECK(result); |
| 241 } | 243 } |
| 242 | 244 |
| 243 ~CodeGeneratorPatcher() { | 245 ~CodeGeneratorPatcher() { |
| 244 CHECK(CodeGenerator::PatchInlineRuntimeEntry( | 246 CHECK(CodeGenerator::PatchInlineRuntimeEntry( |
| 245 NewString("_GetFramePointer"), | 247 NewString("_GetFramePointer"), |
| 246 oldInlineEntry, NULL)); | 248 oldInlineEntry, NULL)); |
| 247 } | 249 } |
| 248 | 250 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 CHECK_EQ(0, GetJsEntrySp()); | 368 CHECK_EQ(0, GetJsEntrySp()); |
| 367 CompileRun("a = 1; b = a + 1;"); | 369 CompileRun("a = 1; b = a + 1;"); |
| 368 CHECK_EQ(0, GetJsEntrySp()); | 370 CHECK_EQ(0, GetJsEntrySp()); |
| 369 CompileRun("js_entry_sp();"); | 371 CompileRun("js_entry_sp();"); |
| 370 CHECK_EQ(0, GetJsEntrySp()); | 372 CHECK_EQ(0, GetJsEntrySp()); |
| 371 CompileRun("js_entry_sp_level2();"); | 373 CompileRun("js_entry_sp_level2();"); |
| 372 CHECK_EQ(0, GetJsEntrySp()); | 374 CHECK_EQ(0, GetJsEntrySp()); |
| 373 } | 375 } |
| 374 | 376 |
| 375 #endif // ENABLE_LOGGING_AND_PROFILING | 377 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |