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

Side by Side Diff: src/mips/assembler-mips.h

Issue 1234833003: Debugger: use debug break slots to break at function exit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix for arm Created 5 years, 5 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/liveedit.cc ('k') | src/mips/assembler-mips.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 ICacheFlushMode icache_flush_mode = 518 ICacheFlushMode icache_flush_mode =
519 FLUSH_ICACHE_IF_NEEDED)) { 519 FLUSH_ICACHE_IF_NEEDED)) {
520 Address constant_pool = code ? code->constant_pool() : NULL; 520 Address constant_pool = code ? code->constant_pool() : NULL;
521 set_target_address_at(pc, constant_pool, target, icache_flush_mode); 521 set_target_address_at(pc, constant_pool, target, icache_flush_mode);
522 } 522 }
523 523
524 // Return the code target address at a call site from the return address 524 // Return the code target address at a call site from the return address
525 // of that call in the instruction stream. 525 // of that call in the instruction stream.
526 inline static Address target_address_from_return_address(Address pc); 526 inline static Address target_address_from_return_address(Address pc);
527 527
528 // Return the code target address of the patch debug break slot
529 inline static Address break_address_from_return_address(Address pc);
530
531 static void JumpToJumpRegister(Address pc); 528 static void JumpToJumpRegister(Address pc);
532 529
533 static void QuietNaN(HeapObject* nan); 530 static void QuietNaN(HeapObject* nan);
534 531
535 // This sets the branch destination (which gets loaded at the call address). 532 // This sets the branch destination (which gets loaded at the call address).
536 // This is for calls and branches within generated code. The serializer 533 // This is for calls and branches within generated code. The serializer
537 // has already deserialized the lui/ori instructions etc. 534 // has already deserialized the lui/ori instructions etc.
538 inline static void deserialization_set_special_target_at( 535 inline static void deserialization_set_special_target_at(
539 Address instruction_payload, Code* code, Address target) { 536 Address instruction_payload, Code* code, Address target) {
540 set_target_address_at( 537 set_target_address_at(
(...skipping 27 matching lines...) Expand all
568 // the instruction that follows LUI/ORI instruction pair. Now, with new jump 565 // the instruction that follows LUI/ORI instruction pair. Now, with new jump
569 // optimization, where jump-through-register instruction that usually 566 // optimization, where jump-through-register instruction that usually
570 // follows LUI/ORI pair is substituted with J/JAL, this constant equals 567 // follows LUI/ORI pair is substituted with J/JAL, this constant equals
571 // to 3 instructions (LUI+ORI+J/JAL/JR/JALR). 568 // to 3 instructions (LUI+ORI+J/JAL/JR/JALR).
572 static const int kInstructionsFor32BitConstant = 3; 569 static const int kInstructionsFor32BitConstant = 3;
573 570
574 // Distance between the instruction referring to the address of the call 571 // Distance between the instruction referring to the address of the call
575 // target and the return address. 572 // target and the return address.
576 static const int kCallTargetAddressOffset = 4 * kInstrSize; 573 static const int kCallTargetAddressOffset = 4 * kInstrSize;
577 574
578 // Distance between start of patched return sequence and the emitted address
579 // to jump to.
580 static const int kPatchReturnSequenceAddressOffset = 0;
581
582 // Distance between start of patched debug break slot and the emitted address 575 // Distance between start of patched debug break slot and the emitted address
583 // to jump to. 576 // to jump to.
584 static const int kPatchDebugBreakSlotAddressOffset = 0 * kInstrSize; 577 static const int kPatchDebugBreakSlotAddressOffset = 4 * kInstrSize;
585 578
586 // Difference between address of current opcode and value read from pc 579 // Difference between address of current opcode and value read from pc
587 // register. 580 // register.
588 static const int kPcLoadDelta = 4; 581 static const int kPcLoadDelta = 4;
589 582
590 static const int kPatchDebugBreakSlotReturnOffset = 4 * kInstrSize;
591
592 // Number of instructions used for the JS return sequence. The constant is
593 // used by the debugger to patch the JS return sequence.
594 static const int kJSReturnSequenceInstructions = 7;
595 static const int kJSReturnSequenceLength =
596 kJSReturnSequenceInstructions * kInstrSize;
597 static const int kDebugBreakSlotInstructions = 4; 583 static const int kDebugBreakSlotInstructions = 4;
598 static const int kDebugBreakSlotLength = 584 static const int kDebugBreakSlotLength =
599 kDebugBreakSlotInstructions * kInstrSize; 585 kDebugBreakSlotInstructions * kInstrSize;
600 586
601 587
602 // --------------------------------------------------------------------------- 588 // ---------------------------------------------------------------------------
603 // Code generation. 589 // Code generation.
604 590
605 // Insert the smallest number of nop instructions 591 // Insert the smallest number of nop instructions
606 // possible to align the pc offset to a multiple 592 // possible to align the pc offset to a multiple
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 } 1037 }
1052 1038
1053 private: 1039 private:
1054 Assembler* assem_; 1040 Assembler* assem_;
1055 1041
1056 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockGrowBufferScope); 1042 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockGrowBufferScope);
1057 }; 1043 };
1058 1044
1059 // Debugging. 1045 // Debugging.
1060 1046
1061 // Mark address of the ExitJSFrame code.
1062 void RecordJSReturn();
1063
1064 // Mark generator continuation. 1047 // Mark generator continuation.
1065 void RecordGeneratorContinuation(); 1048 void RecordGeneratorContinuation();
1066 1049
1067 // Mark address of a debug break slot. 1050 // Mark address of a debug break slot.
1068 void RecordDebugBreakSlot(); 1051 void RecordDebugBreakSlot(RelocInfo::Mode mode, int argc = 0);
1069 void RecordDebugBreakSlotForCall(int argc);
1070 void RecordDebugBreakSlotForConstructCall();
1071 1052
1072 // Record the AST id of the CallIC being compiled, so that it can be placed 1053 // Record the AST id of the CallIC being compiled, so that it can be placed
1073 // in the relocation information. 1054 // in the relocation information.
1074 void SetRecordedAstId(TypeFeedbackId ast_id) { 1055 void SetRecordedAstId(TypeFeedbackId ast_id) {
1075 DCHECK(recorded_ast_id_.IsNone()); 1056 DCHECK(recorded_ast_id_.IsNone());
1076 recorded_ast_id_ = ast_id; 1057 recorded_ast_id_ = ast_id;
1077 } 1058 }
1078 1059
1079 TypeFeedbackId RecordedAstId() { 1060 TypeFeedbackId RecordedAstId() {
1080 DCHECK(!recorded_ast_id_.IsNone()); 1061 DCHECK(!recorded_ast_id_.IsNone());
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 class EnsureSpace BASE_EMBEDDED { 1445 class EnsureSpace BASE_EMBEDDED {
1465 public: 1446 public:
1466 explicit EnsureSpace(Assembler* assembler) { 1447 explicit EnsureSpace(Assembler* assembler) {
1467 assembler->CheckBuffer(); 1448 assembler->CheckBuffer();
1468 } 1449 }
1469 }; 1450 };
1470 1451
1471 } } // namespace v8::internal 1452 } } // namespace v8::internal
1472 1453
1473 #endif // V8_ARM_ASSEMBLER_MIPS_H_ 1454 #endif // V8_ARM_ASSEMBLER_MIPS_H_
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/mips/assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698