| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return Top::js_entry_sp(Top::GetCurrentThread()); | 156 return Top::js_entry_sp(Top::GetCurrentThread()); |
| 157 } | 157 } |
| 158 | 158 |
| 159 | 159 |
| 160 v8::Handle<v8::Value> TraceExtension::JSEntrySP(const v8::Arguments& args) { | 160 v8::Handle<v8::Value> TraceExtension::JSEntrySP(const v8::Arguments& args) { |
| 161 CHECK_NE(0, GetJsEntrySp()); | 161 CHECK_NE(0, GetJsEntrySp()); |
| 162 return v8::Undefined(); | 162 return v8::Undefined(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 | 165 |
| 166 static void CompileRun(const char* source) { |
| 167 Script::Compile(String::New(source))->Run(); |
| 168 } |
| 169 |
| 170 |
| 166 v8::Handle<v8::Value> TraceExtension::JSEntrySPLevel2( | 171 v8::Handle<v8::Value> TraceExtension::JSEntrySPLevel2( |
| 167 const v8::Arguments& args) { | 172 const v8::Arguments& args) { |
| 168 v8::HandleScope scope; | 173 v8::HandleScope scope; |
| 169 const Address js_entry_sp = GetJsEntrySp(); | 174 const Address js_entry_sp = GetJsEntrySp(); |
| 170 CHECK_NE(0, js_entry_sp); | 175 CHECK_NE(0, js_entry_sp); |
| 171 CompileRun("js_entry_sp();"); | 176 CompileRun("js_entry_sp();"); |
| 172 CHECK_EQ(js_entry_sp, GetJsEntrySp()); | 177 CHECK_EQ(js_entry_sp, GetJsEntrySp()); |
| 173 return v8::Undefined(); | 178 return v8::Undefined(); |
| 174 } | 179 } |
| 175 | 180 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 CHECK_EQ(0, GetJsEntrySp()); | 368 CHECK_EQ(0, GetJsEntrySp()); |
| 364 CompileRun("a = 1; b = a + 1;"); | 369 CompileRun("a = 1; b = a + 1;"); |
| 365 CHECK_EQ(0, GetJsEntrySp()); | 370 CHECK_EQ(0, GetJsEntrySp()); |
| 366 CompileRun("js_entry_sp();"); | 371 CompileRun("js_entry_sp();"); |
| 367 CHECK_EQ(0, GetJsEntrySp()); | 372 CHECK_EQ(0, GetJsEntrySp()); |
| 368 CompileRun("js_entry_sp_level2();"); | 373 CompileRun("js_entry_sp_level2();"); |
| 369 CHECK_EQ(0, GetJsEntrySp()); | 374 CHECK_EQ(0, GetJsEntrySp()); |
| 370 } | 375 } |
| 371 | 376 |
| 372 #endif // ENABLE_LOGGING_AND_PROFILING | 377 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |