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 | 5 |
6 #include "v8.h" | 6 #include "v8.h" |
7 | 7 |
8 #include "liveedit.h" | 8 #include "liveedit.h" |
9 | 9 |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 | 798 |
799 return scope_info_list; | 799 return scope_info_list; |
800 } | 800 } |
801 | 801 |
802 Handle<JSArray> result_; | 802 Handle<JSArray> result_; |
803 int len_; | 803 int len_; |
804 int current_parent_index_; | 804 int current_parent_index_; |
805 }; | 805 }; |
806 | 806 |
807 | 807 |
| 808 Address LiveEdit::AfterBreakTarget(FrameDropMode mode, Isolate* isolate) { |
| 809 Code* code = NULL; |
| 810 switch (mode) { |
| 811 case FRAMES_UNTOUCHED: |
| 812 break; |
| 813 case FRAME_DROPPED_IN_IC_CALL: |
| 814 // We must have been calling IC stub. Do not go there anymore. |
| 815 code = isolate->builtins()->builtin(Builtins::kPlainReturn_LiveEdit); |
| 816 break; |
| 817 case FRAME_DROPPED_IN_DEBUG_SLOT_CALL: |
| 818 // Debug break slot stub does not return normally, instead it manually |
| 819 // cleans the stack and jumps. We should patch the jump address. |
| 820 code = isolate->builtins()->builtin(Builtins::kFrameDropper_LiveEdit); |
| 821 break; |
| 822 case FRAME_DROPPED_IN_DIRECT_CALL: |
| 823 // Nothing to do, after_break_target is not used here. |
| 824 break; |
| 825 case FRAME_DROPPED_IN_RETURN_CALL: |
| 826 code = isolate->builtins()->builtin(Builtins::kFrameDropper_LiveEdit); |
| 827 break; |
| 828 case CURRENTLY_SET_MODE: |
| 829 UNREACHABLE(); |
| 830 break; |
| 831 } |
| 832 if (code == NULL) return NULL; |
| 833 return code->entry(); |
| 834 } |
| 835 |
| 836 |
808 MaybeHandle<JSArray> LiveEdit::GatherCompileInfo(Handle<Script> script, | 837 MaybeHandle<JSArray> LiveEdit::GatherCompileInfo(Handle<Script> script, |
809 Handle<String> source) { | 838 Handle<String> source) { |
810 Isolate* isolate = script->GetIsolate(); | 839 Isolate* isolate = script->GetIsolate(); |
811 | 840 |
812 FunctionInfoListener listener(isolate); | 841 FunctionInfoListener listener(isolate); |
813 Handle<Object> original_source = | 842 Handle<Object> original_source = |
814 Handle<Object>(script->source(), isolate); | 843 Handle<Object>(script->source(), isolate); |
815 script->set_source(*source); | 844 script->set_source(*source); |
816 isolate->set_active_function_info_listener(&listener); | 845 isolate->set_active_function_info_listener(&listener); |
817 | 846 |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2045 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) { | 2074 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) { |
2046 isolate_->active_function_info_listener()->FunctionCode(code); | 2075 isolate_->active_function_info_listener()->FunctionCode(code); |
2047 } | 2076 } |
2048 | 2077 |
2049 | 2078 |
2050 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 2079 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
2051 return isolate->active_function_info_listener() != NULL; | 2080 return isolate->active_function_info_listener() != NULL; |
2052 } | 2081 } |
2053 | 2082 |
2054 } } // namespace v8::internal | 2083 } } // namespace v8::internal |
OLD | NEW |