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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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", 0}; | 235 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer", 0}; |
236 // _RandomPositiveSmi is not used in our tests. The one we replace need to | 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 | 237 // have the same number of arguments as the one we put in, which is zero in |
238 // this case. | 238 // this case. |
239 bool result = CodeGenerator::PatchInlineRuntimeEntry( | 239 bool result = CodeGenerator::PatchInlineRuntimeEntry( |
240 NewString("_RandomPositiveSmi"), | 240 NewString("_RandomPositiveSmi"), |
241 genGetFramePointer, &oldInlineEntry); | 241 genGetFramePointer, &oldInlineEntry); |
242 CHECK(result); | 242 CHECK(result); |
243 } | 243 } |
244 | 244 |
245 ~CodeGeneratorPatcher() { | 245 ~CodeGeneratorPatcher() { |
246 CHECK(CodeGenerator::PatchInlineRuntimeEntry( | 246 CHECK(CodeGenerator::PatchInlineRuntimeEntry( |
247 NewString("_GetFramePointer"), | 247 NewString("_GetFramePointer"), |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |