| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 | 807 |
| 808 Handle<JSArray> result_; | 808 Handle<JSArray> result_; |
| 809 int len_; | 809 int len_; |
| 810 int current_parent_index_; | 810 int current_parent_index_; |
| 811 }; | 811 }; |
| 812 | 812 |
| 813 | 813 |
| 814 JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script, | 814 JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script, |
| 815 Handle<String> source) { | 815 Handle<String> source) { |
| 816 Isolate* isolate = Isolate::Current(); | 816 Isolate* isolate = Isolate::Current(); |
| 817 CompilationZoneScope zone_scope(DELETE_ON_EXIT); | 817 CompilationZoneScope zone_scope(isolate, DELETE_ON_EXIT); |
| 818 | 818 |
| 819 FunctionInfoListener listener; | 819 FunctionInfoListener listener; |
| 820 Handle<Object> original_source = Handle<Object>(script->source()); | 820 Handle<Object> original_source = Handle<Object>(script->source()); |
| 821 script->set_source(*source); | 821 script->set_source(*source); |
| 822 isolate->set_active_function_info_listener(&listener); | 822 isolate->set_active_function_info_listener(&listener); |
| 823 CompileScriptForTracker(isolate, script); | 823 CompileScriptForTracker(isolate, script); |
| 824 isolate->set_active_function_info_listener(NULL); | 824 isolate->set_active_function_info_listener(NULL); |
| 825 script->set_source(*original_source); | 825 script->set_source(*original_source); |
| 826 | 826 |
| 827 return *(listener.GetResult()); | 827 return *(listener.GetResult()); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 }; | 901 }; |
| 902 | 902 |
| 903 | 903 |
| 904 // Finds all references to original and replaces them with substitution. | 904 // Finds all references to original and replaces them with substitution. |
| 905 static void ReplaceCodeObject(Code* original, Code* substitution) { | 905 static void ReplaceCodeObject(Code* original, Code* substitution) { |
| 906 ASSERT(!HEAP->InNewSpace(substitution)); | 906 ASSERT(!HEAP->InNewSpace(substitution)); |
| 907 | 907 |
| 908 AssertNoAllocation no_allocations_please; | 908 AssertNoAllocation no_allocations_please; |
| 909 | 909 |
| 910 // A zone scope for ReferenceCollectorVisitor. | 910 // A zone scope for ReferenceCollectorVisitor. |
| 911 ZoneScope scope(DELETE_ON_EXIT); | 911 ZoneScope scope(Isolate::Current(), DELETE_ON_EXIT); |
| 912 | 912 |
| 913 ReferenceCollectorVisitor visitor(original); | 913 ReferenceCollectorVisitor visitor(original); |
| 914 | 914 |
| 915 // Iterate over all roots. Stack frames may have pointer into original code, | 915 // Iterate over all roots. Stack frames may have pointer into original code, |
| 916 // so temporary replace the pointers with offset numbers | 916 // so temporary replace the pointers with offset numbers |
| 917 // in prologue/epilogue. | 917 // in prologue/epilogue. |
| 918 { | 918 { |
| 919 HEAP->IterateStrongRoots(&visitor, VISIT_ALL); | 919 HEAP->IterateStrongRoots(&visitor, VISIT_ALL); |
| 920 } | 920 } |
| 921 | 921 |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 | 1451 |
| 1452 | 1452 |
| 1453 static bool IsDropableFrame(StackFrame* frame) { | 1453 static bool IsDropableFrame(StackFrame* frame) { |
| 1454 return !frame->is_exit(); | 1454 return !frame->is_exit(); |
| 1455 } | 1455 } |
| 1456 | 1456 |
| 1457 // Fills result array with statuses of functions. Modifies the stack | 1457 // Fills result array with statuses of functions. Modifies the stack |
| 1458 // removing all listed function if possible and if do_drop is true. | 1458 // removing all listed function if possible and if do_drop is true. |
| 1459 static const char* DropActivationsInActiveThread( | 1459 static const char* DropActivationsInActiveThread( |
| 1460 Handle<JSArray> shared_info_array, Handle<JSArray> result, bool do_drop) { | 1460 Handle<JSArray> shared_info_array, Handle<JSArray> result, bool do_drop) { |
| 1461 Debug* debug = Isolate::Current()->debug(); | 1461 Isolate* isolate = Isolate::Current(); |
| 1462 ZoneScope scope(DELETE_ON_EXIT); | 1462 Debug* debug = isolate->debug(); |
| 1463 ZoneScope scope(isolate, DELETE_ON_EXIT); |
| 1463 Vector<StackFrame*> frames = CreateStackMap(); | 1464 Vector<StackFrame*> frames = CreateStackMap(); |
| 1464 | 1465 |
| 1465 int array_len = Smi::cast(shared_info_array->length())->value(); | 1466 int array_len = Smi::cast(shared_info_array->length())->value(); |
| 1466 | 1467 |
| 1467 int top_frame_index = -1; | 1468 int top_frame_index = -1; |
| 1468 int frame_index = 0; | 1469 int frame_index = 0; |
| 1469 for (; frame_index < frames.length(); frame_index++) { | 1470 for (; frame_index < frames.length(); frame_index++) { |
| 1470 StackFrame* frame = frames[frame_index]; | 1471 StackFrame* frame = frames[frame_index]; |
| 1471 if (frame->id() == debug->break_frame_id()) { | 1472 if (frame->id() == debug->break_frame_id()) { |
| 1472 top_frame_index = frame_index; | 1473 top_frame_index = frame_index; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1681 | 1682 |
| 1682 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 1683 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
| 1683 return false; | 1684 return false; |
| 1684 } | 1685 } |
| 1685 | 1686 |
| 1686 #endif // ENABLE_DEBUGGER_SUPPORT | 1687 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1687 | 1688 |
| 1688 | 1689 |
| 1689 | 1690 |
| 1690 } } // namespace v8::internal | 1691 } } // namespace v8::internal |
| OLD | NEW |