Home | History | Annotate | Download | only in src

Lines Matching defs:code

6 //     * Redistributions of source code must retain the above copyright
33 #include "code-stubs.h"
65 static Handle<Code> ComputeCallDebugBreak(int argc) {
66 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugBreak(argc), Code);
70 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc) {
71 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugPrepareStepIn(argc), Code);
97 // Iterate through reloc info for code and original code stopping at each
98 // breakable code target.
120 // Check for breakable code target. Look in the original code as setting
121 // break points can cause the code targets in the running (debugged) code to
122 // be of a different kind than in the original code.
125 Code* code = Code::GetCodeFromTargetAddress(target);
126 if (code->is_inline_cache_stub() || RelocInfo::IsConstructCall(rmode())) {
130 if (code->kind() == Code::STUB) {
136 if (Debug::IsBreakStub(code)) {
142 if (Debug::IsSourceBreakStub(code)) {
222 // Create relocation iterators for the two code objects.
225 reloc_iterator_ = new RelocIterator(debug_info_->code());
242 // If there is not already a real break point here patch code with debug
278 // Patch code with debug break.
295 // Patch code removing debug break.
308 // the same code is flooded with break points twice. Flooding the same
316 // Patch the frame exit code with a break point.
333 // Restore the frame exit code.
349 Handle<Code> code(Code::GetCodeFromTargetAddress(target));
350 if (code->is_call_stub()) {
353 // called. If the executing code has a debug break at the location change
354 // the call in the original code as it is the code there that will be
356 Handle<Code> stub = ComputeCallDebugPrepareStepIn(code->arguments_count());
364 // All the following stuff is needed only for assertion checks so the code
366 Handle<Code> maybe_call_function_stub = code;
370 Handle<Code>(Code::GetCodeFromTargetAddress(original_target));
373 (maybe_call_function_stub->kind() == Code::STUB &&
376 // Step in through construct call requires no changes to the running code.
383 ASSERT(RelocInfo::IsConstructCall(rmode()) || code->is_inline_cache_stub()
412 // Patch the original code with the current address as the current address
413 // might have changed by the inline caching since the code was copied.
419 Handle<Code> code(Code::GetCodeFromTargetAddress(target));
421 // Patch the code to invoke the builtin debug break function matching the
423 Handle<Code> dbgbrk_code(Debug::FindDebugBreak(code, mode));
429 // the code copy and will therefore have no effect on the running code
430 // keeping it from using the inlined code.
431 if (code->is_keyed_load_stub()) KeyedLoadIC::ClearInlinedVersion(pc());
432 if (code->is_keyed_store_stub()) KeyedStoreIC::ClearInlinedVersion(pc());
438 // Patch the code to the original invoke.
444 Handle<Code> code(Code::GetCodeFromTargetAddress(target));
451 if (code->is_keyed_store_stub()) KeyedStoreIC::RestoreInlinedVersion(pc());
466 // Clear out all the debug break code. This is ONLY supposed to be used when
468 // DebugInfo even though the code is patched back to the non break point state.
555 Code* Debug::debug_break_return_ = NULL;
635 // Get code to handle debug break on return.
732 // JavaScript source code for the debugger.
738 // debugger scripts including the context creation code.
802 v->VisitPointer(bit_cast<Object**, Code**>(&(debug_break_return_)));
1038 // Remove all debug break code.
1157 Handle<Code> call_function_stub;
1160 Code* code = Code::GetCodeFromTargetAddress(target);
1161 if (code->is_call_stub()) {
1164 if (code->is_inline_cache_stub()) {
1169 // Check if target code is CallFunction stub.
1170 Code* maybe_call_function_stub = code;
1171 // If there is a breakpoint at this line look at the original code to
1176 Code::GetCodeFromTargetAddress(original_target);
1178 if (maybe_call_function_stub->kind() == Code::STUB &&
1180 // Save reference to the code as we may need it to find out arguments
1182 call_function_stub = Handle<Code>(maybe_call_function_stub);
1186 // If this is the last break code target step out is the only possibility.
1221 debug_info->code()->SourceStatementPosition(frame->pc());
1229 // from the code object.
1277 debug_info->code()->SourceStatementPosition(frame->pc());
1291 // there will be several break points in the same statement when the code is
1305 break_location_iterator->code()->SourceStatementPosition(frame->pc());
1315 // Check whether the code object at the specified address is a debug break code
1318 Code* code = Code::GetCodeFromTargetAddress(addr);
1319 return code->ic_state() == DEBUG_BREAK;
1323 // Check whether a code stub with the specified major key is a possible break
1325 bool Debug::IsSourceBreakStub(Code* code) {
1326 CodeStub::Major major_key = code->major_key();
1331 // Check whether a code stub with the specified major key is a possible break
1333 bool Debug::IsBreakStub(Code* code) {
1334 CodeStub::Major major_key = code->major_key();
1341 Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
1344 if (code->is_inline_cache_stub()) {
1345 if (code->is_call_stub()) {
1346 return ComputeCallDebugBreak(code->arguments_count());
1348 if (code->is_load_stub()) {
1349 return Handle<Code>(Builtins::builtin(Builtins::LoadIC_DebugBreak));
1351 if (code->is_store_stub()) {
1352 return Handle<Code>(Builtins::builtin(Builtins::StoreIC_DebugBreak));
1354 if (code->is_keyed_load_stub()) {
1355 Handle<Code> result =
1356 Handle<Code>(Builtins::builtin(Builtins::KeyedLoadIC_DebugBreak));
1359 if (code->is_keyed_store_stub()) {
1360 Handle<Code> result =
1361 Handle<Code>(Builtins::builtin(Builtins::KeyedStoreIC_DebugBreak));
1366 Handle<Code> result =
1367 Handle<Code>(Builtins::builtin(Builtins::ConstructCall_DebugBreak));
1370 if (code->kind() == Code::STUB) {
1371 ASSERT(code->major_key() == CodeStub::CallFunction ||
1372 code->major_key() == CodeStub::StackCheck);
1373 Handle<Code> result =
1374 Handle<Code>(Builtins::builtin(Builtins::StubNoRegisters_DebugBreak));
1379 return Handle<Code>::null();
1441 if (function->shared()->code() ==
1443 function->shared()->code() ==
1446 // function to be called and not the code for Builtins::FunctionApply or
1587 Handle<Code> code(debug_info->code());
1588 Handle<Code> original_code(debug_info->original_code());
1590 // Get the code which is actually executing.
1591 Handle<Code> frame_code(frame->code());
1592 ASSERT(frame_code.is_identical_to(code));
1595 // Find the call address in the running code. This address holds the call to
1596 // either a DebugBreakXXX or to the debug break return entry code if the
1603 RelocIterator it(debug_info->code());
1617 // place in the original code. If not the break point was removed during
1620 addr += original_code->instruction_start() - code->instruction_start();
1629 // disappeared don't try to look in the original code as the running code
1631 // break point is removed from the function and therefore no "original code"
1633 // the original code.
1636 // overwritten in the original code by the call to DebugBreakXXX.
1638 // Find the corresponding address in the original code.
1639 addr += original_code->instruction_start() - code->instruction_start();
1642 // Install jump to the call address in the original code. This will be the