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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 | 271 |
272 | 272 |
273 // This test verifies that stack tracing works when called during | 273 // This test verifies that stack tracing works when called during |
274 // execution of a native function called from JS code. In this case, | 274 // execution of a native function called from JS code. In this case, |
275 // StackTracer uses Isolate::c_entry_fp as a starting point for stack | 275 // StackTracer uses Isolate::c_entry_fp as a starting point for stack |
276 // walking. | 276 // walking. |
277 TEST(CFromJSStackTrace) { | 277 TEST(CFromJSStackTrace) { |
278 // BUG(1303) Inlining of JSFuncDoTrace() in JSTrace below breaks this test. | 278 // BUG(1303) Inlining of JSFuncDoTrace() in JSTrace below breaks this test. |
279 i::FLAG_use_inlining = false; | 279 i::FLAG_use_inlining = false; |
280 // This test does not work with --always-opt because we don't replace the code | 280 |
281 // in the JSFunction at deoptimization in that case. | |
282 i::FLAG_always_opt = false; | |
283 TickSample sample; | 281 TickSample sample; |
284 InitTraceEnv(&sample); | 282 InitTraceEnv(&sample); |
285 | 283 |
286 InitializeVM(); | 284 InitializeVM(); |
287 v8::HandleScope scope; | 285 v8::HandleScope scope; |
288 // Create global function JSFuncDoTrace which calls | 286 // Create global function JSFuncDoTrace which calls |
289 // extension function trace() with the current frame pointer value. | 287 // extension function trace() with the current frame pointer value. |
290 CreateTraceCallerFunction("JSFuncDoTrace", "trace"); | 288 CreateTraceCallerFunction("JSFuncDoTrace", "trace"); |
291 Local<Value> result = CompileRun( | 289 Local<Value> result = CompileRun( |
292 "function JSTrace() {" | 290 "function JSTrace() {" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 InitializeVM(); | 403 InitializeVM(); |
406 v8::HandleScope scope; | 404 v8::HandleScope scope; |
407 CHECK_EQ(0, GetJsEntrySp()); | 405 CHECK_EQ(0, GetJsEntrySp()); |
408 CompileRun("a = 1; b = a + 1;"); | 406 CompileRun("a = 1; b = a + 1;"); |
409 CHECK_EQ(0, GetJsEntrySp()); | 407 CHECK_EQ(0, GetJsEntrySp()); |
410 CompileRun("js_entry_sp();"); | 408 CompileRun("js_entry_sp();"); |
411 CHECK_EQ(0, GetJsEntrySp()); | 409 CHECK_EQ(0, GetJsEntrySp()); |
412 CompileRun("js_entry_sp_level2();"); | 410 CompileRun("js_entry_sp_level2();"); |
413 CHECK_EQ(0, GetJsEntrySp()); | 411 CHECK_EQ(0, GetJsEntrySp()); |
414 } | 412 } |
OLD | NEW |