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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 static void SetGlobalProperty(const char* name, Local<Value> value) { | 192 static void SetGlobalProperty(const char* name, Local<Value> value) { |
193 env->Global()->Set(String::New(name), value); | 193 env->Global()->Set(String::New(name), value); |
194 } | 194 } |
195 | 195 |
196 | 196 |
197 static Handle<v8::internal::String> NewString(const char* s) { | 197 static Handle<v8::internal::String> NewString(const char* s) { |
198 return i::Factory::NewStringFromAscii(i::CStrVector(s)); | 198 return i::Factory::NewStringFromAscii(i::CStrVector(s)); |
199 } | 199 } |
200 | 200 |
201 | 201 |
202 namespace v8 { namespace internal { | 202 namespace v8 { |
| 203 namespace internal { |
203 | 204 |
204 class CodeGeneratorPatcher { | 205 class CodeGeneratorPatcher { |
205 public: | 206 public: |
206 CodeGeneratorPatcher() { | 207 CodeGeneratorPatcher() { |
207 CodeGenerator::InlineRuntimeLUT genGetFramePointer = | 208 CodeGenerator::InlineRuntimeLUT genGetFramePointer = |
208 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer"}; | 209 {&CodeGenerator::GenerateGetFramePointer, "_GetFramePointer"}; |
209 // _FastCharCodeAt is not used in our tests. | 210 // _FastCharCodeAt is not used in our tests. |
210 bool result = CodeGenerator::PatchInlineRuntimeEntry( | 211 bool result = CodeGenerator::PatchInlineRuntimeEntry( |
211 NewString("_FastCharCodeAt"), | 212 NewString("_FastCharCodeAt"), |
212 genGetFramePointer, &oldInlineEntry); | 213 genGetFramePointer, &oldInlineEntry); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 TEST(PureCStackTrace) { | 324 TEST(PureCStackTrace) { |
324 TickSample sample; | 325 TickSample sample; |
325 StackTracer tracer(reinterpret_cast<uintptr_t>(&sample)); | 326 StackTracer tracer(reinterpret_cast<uintptr_t>(&sample)); |
326 InitTraceEnv(&tracer, &sample); | 327 InitTraceEnv(&tracer, &sample); |
327 // Check that sampler doesn't crash | 328 // Check that sampler doesn't crash |
328 CHECK_EQ(10, CFunc(10)); | 329 CHECK_EQ(10, CFunc(10)); |
329 } | 330 } |
330 | 331 |
331 | 332 |
332 #endif // ENABLE_LOGGING_AND_PROFILING | 333 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |