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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return i::Factory::NewStringFromAscii(i::CStrVector(s)); | 210 return i::Factory::NewStringFromAscii(i::CStrVector(s)); |
211 } | 211 } |
212 | 212 |
213 | 213 |
214 namespace v8 { | 214 namespace v8 { |
215 namespace internal { | 215 namespace internal { |
216 | 216 |
217 class CodeGeneratorPatcher { | 217 class CodeGeneratorPatcher { |
218 public: | 218 public: |
219 CodeGeneratorPatcher() { | 219 CodeGeneratorPatcher() { |
220 CodeGenerator::InlineRuntimeLUT genGetFramePointer = | 220 InlineRuntimeFunctionsTable::Entry genGetFramePointer = |
221 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer", 0}; | 221 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer", 0}; |
222 // _RandomHeapNumber is just used as a dummy function that has zero | 222 // _RandomHeapNumber is just used as a dummy function that has zero |
223 // arguments, the same as the _GetFramePointer function we actually patch | 223 // arguments, the same as the _GetFramePointer function we actually patch |
224 // in. | 224 // in. |
225 bool result = CodeGenerator::PatchInlineRuntimeEntry( | 225 bool result = CodeGenerator::PatchInlineRuntimeEntry( |
226 NewString("_RandomHeapNumber"), | 226 NewString("_RandomHeapNumber"), |
227 genGetFramePointer, &oldInlineEntry); | 227 genGetFramePointer, &oldInlineEntry); |
228 CHECK(result); | 228 CHECK(result); |
229 } | 229 } |
230 | 230 |
231 ~CodeGeneratorPatcher() { | 231 ~CodeGeneratorPatcher() { |
232 CHECK(CodeGenerator::PatchInlineRuntimeEntry( | 232 CHECK(CodeGenerator::PatchInlineRuntimeEntry( |
233 NewString("_GetFramePointer"), | 233 NewString("_GetFramePointer"), |
234 oldInlineEntry, NULL)); | 234 oldInlineEntry, NULL)); |
235 } | 235 } |
236 | 236 |
237 private: | 237 private: |
238 CodeGenerator::InlineRuntimeLUT oldInlineEntry; | 238 InlineRuntimeFunctionsTable::Entry oldInlineEntry; |
239 }; | 239 }; |
240 | 240 |
241 } } // namespace v8::internal | 241 } } // namespace v8::internal |
242 | 242 |
243 | 243 |
244 // Creates a global function named 'func_name' that calls the tracing | 244 // Creates a global function named 'func_name' that calls the tracing |
245 // function 'trace_func_name' with an actual EBP register value, | 245 // function 'trace_func_name' with an actual EBP register value, |
246 // shifted right to be presented as Smi. | 246 // shifted right to be presented as Smi. |
247 static void CreateTraceCallerFunction(const char* func_name, | 247 static void CreateTraceCallerFunction(const char* func_name, |
248 const char* trace_func_name) { | 248 const char* trace_func_name) { |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 CHECK_EQ(0, GetJsEntrySp()); | 399 CHECK_EQ(0, GetJsEntrySp()); |
400 CompileRun("a = 1; b = a + 1;"); | 400 CompileRun("a = 1; b = a + 1;"); |
401 CHECK_EQ(0, GetJsEntrySp()); | 401 CHECK_EQ(0, GetJsEntrySp()); |
402 CompileRun("js_entry_sp();"); | 402 CompileRun("js_entry_sp();"); |
403 CHECK_EQ(0, GetJsEntrySp()); | 403 CHECK_EQ(0, GetJsEntrySp()); |
404 CompileRun("js_entry_sp_level2();"); | 404 CompileRun("js_entry_sp_level2();"); |
405 CHECK_EQ(0, GetJsEntrySp()); | 405 CHECK_EQ(0, GetJsEntrySp()); |
406 } | 406 } |
407 | 407 |
408 #endif // ENABLE_LOGGING_AND_PROFILING | 408 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |