| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 "true;"); | 279 "true;"); |
| 280 CHECK(!result.IsEmpty()); | 280 CHECK(!result.IsEmpty()); |
| 281 // When stack tracer is invoked, the stack should look as follows: | 281 // When stack tracer is invoked, the stack should look as follows: |
| 282 // script [JS] | 282 // script [JS] |
| 283 // JSTrace() [JS] | 283 // JSTrace() [JS] |
| 284 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi] | 284 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi] |
| 285 // trace(EBP) [native (extension)] | 285 // trace(EBP) [native (extension)] |
| 286 // DoTrace(EBP) [native] | 286 // DoTrace(EBP) [native] |
| 287 // TickSample::Trace | 287 // TickSample::Trace |
| 288 | 288 |
| 289 CHECK(sample.external_callback); | 289 CHECK(sample.has_external_callback); |
| 290 CHECK_EQ(FUNCTION_ADDR(TraceExtension::Trace), sample.external_callback); | 290 CHECK_EQ(FUNCTION_ADDR(TraceExtension::Trace), sample.external_callback); |
| 291 | 291 |
| 292 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace" | 292 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace" |
| 293 int base = 0; | 293 int base = 0; |
| 294 CHECK_GT(sample.frames_count, base + 1); | 294 CHECK_GT(sample.frames_count, base + 1); |
| 295 | 295 |
| 296 CHECK(IsAddressWithinFuncCode("JSFuncDoTrace", sample.stack[base + 0])); | 296 CHECK(IsAddressWithinFuncCode("JSFuncDoTrace", sample.stack[base + 0])); |
| 297 CHECK(IsAddressWithinFuncCode("JSTrace", sample.stack[base + 1])); | 297 CHECK(IsAddressWithinFuncCode("JSTrace", sample.stack[base + 1])); |
| 298 } | 298 } |
| 299 | 299 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 329 // When stack tracer is invoked, the stack should look as follows: | 329 // When stack tracer is invoked, the stack should look as follows: |
| 330 // script [JS] | 330 // script [JS] |
| 331 // OuterJSTrace() [JS] | 331 // OuterJSTrace() [JS] |
| 332 // JSTrace() [JS] | 332 // JSTrace() [JS] |
| 333 // JSFuncDoTrace() [JS] | 333 // JSFuncDoTrace() [JS] |
| 334 // js_trace(EBP) [native (extension)] | 334 // js_trace(EBP) [native (extension)] |
| 335 // DoTraceHideCEntryFPAddress(EBP) [native] | 335 // DoTraceHideCEntryFPAddress(EBP) [native] |
| 336 // TickSample::Trace | 336 // TickSample::Trace |
| 337 // | 337 // |
| 338 | 338 |
| 339 CHECK(sample.external_callback); | 339 CHECK(sample.has_external_callback); |
| 340 CHECK_EQ(FUNCTION_ADDR(TraceExtension::JSTrace), sample.external_callback); | 340 CHECK_EQ(FUNCTION_ADDR(TraceExtension::JSTrace), sample.external_callback); |
| 341 | 341 |
| 342 // Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace" | 342 // Stack sampling will start from the caller of JSFuncDoTrace, i.e. "JSTrace" |
| 343 int base = 0; | 343 int base = 0; |
| 344 CHECK_GT(sample.frames_count, base + 1); | 344 CHECK_GT(sample.frames_count, base + 1); |
| 345 CHECK(IsAddressWithinFuncCode("JSTrace", sample.stack[base + 0])); | 345 CHECK(IsAddressWithinFuncCode("JSTrace", sample.stack[base + 0])); |
| 346 CHECK(IsAddressWithinFuncCode("OuterJSTrace", sample.stack[base + 1])); | 346 CHECK(IsAddressWithinFuncCode("OuterJSTrace", sample.stack[base + 1])); |
| 347 } | 347 } |
| 348 | 348 |
| 349 | 349 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 CcTest::InitializeVM(TRACE_EXTENSION); | 388 CcTest::InitializeVM(TRACE_EXTENSION); |
| 389 v8::HandleScope scope(CcTest::isolate()); | 389 v8::HandleScope scope(CcTest::isolate()); |
| 390 CHECK_EQ(0, GetJsEntrySp()); | 390 CHECK_EQ(0, GetJsEntrySp()); |
| 391 CompileRun("a = 1; b = a + 1;"); | 391 CompileRun("a = 1; b = a + 1;"); |
| 392 CHECK_EQ(0, GetJsEntrySp()); | 392 CHECK_EQ(0, GetJsEntrySp()); |
| 393 CompileRun("js_entry_sp();"); | 393 CompileRun("js_entry_sp();"); |
| 394 CHECK_EQ(0, GetJsEntrySp()); | 394 CHECK_EQ(0, GetJsEntrySp()); |
| 395 CompileRun("js_entry_sp_level2();"); | 395 CompileRun("js_entry_sp_level2();"); |
| 396 CHECK_EQ(0, GetJsEntrySp()); | 396 CHECK_EQ(0, GetJsEntrySp()); |
| 397 } | 397 } |
| OLD | NEW |