Home | History | Annotate | Download | only in src

Lines Matching refs:Code

6 //     * Redistributions of source code must retain the above copyright
33 #include "code-stubs.h"
89 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc, Code::Kind kind) {
127 // Iterate through reloc info for code and original code stopping at each
128 // breakable code target.
155 // Check for breakable code target. Look in the original code as setting
156 // break points can cause the code targets in the running (debugged) code
157 // to be of a different kind than in the original code.
159 Code* code = Code::GetCodeFromTargetAddress(target);
160 if ((code->is_inline_cache_stub() &&
161 !code->is_binary_op_stub() &&
162 !code->is_unary_op_stub() &&
163 !code->is_compare_ic_stub() &&
164 !code->is_to_boolean_ic_stub()) ||
169 if (code->kind() == Code::STUB) {
175 if (Debug::IsBreakStub(code)) {
181 if (Debug::IsSourceBreakStub(code)) {
261 // Create relocation iterators for the two code objects.
264 reloc_iterator_ = new RelocIterator(debug_info_->code());
281 // If there is not already a real break point here patch code with debug
317 // Patch code with debug break.
334 // Patch code removing debug break.
347 // the same code is flooded with break points twice. Flooding the same
355 // Patch the frame exit code with a break point.
358 // Patch the code in the break slot.
375 // Restore the frame exit code.
378 // Restore the code in the break slot.
394 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
398 // called. If the executing code has a debug break at the location change
399 // the call in the original code as it is the code there that will be
401 Handle<Code> stub = ComputeCallDebugPrepareStepIn(
410 // All the following stuff is needed only for assertion checks so the code
412 Handle<Code> maybe_call_function_stub = target_code;
416 Handle<Code>(Code::GetCodeFromTargetAddress(original_target));
419 (maybe_call_function_stub->kind() == Code::STUB &&
422 // Step in through construct call requires no changes to the running code.
461 // Patch the original code with the current address as the current address
462 // might have changed by the inline caching since the code was copied.
468 Handle<Code> target_code(Code::GetCodeFromTargetAddress(target));
470 // Patch the code to invoke the builtin debug break function matching the
472 Handle<Code> dbgbrk_code(Debug::FindDebugBreak(target_code, mode));
479 // Patch the code to the original invoke.
499 // Clear out all the debug break code. This is ONLY supposed to be used when
501 // DebugInfo even though the code is patched back to the non break point state.
575 // -- code
580 Handle<Code> code) {
589 Memory::Object_at(fp + InternalFrameConstants::kCodeOffset) = *code;
683 // Get code to handle debug break on return.
687 // Get code to handle debug break in debug break slots.
699 // original code and avoid patching the code twice later because
803 // JavaScript source code for the debugger.
810 // debugger scripts including the context creation code.
981 // If StepNext goes deeper in code, StepOut until original frame
1018 Code
1025 Code* plain_return = isolate_->builtins()->builtin(
1033 Code* plain_return = isolate_->builtins()->builtin(
1206 // Remove all debug break code.
1350 Handle<Code> call_function_stub;
1356 Code* code = Code::GetCodeFromTargetAddress(target);
1357 if (code->is_call_stub() || code->is_keyed_call_stub()) {
1360 if (code->is_inline_cache_stub()) {
1365 // Check if target code is CallFunction stub.
1366 Code* maybe_call_function_stub = code;
1367 // If there is a breakpoint at this line look at the original code to
1372 Code::GetCodeFromTargetAddress(original_target);
1374 if (maybe_call_function_stub->kind() == Code::STUB &&
1376 // Save reference to the code as we may need it to find out arguments
1378 call_function_stub = Handle<Code>(maybe_call_function_stub);
1385 // If this is the last break code target step out is the only possibility.
1420 debug_info->code()->SourceStatementPosition(frame->pc());
1437 // from the code object.
1489 debug_info->code()->SourceStatementPosition(frame->pc());
1503 // there will be several break points in the same statement when the code is
1508 // StepNext and StepOut shouldn't bring us deeper in code, so last frame
1524 break_location_iterator->code()->SourceStatementPosition(frame->pc());
1534 // Check whether the code object at the specified address is a debug break code
1537 Code* code = Code::GetCodeFromTargetAddress(addr);
1538 return code->ic_state() == DEBUG_BREAK;
1542 // Check whether a code stub with the specified major key is a possible break
1544 bool Debug::IsSourceBreakStub(Code* code) {
1545 CodeStub::Major major_key = CodeStub::GetMajorKey(code);
1550 // Check whether a code stub with the specified major key is a possible break
1552 bool Debug::IsBreakStub(Code* code) {
1553 CodeStub::Major major_key = CodeStub::GetMajorKey(code);
1559 Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
1564 if (code->is_inline_cache_stub()) {
1565 switch (code->kind()) {
1566 case Code::CALL_IC:
1567 case Code::KEYED_CALL_IC:
1569 code->arguments_count(), code->kind());
1571 case Code::LOAD_IC:
1574 case Code::STORE_IC:
1577 case Code::KEYED_LOAD_IC:
1580 case Code::KEYED_STORE_IC:
1588 if (code->has_function_cache()) {
1594 if (code->kind() == Code::STUB) {
1595 ASSERT(code->major_key() == CodeStub::CallFunction);
1596 if (code->has_function_cache()) {
1604 return Handle<Code>::null();
1671 if (function->shared()->code() ==
1673 function->shared()->code() ==
1676 // function to be called and not the code for Builtins::FunctionApply or
1753 // Helper function to compile full code for debugging. This code will
1757 // stack. It will also make sure that the full code is compiled with
1759 // change the code generated. The current method of mapping from
1760 // already compiled full code without debug break slots to full code
1761 // with debug break slots depends on the generated code is otherwise
1764 Handle<Code> current_code) {
1772 // Use compile lazy which will end up compiling the full code in the
1779 Handle<Code> new_code(shared->code());
1794 // Find all non-optimized code functions with activation frames
1797 // non-optimized code is needed for the lazy deoptimization.
1806 function->shared()->code()->set_gc_metadata(active_code_marker);
1810 ASSERT(frame->LookupCode()->kind() == Code::FUNCTION);
1812 function->shared()->code()->set_gc_metadata(active_code_marker);
1828 ASSERT(frame->LookupCode()->kind() == Code::FUNCTION);
1830 Handle<Code> frame_code(frame->LookupCode());
1833 Handle<Code> new_code(function->shared()->code());
1834 if (new_code->kind() != Code::FUNCTION ||
1843 // Check if the pc in the new code with debug break
1856 // Passed a debug break slot in the full code with debug
1870 PrintF("Replacing code %08" V8PRIxPTR " - %08" V8PRIxPTR " (%d) "
1889 // Patch the return address to return into the code with
1927 // functions as debugging does not work with optimized code.
1931 Handle<Code> lazy_compile =
1932 Handle<Code>(isolate_->builtins()->builtin(Builtins::kLazyCompile));
1935 // is used both in GC and non-GC code.
1945 // field in the Code object to mark active functions.
1970 function->code()->kind() == Code::FUNCTION &&
1971 !function->code()->has_debug_break_slots() &&
1972 shared->code()->gc_metadata() != active_code_marker) {
1982 function->shared()->code()->set_gc_metadata(Smi::FromInt(0));
1987 // patch the return address to run in the new compiled code.
1991 if (function->code()->kind() == Code::FUNCTION &&
1992 function->code()->has_debug_break_slots()) {
1993 // Nothing to do. Function code already had debug break slots.
2001 shared->code()->kind() == Code::BUILTIN) {
2005 // Make sure that the shared full code is compiled with debug
2007 if (!shared->code()->has_debug_break_slots()) {
2008 // Try to compile the full code with debug break slots. If it
2009 // fails just keep the current code.
2010 Handle<Code> current_code(function->shared()->code());
2016 ASSERT(current_code->kind() == Code::FUNCTION);
2026 // Keep function code in sync with shared function info.
2027 function->set_code(shared->code());
2112 Handle<Code> code(debug_info->code());
2113 Handle<Code> original_code(debug_info->original_code());
2115 // Get the code which is actually executing.
2116 Handle<Code> frame_code(frame->LookupCode());
2117 ASSERT(frame_code.is_identical_to(code));
2120 // Find the call address in the running code. This address holds the call to
2121 // either a DebugBreakXXX or to the debug break return entry code if the
2129 RelocIterator it(debug_info->code());
2147 // place in the original code. If not the break point was removed during
2150 addr += original_code->instruction_start() - code->instruction_start();
2164 // so the break point is still there and the original code will hold the
2168 // Find the corresponding address in the original code.
2169 addr += original_code->instruction_start() - code->instruction_start();
2171 // Install jump to the call address in the original code. This will be the
2176 // original code as the running code will have the right address. This takes
2178 // and therefore no "original code" is available.
2204 Handle<Code> code(debug_info->code());
2206 // Get the code which is actually executing.
2207 Handle<Code> frame_code(frame->LookupCode());
2208 ASSERT(frame_code.is_identical_to(code));
2211 // Find the call address in the running code.
2215 RelocIterator it(debug_info->code());
3256 // case the exception should end up in the calling code.
3259 // cache JavaScript code.