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

Side by Side Diff: src/debug.cc

Issue 9297019: Fix and adapt debugger for new call target caches. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Yang Guo. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « src/debug.h ('k') | src/ia32/debug-ia32.cc » ('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 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 ScopedVector<char> data(s->Length() + 1); 78 ScopedVector<char> data(s->Length() + 1);
79 if (data.start() == NULL) { 79 if (data.start() == NULL) {
80 V8::FatalProcessOutOfMemory("PrintLn"); 80 V8::FatalProcessOutOfMemory("PrintLn");
81 return; 81 return;
82 } 82 }
83 s->WriteAscii(data.start()); 83 s->WriteAscii(data.start());
84 PrintF("%s\n", data.start()); 84 PrintF("%s\n", data.start());
85 } 85 }
86 86
87 87
88 static Handle<Code> ComputeCallDebugBreak(int argc, Code::Kind kind) {
89 Isolate* isolate = Isolate::Current();
90 return isolate->stub_cache()->ComputeCallDebugBreak(argc, kind);
91 }
92
93
94 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind) { 88 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind) {
95 Isolate* isolate = Isolate::Current(); 89 Isolate* isolate = Isolate::Current();
96 return isolate->stub_cache()->ComputeCallDebugPrepareStepIn(argc, kind); 90 return isolate->stub_cache()->ComputeCallDebugPrepareStepIn(argc, kind);
97 } 91 }
98 92
99 93
100 static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) { 94 static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) {
101 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext(); 95 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext();
102 // Isolate::context() may have been NULL when "script collected" event 96 // Isolate::context() may have been NULL when "script collected" event
103 // occured. 97 // occured.
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 // Check whether a code stub with the specified major key is a possible break 1525 // Check whether a code stub with the specified major key is a possible break
1532 // location. 1526 // location.
1533 bool Debug::IsBreakStub(Code* code) { 1527 bool Debug::IsBreakStub(Code* code) {
1534 CodeStub::Major major_key = CodeStub::GetMajorKey(code); 1528 CodeStub::Major major_key = CodeStub::GetMajorKey(code);
1535 return major_key == CodeStub::CallFunction; 1529 return major_key == CodeStub::CallFunction;
1536 } 1530 }
1537 1531
1538 1532
1539 // Find the builtin to use for invoking the debug break 1533 // Find the builtin to use for invoking the debug break
1540 Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) { 1534 Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
1535 Isolate* isolate = Isolate::Current();
1536
1541 // Find the builtin debug break function matching the calling convention 1537 // Find the builtin debug break function matching the calling convention
1542 // used by the call site. 1538 // used by the call site.
1543 if (code->is_inline_cache_stub()) { 1539 if (code->is_inline_cache_stub()) {
1544 switch (code->kind()) { 1540 switch (code->kind()) {
1545 case Code::CALL_IC: 1541 case Code::CALL_IC:
1546 case Code::KEYED_CALL_IC: 1542 case Code::KEYED_CALL_IC:
1547 return ComputeCallDebugBreak(code->arguments_count(), code->kind()); 1543 return isolate->stub_cache()->ComputeCallDebugBreak(
1544 code->arguments_count(), code->kind());
1548 1545
1549 case Code::LOAD_IC: 1546 case Code::LOAD_IC:
1550 return Isolate::Current()->builtins()->LoadIC_DebugBreak(); 1547 return isolate->builtins()->LoadIC_DebugBreak();
1551 1548
1552 case Code::STORE_IC: 1549 case Code::STORE_IC:
1553 return Isolate::Current()->builtins()->StoreIC_DebugBreak(); 1550 return isolate->builtins()->StoreIC_DebugBreak();
1554 1551
1555 case Code::KEYED_LOAD_IC: 1552 case Code::KEYED_LOAD_IC:
1556 return Isolate::Current()->builtins()->KeyedLoadIC_DebugBreak(); 1553 return isolate->builtins()->KeyedLoadIC_DebugBreak();
1557 1554
1558 case Code::KEYED_STORE_IC: 1555 case Code::KEYED_STORE_IC:
1559 return Isolate::Current()->builtins()->KeyedStoreIC_DebugBreak(); 1556 return isolate->builtins()->KeyedStoreIC_DebugBreak();
1560 1557
1561 default: 1558 default:
1562 UNREACHABLE(); 1559 UNREACHABLE();
1563 } 1560 }
1564 } 1561 }
1565 if (RelocInfo::IsConstructCall(mode)) { 1562 if (RelocInfo::IsConstructCall(mode)) {
1566 Handle<Code> result = 1563 if (code->has_function_cache()) {
1567 Isolate::Current()->builtins()->ConstructCall_DebugBreak(); 1564 return isolate->builtins()->CallConstructStub_Recording_DebugBreak();
1568 return result; 1565 } else {
1566 return isolate->builtins()->CallConstructStub_DebugBreak();
1567 }
1569 } 1568 }
1570 if (code->kind() == Code::STUB) { 1569 if (code->kind() == Code::STUB) {
1571 ASSERT(code->major_key() == CodeStub::CallFunction); 1570 ASSERT(code->major_key() == CodeStub::CallFunction);
1572 Handle<Code> result = 1571 if (code->has_function_cache()) {
1573 Isolate::Current()->builtins()->CallFunctionStub_DebugBreak(); 1572 return isolate->builtins()->CallFunctionStub_Recording_DebugBreak();
1574 return result; 1573 } else {
1574 return isolate->builtins()->CallFunctionStub_DebugBreak();
1575 }
1575 } 1576 }
1576 1577
1577 UNREACHABLE(); 1578 UNREACHABLE();
1578 return Handle<Code>::null(); 1579 return Handle<Code>::null();
1579 } 1580 }
1580 1581
1581 1582
1582 // Simple function for returning the source positions for active break points. 1583 // Simple function for returning the source positions for active break points.
1583 Handle<Object> Debug::GetSourceBreakLocations( 1584 Handle<Object> Debug::GetSourceBreakLocations(
1584 Handle<SharedFunctionInfo> shared) { 1585 Handle<SharedFunctionInfo> shared) {
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
3551 { 3552 {
3552 Locker locker; 3553 Locker locker;
3553 Isolate::Current()->debugger()->CallMessageDispatchHandler(); 3554 Isolate::Current()->debugger()->CallMessageDispatchHandler();
3554 } 3555 }
3555 } 3556 }
3556 } 3557 }
3557 3558
3558 #endif // ENABLE_DEBUGGER_SUPPORT 3559 #endif // ENABLE_DEBUGGER_SUPPORT
3559 3560
3560 } } // namespace v8::internal 3561 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.h ('k') | src/ia32/debug-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698