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

Side by Side Diff: test/cctest/test-debug.cc

Issue 2664793002: [debugger] account for inlined functions when stepping. (Closed)
Patch Set: comment addressed Created 3 years, 10 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
« no previous file with comments | « src/frames.cc ('k') | test/debugger/regress/regress-5901-1.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 6438 matching lines...) Expand 10 before | Expand all | Expand 10 after
6449 " debugger; \n" 6449 " debugger; \n"
6450 " f(); \n" 6450 " f(); \n"
6451 " debugger; \n" 6451 " debugger; \n"
6452 "} \n" 6452 "} \n"
6453 "f"); 6453 "f");
6454 Handle<i::Object> function_obj = v8::Utils::OpenHandle(*result); 6454 Handle<i::Object> function_obj = v8::Utils::OpenHandle(*result);
6455 Handle<i::JSFunction> function = Handle<i::JSFunction>::cast(function_obj); 6455 Handle<i::JSFunction> function = Handle<i::JSFunction>::cast(function_obj);
6456 Handle<i::SharedFunctionInfo> shared(function->shared()); 6456 Handle<i::SharedFunctionInfo> shared(function->shared());
6457 6457
6458 EnableDebugger(isolate); 6458 EnableDebugger(isolate);
6459 CHECK(i_isolate->debug()->EnsureDebugInfo(shared, function)); 6459 CHECK(i_isolate->debug()->EnsureDebugInfo(shared));
6460 6460
6461 Handle<i::DebugInfo> debug_info(shared->GetDebugInfo()); 6461 Handle<i::DebugInfo> debug_info(shared->GetDebugInfo());
6462 Handle<i::AbstractCode> abstract_code(shared->abstract_code()); 6462 Handle<i::AbstractCode> abstract_code(shared->abstract_code());
6463 6463
6464 { 6464 {
6465 auto iterator = i::BreakIterator::GetIterator(debug_info, abstract_code, 6465 auto iterator = i::BreakIterator::GetIterator(debug_info, abstract_code);
6466 i::ALL_BREAK_LOCATIONS);
6467 CHECK(iterator->GetBreakLocation().IsDebuggerStatement()); 6466 CHECK(iterator->GetBreakLocation().IsDebuggerStatement());
6468 CHECK_EQ(17, iterator->GetBreakLocation().position()); 6467 CHECK_EQ(17, iterator->GetBreakLocation().position());
6469 iterator->Next(); 6468 iterator->Next();
6470 CHECK(iterator->GetBreakLocation().IsDebugBreakSlot()); 6469 CHECK(iterator->GetBreakLocation().IsDebugBreakSlot());
6471 CHECK_EQ(32, iterator->GetBreakLocation().position()); 6470 CHECK_EQ(32, iterator->GetBreakLocation().position());
6472 iterator->Next(); 6471 iterator->Next();
6473 CHECK(iterator->GetBreakLocation().IsCall()); 6472 CHECK(iterator->GetBreakLocation().IsCall());
6474 CHECK_EQ(32, iterator->GetBreakLocation().position()); 6473 CHECK_EQ(32, iterator->GetBreakLocation().position());
6475 iterator->Next(); 6474 iterator->Next();
6476 CHECK(iterator->GetBreakLocation().IsDebuggerStatement()); 6475 CHECK(iterator->GetBreakLocation().IsDebuggerStatement());
6477 CHECK_EQ(47, iterator->GetBreakLocation().position()); 6476 CHECK_EQ(47, iterator->GetBreakLocation().position());
6478 iterator->Next(); 6477 iterator->Next();
6479 CHECK(iterator->GetBreakLocation().IsReturn()); 6478 CHECK(iterator->GetBreakLocation().IsReturn());
6480 CHECK_EQ(60, iterator->GetBreakLocation().position()); 6479 CHECK_EQ(60, iterator->GetBreakLocation().position());
6481 iterator->Next(); 6480 iterator->Next();
6482 CHECK(iterator->Done()); 6481 CHECK(iterator->Done());
6483 } 6482 }
6484 6483
6485 {
6486 auto iterator = i::BreakIterator::GetIterator(debug_info, abstract_code,
6487 i::CALLS_AND_RETURNS);
6488 CHECK(iterator->GetBreakLocation().IsCall());
6489 CHECK_EQ(32, iterator->GetBreakLocation().position());
6490 iterator->Next();
6491 CHECK(iterator->GetBreakLocation().IsReturn());
6492 CHECK_EQ(60, iterator->GetBreakLocation().position());
6493 iterator->Next();
6494 CHECK(iterator->Done());
6495 }
6496
6497 DisableDebugger(isolate); 6484 DisableDebugger(isolate);
6498 } 6485 }
6499 6486
6500 TEST(DisableTailCallElimination) { 6487 TEST(DisableTailCallElimination) {
6501 i::FLAG_allow_natives_syntax = true; 6488 i::FLAG_allow_natives_syntax = true;
6502 i::FLAG_harmony_tailcalls = true; 6489 i::FLAG_harmony_tailcalls = true;
6503 // TODO(ishell, 4698): Investigate why TurboFan in --always-opt mode makes 6490 // TODO(ishell, 4698): Investigate why TurboFan in --always-opt mode makes
6504 // stack[2].getFunctionName() return null. 6491 // stack[2].getFunctionName() return null.
6505 i::FLAG_turbo_inlining = false; 6492 i::FLAG_turbo_inlining = false;
6506 6493
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
6665 reinterpret_cast<void*>(isolate)); 6652 reinterpret_cast<void*>(isolate));
6666 CHECK(!out_of_memory_callback_called); 6653 CHECK(!out_of_memory_callback_called);
6667 // The following allocation fails unless the out-of-memory callback 6654 // The following allocation fails unless the out-of-memory callback
6668 // increases the heap limit. 6655 // increases the heap limit.
6669 int length = 10 * i::MB / i::kPointerSize; 6656 int length = 10 * i::MB / i::kPointerSize;
6670 i_isolate->factory()->NewFixedArray(length, i::TENURED); 6657 i_isolate->factory()->NewFixedArray(length, i::TENURED);
6671 CHECK(out_of_memory_callback_called); 6658 CHECK(out_of_memory_callback_called);
6672 } 6659 }
6673 isolate->Dispose(); 6660 isolate->Dispose();
6674 } 6661 }
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | test/debugger/regress/regress-5901-1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698