Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: test/cctest/test-log-stack-tracer.cc

Issue 9722041: Insert explicit deoptimization for named loads that have "uninitialized" type feedback. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 280 // This test does not work with --always-opt because we don't replace the code
281 // in the JSFunction at deoptimization in that case.
282 i::FLAG_always_opt = false;
281 TickSample sample; 283 TickSample sample;
282 InitTraceEnv(&sample); 284 InitTraceEnv(&sample);
283 285
284 InitializeVM(); 286 InitializeVM();
285 v8::HandleScope scope; 287 v8::HandleScope scope;
286 // Create global function JSFuncDoTrace which calls 288 // Create global function JSFuncDoTrace which calls
287 // extension function trace() with the current frame pointer value. 289 // extension function trace() with the current frame pointer value.
288 CreateTraceCallerFunction("JSFuncDoTrace", "trace"); 290 CreateTraceCallerFunction("JSFuncDoTrace", "trace");
289 Local<Value> result = CompileRun( 291 Local<Value> result = CompileRun(
290 "function JSTrace() {" 292 "function JSTrace() {"
291 " JSFuncDoTrace();" 293 " JSFuncDoTrace();"
292 "};\n" 294 "};\n"
293 "JSTrace();\n" 295 "JSTrace();\n"
294 "true;"); 296 "true;");
295 CHECK(!result.IsEmpty()); 297 CHECK(!result.IsEmpty());
296 // When stack tracer is invoked, the stack should look as follows: 298 // When stack tracer is invoked, the stack should look as follows:
297 // script [JS] 299 // script [JS]
298 // JSTrace() [JS] 300 // JSTrace() [JS]
299 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi] 301 // JSFuncDoTrace() [JS] [captures EBP value and encodes it as Smi]
300 // trace(EBP) [native (extension)] 302 // trace(EBP) [native (extension)]
301 // DoTrace(EBP) [native] 303 // DoTrace(EBP) [native]
302 // StackTracer::Trace 304 // StackTracer::Trace
303 305
304 CHECK(sample.has_external_callback); 306 CHECK(sample.has_external_callback);
305 CHECK_EQ(FUNCTION_ADDR(TraceExtension::Trace), sample.external_callback); 307 CHECK_EQ(FUNCTION_ADDR(TraceExtension::Trace), sample.external_callback);
306 308
307 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace" 309 // Stack tracing will start from the first JS function, i.e. "JSFuncDoTrace"
308 int base = 0; 310 int base = 0;
309 CHECK_GT(sample.frames_count, base + 1); 311 CHECK_GT(sample.frames_count, base + 1);
312
310 CHECK(IsAddressWithinFuncCode("JSFuncDoTrace", sample.stack[base + 0])); 313 CHECK(IsAddressWithinFuncCode("JSFuncDoTrace", sample.stack[base + 0]));
311 CHECK(IsAddressWithinFuncCode("JSTrace", sample.stack[base + 1])); 314 CHECK(IsAddressWithinFuncCode("JSTrace", sample.stack[base + 1]));
312 } 315 }
313 316
314 317
315 // This test verifies that stack tracing works when called during 318 // This test verifies that stack tracing works when called during
316 // execution of JS code. However, as calling StackTracer requires 319 // execution of JS code. However, as calling StackTracer requires
317 // entering native code, we can only emulate pure JS by erasing 320 // entering native code, we can only emulate pure JS by erasing
318 // Isolate::c_entry_fp value. In this case, StackTracer uses passed frame 321 // Isolate::c_entry_fp value. In this case, StackTracer uses passed frame
319 // pointer value as a starting point for stack walking. 322 // pointer value as a starting point for stack walking.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 InitializeVM(); 405 InitializeVM();
403 v8::HandleScope scope; 406 v8::HandleScope scope;
404 CHECK_EQ(0, GetJsEntrySp()); 407 CHECK_EQ(0, GetJsEntrySp());
405 CompileRun("a = 1; b = a + 1;"); 408 CompileRun("a = 1; b = a + 1;");
406 CHECK_EQ(0, GetJsEntrySp()); 409 CHECK_EQ(0, GetJsEntrySp());
407 CompileRun("js_entry_sp();"); 410 CompileRun("js_entry_sp();");
408 CHECK_EQ(0, GetJsEntrySp()); 411 CHECK_EQ(0, GetJsEntrySp());
409 CompileRun("js_entry_sp_level2();"); 412 CompileRun("js_entry_sp_level2();");
410 CHECK_EQ(0, GetJsEntrySp()); 413 CHECK_EQ(0, GetJsEntrySp());
411 } 414 }
OLDNEW
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698