| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_DEBUG_H_ | 5 #ifndef V8_DEBUG_H_ |
| 6 #define V8_DEBUG_H_ | 6 #define V8_DEBUG_H_ |
| 7 | 7 |
| 8 #include "allocation.h" | 8 #include "allocation.h" |
| 9 #include "arguments.h" | 9 #include "arguments.h" |
| 10 #include "assembler.h" | 10 #include "assembler.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 bool break_on_uncaught_exception() { | 335 bool break_on_uncaught_exception() { |
| 336 return break_on_uncaught_exception_; | 336 return break_on_uncaught_exception_; |
| 337 } | 337 } |
| 338 | 338 |
| 339 enum AddressId { | 339 enum AddressId { |
| 340 k_after_break_target_address, | 340 k_after_break_target_address, |
| 341 k_restarter_frame_function_pointer | 341 k_restarter_frame_function_pointer |
| 342 }; | 342 }; |
| 343 | 343 |
| 344 // Support for setting the address to jump to when returning from break point. | 344 // Support for setting the address to jump to when returning from break point. |
| 345 Address* after_break_target_address() { | 345 Address after_break_target_address() { |
| 346 return reinterpret_cast<Address*>(&thread_local_.after_break_target_); | 346 return reinterpret_cast<Address>(&thread_local_.after_break_target_); |
| 347 } | 347 } |
| 348 Address* restarter_frame_function_pointer_address() { | 348 |
| 349 Address restarter_frame_function_pointer_address() { |
| 349 Object*** address = &thread_local_.restarter_frame_function_pointer_; | 350 Object*** address = &thread_local_.restarter_frame_function_pointer_; |
| 350 return reinterpret_cast<Address*>(address); | 351 return reinterpret_cast<Address>(address); |
| 351 } | 352 } |
| 352 | 353 |
| 353 // Support for saving/restoring registers when handling debug break calls. | 354 // Support for saving/restoring registers when handling debug break calls. |
| 354 Object** register_address(int r) { | 355 Object** register_address(int r) { |
| 355 return ®isters_[r]; | 356 return ®isters_[r]; |
| 356 } | 357 } |
| 357 | 358 |
| 358 static const int kEstimatedNofDebugInfoEntries = 16; | 359 static const int kEstimatedNofDebugInfoEntries = 16; |
| 359 static const int kEstimatedNofBreakPointsInFunction = 16; | 360 static const int kEstimatedNofBreakPointsInFunction = 16; |
| 360 | 361 |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 isolate_->debug()->set_disable_break(prev_disable_break_); | 912 isolate_->debug()->set_disable_break(prev_disable_break_); |
| 912 } | 913 } |
| 913 | 914 |
| 914 private: | 915 private: |
| 915 Isolate* isolate_; | 916 Isolate* isolate_; |
| 916 // The previous state of the disable break used to restore the value when this | 917 // The previous state of the disable break used to restore the value when this |
| 917 // object is destructed. | 918 // object is destructed. |
| 918 bool prev_disable_break_; | 919 bool prev_disable_break_; |
| 919 }; | 920 }; |
| 920 | 921 |
| 921 | |
| 922 // Debug_Address encapsulates the Address pointers used in generating debug | |
| 923 // code. | |
| 924 class Debug_Address { | |
| 925 public: | |
| 926 explicit Debug_Address(Debug::AddressId id) : id_(id) { } | |
| 927 | |
| 928 static Debug_Address AfterBreakTarget() { | |
| 929 return Debug_Address(Debug::k_after_break_target_address); | |
| 930 } | |
| 931 | |
| 932 static Debug_Address RestarterFrameFunctionPointer() { | |
| 933 return Debug_Address(Debug::k_restarter_frame_function_pointer); | |
| 934 } | |
| 935 | |
| 936 Address address(Isolate* isolate) const { | |
| 937 Debug* debug = isolate->debug(); | |
| 938 switch (id_) { | |
| 939 case Debug::k_after_break_target_address: | |
| 940 return reinterpret_cast<Address>(debug->after_break_target_address()); | |
| 941 case Debug::k_restarter_frame_function_pointer: | |
| 942 return reinterpret_cast<Address>( | |
| 943 debug->restarter_frame_function_pointer_address()); | |
| 944 default: | |
| 945 UNREACHABLE(); | |
| 946 return NULL; | |
| 947 } | |
| 948 } | |
| 949 | |
| 950 private: | |
| 951 Debug::AddressId id_; | |
| 952 }; | |
| 953 | |
| 954 } } // namespace v8::internal | 922 } } // namespace v8::internal |
| 955 | 923 |
| 956 #endif // V8_DEBUG_H_ | 924 #endif // V8_DEBUG_H_ |
| OLD | NEW |