OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 static TraceExtension kTraceExtension; | 180 static TraceExtension kTraceExtension; |
181 v8::DeclareExtension kTraceExtensionDeclaration(&kTraceExtension); | 181 v8::DeclareExtension kTraceExtensionDeclaration(&kTraceExtension); |
182 | 182 |
183 | 183 |
184 static bool IsAddressWithinFuncCode(JSFunction* function, Address addr) { | 184 static bool IsAddressWithinFuncCode(JSFunction* function, Address addr) { |
185 i::Code* code = function->code(); | 185 i::Code* code = function->code(); |
186 return code->contains(addr); | 186 return code->contains(addr); |
187 } | 187 } |
188 | 188 |
| 189 |
189 static bool IsAddressWithinFuncCode(const char* func_name, Address addr) { | 190 static bool IsAddressWithinFuncCode(const char* func_name, Address addr) { |
190 v8::Local<v8::Value> func = CcTest::env()->Global()->Get(v8_str(func_name)); | 191 v8::Local<v8::Value> func = CcTest::env()->Global()->Get(v8_str(func_name)); |
191 CHECK(func->IsFunction()); | 192 CHECK(func->IsFunction()); |
192 JSFunction* js_func = JSFunction::cast(*v8::Utils::OpenHandle(*func)); | 193 JSFunction* js_func = JSFunction::cast(*v8::Utils::OpenHandle(*func)); |
193 return IsAddressWithinFuncCode(js_func, addr); | 194 return IsAddressWithinFuncCode(js_func, addr); |
194 } | 195 } |
195 | 196 |
196 | 197 |
197 // This C++ function is called as a constructor, to grab the frame pointer | 198 // This C++ function is called as a constructor, to grab the frame pointer |
198 // from the calling function. When this function runs, the stack contains | 199 // from the calling function. When this function runs, the stack contains |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 CcTest::InitializeVM(TRACE_EXTENSION); | 389 CcTest::InitializeVM(TRACE_EXTENSION); |
389 v8::HandleScope scope(CcTest::isolate()); | 390 v8::HandleScope scope(CcTest::isolate()); |
390 CHECK_EQ(0, GetJsEntrySp()); | 391 CHECK_EQ(0, GetJsEntrySp()); |
391 CompileRun("a = 1; b = a + 1;"); | 392 CompileRun("a = 1; b = a + 1;"); |
392 CHECK_EQ(0, GetJsEntrySp()); | 393 CHECK_EQ(0, GetJsEntrySp()); |
393 CompileRun("js_entry_sp();"); | 394 CompileRun("js_entry_sp();"); |
394 CHECK_EQ(0, GetJsEntrySp()); | 395 CHECK_EQ(0, GetJsEntrySp()); |
395 CompileRun("js_entry_sp_level2();"); | 396 CompileRun("js_entry_sp_level2();"); |
396 CHECK_EQ(0, GetJsEntrySp()); | 397 CHECK_EQ(0, GetJsEntrySp()); |
397 } | 398 } |
OLD | NEW |