| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 CompileRun(trace_call_buf.start()); | 134 CompileRun(trace_call_buf.start()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 | 137 |
| 138 // This test verifies that stack tracing works when called during | 138 // This test verifies that stack tracing works when called during |
| 139 // execution of a native function called from JS code. In this case, | 139 // execution of a native function called from JS code. In this case, |
| 140 // TickSample::Trace uses Isolate::c_entry_fp as a starting point for stack | 140 // TickSample::Trace uses Isolate::c_entry_fp as a starting point for stack |
| 141 // walking. | 141 // walking. |
| 142 TEST(CFromJSStackTrace) { | 142 TEST(CFromJSStackTrace) { |
| 143 // BUG(1303) Inlining of JSFuncDoTrace() in JSTrace below breaks this test. | 143 // BUG(1303) Inlining of JSFuncDoTrace() in JSTrace below breaks this test. |
| 144 i::FLAG_turbo_inlining = false; |
| 144 i::FLAG_use_inlining = false; | 145 i::FLAG_use_inlining = false; |
| 145 | 146 |
| 146 TickSample sample; | 147 TickSample sample; |
| 147 i::TraceExtension::InitTraceEnv(&sample); | 148 i::TraceExtension::InitTraceEnv(&sample); |
| 148 | 149 |
| 149 v8::HandleScope scope(CcTest::isolate()); | 150 v8::HandleScope scope(CcTest::isolate()); |
| 150 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); | 151 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); |
| 151 v8::Context::Scope context_scope(context); | 152 v8::Context::Scope context_scope(context); |
| 152 | 153 |
| 153 // Create global function JSFuncDoTrace which calls | 154 // Create global function JSFuncDoTrace which calls |
| (...skipping 28 matching lines...) Expand all Loading... |
| 182 | 183 |
| 183 | 184 |
| 184 // This test verifies that stack tracing works when called during | 185 // This test verifies that stack tracing works when called during |
| 185 // execution of JS code. However, as calling TickSample::Trace requires | 186 // execution of JS code. However, as calling TickSample::Trace requires |
| 186 // entering native code, we can only emulate pure JS by erasing | 187 // entering native code, we can only emulate pure JS by erasing |
| 187 // Isolate::c_entry_fp value. In this case, TickSample::Trace uses passed frame | 188 // Isolate::c_entry_fp value. In this case, TickSample::Trace uses passed frame |
| 188 // pointer value as a starting point for stack walking. | 189 // pointer value as a starting point for stack walking. |
| 189 TEST(PureJSStackTrace) { | 190 TEST(PureJSStackTrace) { |
| 190 // This test does not pass with inlining enabled since inlined functions | 191 // This test does not pass with inlining enabled since inlined functions |
| 191 // don't appear in the stack trace. | 192 // don't appear in the stack trace. |
| 193 i::FLAG_turbo_inlining = false; |
| 192 i::FLAG_use_inlining = false; | 194 i::FLAG_use_inlining = false; |
| 193 | 195 |
| 194 TickSample sample; | 196 TickSample sample; |
| 195 i::TraceExtension::InitTraceEnv(&sample); | 197 i::TraceExtension::InitTraceEnv(&sample); |
| 196 | 198 |
| 197 v8::HandleScope scope(CcTest::isolate()); | 199 v8::HandleScope scope(CcTest::isolate()); |
| 198 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); | 200 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); |
| 199 v8::Context::Scope context_scope(context); | 201 v8::Context::Scope context_scope(context); |
| 200 | 202 |
| 201 // Create global function JSFuncDoTrace which calls | 203 // Create global function JSFuncDoTrace which calls |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); | 279 v8::Local<v8::Context> context = CcTest::NewContext(TRACE_EXTENSION); |
| 278 v8::Context::Scope context_scope(context); | 280 v8::Context::Scope context_scope(context); |
| 279 CHECK(!i::TraceExtension::GetJsEntrySp()); | 281 CHECK(!i::TraceExtension::GetJsEntrySp()); |
| 280 CompileRun("a = 1; b = a + 1;"); | 282 CompileRun("a = 1; b = a + 1;"); |
| 281 CHECK(!i::TraceExtension::GetJsEntrySp()); | 283 CHECK(!i::TraceExtension::GetJsEntrySp()); |
| 282 CompileRun("js_entry_sp();"); | 284 CompileRun("js_entry_sp();"); |
| 283 CHECK(!i::TraceExtension::GetJsEntrySp()); | 285 CHECK(!i::TraceExtension::GetJsEntrySp()); |
| 284 CompileRun("js_entry_sp_level2();"); | 286 CompileRun("js_entry_sp_level2();"); |
| 285 CHECK(!i::TraceExtension::GetJsEntrySp()); | 287 CHECK(!i::TraceExtension::GetJsEntrySp()); |
| 286 } | 288 } |
| OLD | NEW |