| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // JSTrace() [JS] | 165 // JSTrace() [JS] |
| 166 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi] | 166 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi] |
| 167 // trace(EBP) [native (extension)] | 167 // trace(EBP) [native (extension)] |
| 168 // DoTrace(EBP) [native] | 168 // DoTrace(EBP) [native] |
| 169 // TickSample::Trace | 169 // TickSample::Trace |
| 170 | 170 |
| 171 CHECK(sample.has_external_callback); | 171 CHECK(sample.has_external_callback); |
| 172 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::Trace), sample.external_callback); | 172 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::Trace), sample.external_callback); |
| 173 | 173 |
| 174 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace" | 174 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace" |
| 175 int base = 0; | 175 unsigned base = 0; |
| 176 CHECK_GT(sample.frames_count, base + 1); | 176 CHECK_GT(sample.frames_count, base + 1); |
| 177 | 177 |
| 178 CHECK(IsAddressWithinFuncCode( | 178 CHECK(IsAddressWithinFuncCode( |
| 179 context, "JSFuncDoTrace", sample.stack[base + 0])); | 179 context, "JSFuncDoTrace", sample.stack[base + 0])); |
| 180 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 1])); | 180 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 1])); |
| 181 } | 181 } |
| 182 | 182 |
| 183 | 183 |
| 184 // This test verifies that stack tracing works when called during | 184 // This test verifies that stack tracing works when called during |
| 185 // execution of JS code. However, as calling TickSample::Trace requires | 185 // execution of JS code. However, as calling TickSample::Trace requires |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // JSFuncDoTrace() [JS] | 218 // JSFuncDoTrace() [JS] |
| 219 // js_trace(EBP) [native (extension)] | 219 // js_trace(EBP) [native (extension)] |
| 220 // DoTraceHideCEntryFPAddress(EBP) [native] | 220 // DoTraceHideCEntryFPAddress(EBP) [native] |
| 221 // TickSample::Trace | 221 // TickSample::Trace |
| 222 // | 222 // |
| 223 | 223 |
| 224 CHECK(sample.has_external_callback); | 224 CHECK(sample.has_external_callback); |
| 225 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::JSTrace), sample.external_callback); | 225 CHECK_EQ(FUNCTION_ADDR(i::TraceExtension::JSTrace), sample.external_callback); |
| 226 | 226 |
| 227 // Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace" | 227 // Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace" |
| 228 int base = 0; | 228 unsigned base = 0; |
| 229 CHECK_GT(sample.frames_count, base + 1); | 229 CHECK_GT(sample.frames_count, base + 1); |
| 230 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 0])); | 230 CHECK(IsAddressWithinFuncCode(context, "JSTrace", sample.stack[base + 0])); |
| 231 CHECK(IsAddressWithinFuncCode( | 231 CHECK(IsAddressWithinFuncCode( |
| 232 context, "OuterJSTrace", sample.stack[base + 1])); | 232 context, "OuterJSTrace", sample.stack[base + 1])); |
| 233 } | 233 } |
| 234 | 234 |
| 235 | 235 |
| 236 static void CFuncDoTrace(byte dummy_parameter) { | 236 static void CFuncDoTrace(byte dummy_parameter) { |
| 237 Address fp; | 237 Address fp; |
| 238 #ifdef __GNUC__ | 238 #ifdef __GNUC__ |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); | 277 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); |
| 278 v8::Context::Scope context_scope(context); | 278 v8::Context::Scope context_scope(context); |
| 279 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); | 279 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); |
| 280 CompileRun("a = 1; b = a + 1;"); | 280 CompileRun("a = 1; b = a + 1;"); |
| 281 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); | 281 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); |
| 282 CompileRun("js_entry_sp();"); | 282 CompileRun("js_entry_sp();"); |
| 283 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); | 283 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); |
| 284 CompileRun("js_entry_sp_level2();"); | 284 CompileRun("js_entry_sp_level2();"); |
| 285 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); | 285 CHECK_EQ(0, i::TraceExtension::GetJsEntrySp()); |
| 286 } | 286 } |
| OLD | NEW |