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"
86 static Handle<Code> ComputeCallDebugBreak(int argc, Code::Kind kind) {
91 Code);
95 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind) {
100 Code);
136 // Iterate through reloc info for code and original code stopping at each
137 // breakable code target.
164 // Check for breakable code target. Look in the original code as setting
165 // break points can cause the code targets in the running (debugged) code
166 // to be of a different kind than in the original code.
168 Code* code = Code::GetCodeFromTargetAddress(target);
169 if ((code->is_inline_cache_stub() &&
170 !code->is_type_recording_binary_op_stub() &&
171 !code->is_compare_ic_stub()) ||
176 if (code->kind() == Code::STUB) {
182 if (Debug::IsBreakStub(code)) {
188 if (Debug::IsSourceBreakStub(code)) {
268 // Create relocation iterators for the two code objects.
271 reloc_iterator_ = new RelocIterator(debug_info_->code());
288 // If there is not already a real break point here patch code with debug
324 // Patch code with debug break.
341 // Patch code removing debug break.
354 // the same code is flooded with break points twice. Flooding the same
362 // Patch the frame exit code with a break point.
365 // Patch the code in the break slot.
382 // Restore the frame exit code.
385 // Restore the code in the break slot.
401 Handle<Code> code(Code::GetCodeFromTargetAddress(target));
402 if (code->is_call_stub() || code->is_keyed_call_stub()) {
405 // called. If the executing code has a debug break at the location change
406 // the call in the original code as it is the code there that will be
408 Handle<Code> stub = ComputeCallDebugPrepareStepIn(code->arguments_count(),
409 code->kind());
417 // All the following stuff is needed only for assertion checks so the code
419 Handle<Code> maybe_call_function_stub = code;
423 Handle<Code>(Code::GetCodeFromTargetAddress(original_target));
426 (maybe_call_function_stub->kind() == Code::STUB &&
429 // Step in through construct call requires no changes to the running code.
436 ASSERT(RelocInfo::IsConstructCall(rmode()) || code->is_inline_cache_stub()
467 // Patch the original code with the current address as the current address
468 // might have changed by the inline caching since the code was copied.
474 Handle<Code> code(Code::GetCodeFromTargetAddress(target));
476 // Patch the code to invoke the builtin debug break function matching the
478 Handle<Code> dbgbrk_code(Debug::FindDebugBreak(code, mode));
484 // the code copy and will therefore have no effect on the running code
485 // keeping it from using the inlined code.
486 if (code->is_keyed_load_stub()) {
488 } else if (code->is_keyed_store_stub()) {
490 } else if (code->is_load_stub()) {
492 } else if (code->is_store_stub()) {
500 // Patch the code to the original invoke.
507 Code* code = Code::GetCodeFromTargetAddress(target);
514 if (code->is_keyed_store_stub()) KeyedStoreIC::RestoreInlinedVersion(pc());
534 // Clear out all the debug break code. This is ONLY supposed to be used when
536 // DebugInfo even though the code is patched back to the non break point state.
609 // -- code
614 Handle<Code> code) {
623 Memory::Object_at(fp + InternalFrameConstants::kCodeOffset) = *code;
717 // Get code to handle debug break on return.
721 // Get code to handle debug break in debug break slots.
733 // original code and avoid patching the code twice later because
831 // JavaScript source code for the debugger.
838 // debugger scripts including the context creation code.
1007 Code* plain_return = isolate_->builtins()->builtin(
1014 Code* plain_return = isolate_->builtins()->builtin(
1190 // Remove all debug break code.
1319 Handle<Code> call_function_stub;
1325 Code* code = Code::GetCodeFromTargetAddress(target);
1326 if (code->is_call_stub() || code->is_keyed_call_stub()) {
1329 if (code->is_inline_cache_stub()) {
1334 // Check if target code is CallFunction stub.
1335 Code* maybe_call_function_stub = code;
1336 // If there is a breakpoint at this line look at the original code to
1341 Code::GetCodeFromTargetAddress(original_target);
1343 if (maybe_call_function_stub->kind() == Code::STUB &&
1345 // Save reference to the code as we may need it to find out arguments
1347 call_function_stub = Handle<Code>(maybe_call_function_stub);
1354 // If this is the last break code target step out is the only possibility.
1389 debug_info->code()->SourceStatementPosition(frame->pc());
1406 // from the code object.
1456 debug_info->code()->SourceStatementPosition(frame->pc());
1470 // there will be several break points in the same statement when the code is
1484 break_location_iterator->code()->SourceStatementPosition(frame->pc());
1494 // Check whether the code object at the specified address is a debug break code
1497 Code* code = Code::GetCodeFromTargetAddress(addr);
1498 return code->ic_state() == DEBUG_BREAK;
1502 // Check whether a code stub with the specified major key is a possible break
1504 bool Debug::IsSourceBreakStub(Code* code) {
1505 CodeStub::Major major_key = CodeStub::GetMajorKey(code);
1510 // Check whether a code stub with the specified major key is a possible break
1512 bool Debug::IsBreakStub(Code* code) {
1513 CodeStub::Major major_key = CodeStub::GetMajorKey(code);
1519 Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
1522 if (code->is_inline_cache_stub()) {
1523 switch (code->kind()) {
1524 case Code::CALL_IC:
1525 case Code::KEYED_CALL_IC:
1526 return ComputeCallDebugBreak(code->arguments_count(), code->kind());
1528 case Code::LOAD_IC:
1531 case Code::STORE_IC:
1534 case Code::KEYED_LOAD_IC:
1537 case Code::KEYED_STORE_IC:
1545 Handle<Code> result =
1549 if (code->kind() == Code::STUB) {
1550 ASSERT(code->major_key() == CodeStub::CallFunction);
1551 Handle<Code> result =
1557 return Handle<Code>::null();
1621 if (function->shared()->code() ==
1623 function->shared()->code() ==
1626 // function to be called and not the code for Builtins::FunctionApply or
1712 // functions as debugging does not work with optimized code.
1775 Handle<Code> code(debug_info->code());
1776 Handle<Code> original_code(debug_info->original_code());
1778 // Get the code which is actually executing.
1779 Handle<Code> frame_code(frame->LookupCode());
1780 ASSERT(frame_code.is_identical_to(code));
1783 // Find the call address in the running code. This address holds the call to
1784 // either a DebugBreakXXX or to the debug break return entry code if the
1792 RelocIterator it(debug_info->code());
1810 // place in the original code. If not the break point was removed during
1813 addr += original_code->instruction_start() - code->instruction_start();
1827 // so the break point is still there and the original code will hold the
1831 // Find the corresponding address in the original code.
1832 addr += original_code->instruction_start() - code->instruction_start();
1834 // Install jump to the call address in the original code. This will be the
1839 // original code as the running code will have the right address. This takes
1841 // and therefore no "original code" is available.
1858 Handle<Code> code(debug_info->code());
1860 // Get the code which is actually executing.
1861 Handle<Code> frame_code(frame->LookupCode());
1862 ASSERT(frame_code.is_identical_to(code));
1865 // Find the call address in the running code.
1869 RelocIterator it(debug_info->code());