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 | |
171 v8::Handle<v8::Value> TraceExtension::JSEntrySPLevel2( | 166 v8::Handle<v8::Value> TraceExtension::JSEntrySPLevel2( |
172 const v8::Arguments& args) { | 167 const v8::Arguments& args) { |
173 v8::HandleScope scope; | 168 v8::HandleScope scope; |
174 const Address js_entry_sp = GetJsEntrySp(); | 169 const Address js_entry_sp = GetJsEntrySp(); |
175 CHECK_NE(0, js_entry_sp); | 170 CHECK_NE(0, js_entry_sp); |
176 CompileRun("js_entry_sp();"); | 171 CompileRun("js_entry_sp();"); |
177 CHECK_EQ(js_entry_sp, GetJsEntrySp()); | 172 CHECK_EQ(js_entry_sp, GetJsEntrySp()); |
178 return v8::Undefined(); | 173 return v8::Undefined(); |
179 } | 174 } |
180 | 175 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 CHECK_EQ(0, GetJsEntrySp()); | 363 CHECK_EQ(0, GetJsEntrySp()); |
369 CompileRun("a = 1; b = a + 1;"); | 364 CompileRun("a = 1; b = a + 1;"); |
370 CHECK_EQ(0, GetJsEntrySp()); | 365 CHECK_EQ(0, GetJsEntrySp()); |
371 CompileRun("js_entry_sp();"); | 366 CompileRun("js_entry_sp();"); |
372 CHECK_EQ(0, GetJsEntrySp()); | 367 CHECK_EQ(0, GetJsEntrySp()); |
373 CompileRun("js_entry_sp_level2();"); | 368 CompileRun("js_entry_sp_level2();"); |
374 CHECK_EQ(0, GetJsEntrySp()); | 369 CHECK_EQ(0, GetJsEntrySp()); |
375 } | 370 } |
376 | 371 |
377 #endif // ENABLE_LOGGING_AND_PROFILING | 372 #endif // ENABLE_LOGGING_AND_PROFILING |
OLD | NEW |