Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 17 matching lines...) Expand all Loading... | |
| 28 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 28 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | 30 |
| 31 // The original source code covered by the above license above has been | 31 // The original source code covered by the above license above has been |
| 32 // modified significantly by Google Inc. | 32 // modified significantly by Google Inc. |
| 33 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 33 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 34 | 34 |
| 35 #ifndef V8_ASSEMBLER_H_ | 35 #ifndef V8_ASSEMBLER_H_ |
| 36 #define V8_ASSEMBLER_H_ | 36 #define V8_ASSEMBLER_H_ |
| 37 | 37 |
| 38 #include "gdbjit.h" | |
|
Erik Corry
2011/01/05 09:00:15
The files should really be called gdb-jit.*
Vyacheslav Egorov (Chromium)
2011/01/18 16:10:42
Done.
| |
| 38 #include "runtime.h" | 39 #include "runtime.h" |
| 39 #include "top.h" | 40 #include "top.h" |
| 40 #include "token.h" | 41 #include "token.h" |
| 41 | 42 |
| 42 namespace v8 { | 43 namespace v8 { |
| 43 namespace internal { | 44 namespace internal { |
| 44 | 45 |
| 45 | 46 |
| 46 // ----------------------------------------------------------------------------- | 47 // ----------------------------------------------------------------------------- |
| 47 // Common double constants. | 48 // Common double constants. |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 625 int written_position; | 626 int written_position; |
| 626 | 627 |
| 627 int current_statement_position; | 628 int current_statement_position; |
| 628 int written_statement_position; | 629 int written_statement_position; |
| 629 }; | 630 }; |
| 630 | 631 |
| 631 | 632 |
| 632 class PositionsRecorder BASE_EMBEDDED { | 633 class PositionsRecorder BASE_EMBEDDED { |
| 633 public: | 634 public: |
| 634 explicit PositionsRecorder(Assembler* assembler) | 635 explicit PositionsRecorder(Assembler* assembler) |
| 635 : assembler_(assembler) {} | 636 : assembler_(assembler) { |
| 637 #ifdef ENABLE_GDBJIT_INTERFACE | |
|
Erik Corry
2011/01/05 09:00:15
and the macro should really be called ENABLE_GDB_J
Vyacheslav Egorov (Chromium)
2011/01/18 16:10:42
Done.
| |
| 638 gdbjit_lineinfo_ = NULL; | |
| 639 #endif | |
| 640 } | |
| 641 | |
| 642 #ifdef ENABLE_GDBJIT_INTERFACE | |
| 643 ~PositionsRecorder() { | |
| 644 delete gdbjit_lineinfo_; | |
| 645 } | |
| 646 | |
| 647 void StartGDBJITLineInfoRecording() { | |
| 648 if (FLAG_gdbjit) { | |
| 649 gdbjit_lineinfo_ = new GDBJITLineInfo(); | |
| 650 } | |
| 651 } | |
| 652 | |
| 653 GDBJITLineInfo* DetachGDBJITLineInfo() { | |
| 654 GDBJITLineInfo* lineinfo = gdbjit_lineinfo_; | |
| 655 gdbjit_lineinfo_ = NULL; // To prevent deallocation in destructor. | |
| 656 return lineinfo; | |
| 657 } | |
| 658 #endif | |
| 636 | 659 |
| 637 // Set current position to pos. | 660 // Set current position to pos. |
| 638 void RecordPosition(int pos); | 661 void RecordPosition(int pos); |
| 639 | 662 |
| 640 // Set current statement position to pos. | 663 // Set current statement position to pos. |
| 641 void RecordStatementPosition(int pos); | 664 void RecordStatementPosition(int pos); |
| 642 | 665 |
| 643 // Write recorded positions to relocation information. | 666 // Write recorded positions to relocation information. |
| 644 bool WriteRecordedPositions(); | 667 bool WriteRecordedPositions(); |
| 645 | 668 |
| 646 int current_position() const { return state_.current_position; } | 669 int current_position() const { return state_.current_position; } |
| 647 | 670 |
| 648 int current_statement_position() const { | 671 int current_statement_position() const { |
| 649 return state_.current_statement_position; | 672 return state_.current_statement_position; |
| 650 } | 673 } |
| 651 | 674 |
| 652 private: | 675 private: |
| 653 Assembler* assembler_; | 676 Assembler* assembler_; |
| 654 PositionState state_; | 677 PositionState state_; |
| 678 #ifdef ENABLE_GDBJIT_INTERFACE | |
| 679 GDBJITLineInfo* gdbjit_lineinfo_; | |
| 680 #endif | |
| 655 | 681 |
| 656 friend class PreservePositionScope; | 682 friend class PreservePositionScope; |
| 657 | 683 |
| 658 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); | 684 DISALLOW_COPY_AND_ASSIGN(PositionsRecorder); |
| 659 }; | 685 }; |
| 660 | 686 |
| 661 | 687 |
| 662 class PreservePositionScope BASE_EMBEDDED { | 688 class PreservePositionScope BASE_EMBEDDED { |
| 663 public: | 689 public: |
| 664 explicit PreservePositionScope(PositionsRecorder* positions_recorder) | 690 explicit PreservePositionScope(PositionsRecorder* positions_recorder) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 714 return num_bits_set; | 740 return num_bits_set; |
| 715 } | 741 } |
| 716 | 742 |
| 717 // Computes pow(x, y) with the special cases in the spec for Math.pow. | 743 // Computes pow(x, y) with the special cases in the spec for Math.pow. |
| 718 double power_double_int(double x, int y); | 744 double power_double_int(double x, int y); |
| 719 double power_double_double(double x, double y); | 745 double power_double_double(double x, double y); |
| 720 | 746 |
| 721 } } // namespace v8::internal | 747 } } // namespace v8::internal |
| 722 | 748 |
| 723 #endif // V8_ASSEMBLER_H_ | 749 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |