OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 | 594 |
595 return output.GetResult(); | 595 return output.GetResult(); |
596 } | 596 } |
597 | 597 |
598 | 598 |
599 static void CompileScriptForTracker(Isolate* isolate, Handle<Script> script) { | 599 static void CompileScriptForTracker(Isolate* isolate, Handle<Script> script) { |
600 // TODO(635): support extensions. | 600 // TODO(635): support extensions. |
601 PostponeInterruptsScope postpone(isolate); | 601 PostponeInterruptsScope postpone(isolate); |
602 | 602 |
603 // Build AST. | 603 // Build AST. |
604 CompilationInfo info(script); | 604 Zone zone(isolate); |
| 605 CompilationInfo info(script, &zone); |
| 606 ZoneScope scope(&zone, DELETE_ON_EXIT); |
605 info.MarkAsGlobal(); | 607 info.MarkAsGlobal(); |
606 // Parse and don't allow skipping lazy functions. | 608 // Parse and don't allow skipping lazy functions. |
607 if (ParserApi::Parse(&info, kNoParsingFlags)) { | 609 if (ParserApi::Parse(&info, kNoParsingFlags)) { |
608 // Compile the code. | 610 // Compile the code. |
609 LiveEditFunctionTracker tracker(info.isolate(), info.function()); | 611 LiveEditFunctionTracker tracker(info.isolate(), info.function()); |
610 if (Compiler::MakeCodeForLiveEdit(&info)) { | 612 if (Compiler::MakeCodeForLiveEdit(&info)) { |
611 ASSERT(!info.code().is_null()); | 613 ASSERT(!info.code().is_null()); |
612 tracker.RecordRootFunctionInfo(info.code()); | 614 tracker.RecordRootFunctionInfo(info.code()); |
613 } else { | 615 } else { |
614 info.isolate()->StackOverflow(); | 616 info.isolate()->StackOverflow(); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 | 889 |
888 Handle<JSArray> result_; | 890 Handle<JSArray> result_; |
889 int len_; | 891 int len_; |
890 int current_parent_index_; | 892 int current_parent_index_; |
891 }; | 893 }; |
892 | 894 |
893 | 895 |
894 JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script, | 896 JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script, |
895 Handle<String> source) { | 897 Handle<String> source) { |
896 Isolate* isolate = Isolate::Current(); | 898 Isolate* isolate = Isolate::Current(); |
897 ZoneScope zone_scope(isolate, DELETE_ON_EXIT); | |
898 | 899 |
899 FunctionInfoListener listener; | 900 FunctionInfoListener listener; |
900 Handle<Object> original_source = Handle<Object>(script->source()); | 901 Handle<Object> original_source = Handle<Object>(script->source()); |
901 script->set_source(*source); | 902 script->set_source(*source); |
902 isolate->set_active_function_info_listener(&listener); | 903 isolate->set_active_function_info_listener(&listener); |
903 CompileScriptForTracker(isolate, script); | 904 CompileScriptForTracker(isolate, script); |
904 isolate->set_active_function_info_listener(NULL); | 905 isolate->set_active_function_info_listener(NULL); |
905 script->set_source(*original_source); | 906 script->set_source(*original_source); |
906 | 907 |
907 return *(listener.GetResult()); | 908 return *(listener.GetResult()); |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 Handle<JSArray> m_shared_info_array; | 1588 Handle<JSArray> m_shared_info_array; |
1588 Handle<JSArray> m_result; | 1589 Handle<JSArray> m_result; |
1589 }; | 1590 }; |
1590 | 1591 |
1591 // Drops all call frame matched by target and all frames above them. | 1592 // Drops all call frame matched by target and all frames above them. |
1592 template<typename TARGET> | 1593 template<typename TARGET> |
1593 static const char* DropActivationsInActiveThreadImpl( | 1594 static const char* DropActivationsInActiveThreadImpl( |
1594 TARGET& target, bool do_drop, Zone* zone) { | 1595 TARGET& target, bool do_drop, Zone* zone) { |
1595 Isolate* isolate = Isolate::Current(); | 1596 Isolate* isolate = Isolate::Current(); |
1596 Debug* debug = isolate->debug(); | 1597 Debug* debug = isolate->debug(); |
1597 ZoneScope scope(isolate, DELETE_ON_EXIT); | 1598 ZoneScope scope(zone, DELETE_ON_EXIT); |
1598 Vector<StackFrame*> frames = CreateStackMap(zone); | 1599 Vector<StackFrame*> frames = CreateStackMap(zone); |
1599 | 1600 |
1600 | 1601 |
1601 int top_frame_index = -1; | 1602 int top_frame_index = -1; |
1602 int frame_index = 0; | 1603 int frame_index = 0; |
1603 for (; frame_index < frames.length(); frame_index++) { | 1604 for (; frame_index < frames.length(); frame_index++) { |
1604 StackFrame* frame = frames[frame_index]; | 1605 StackFrame* frame = frames[frame_index]; |
1605 if (frame->id() == debug->break_frame_id()) { | 1606 if (frame->id() == debug->break_frame_id()) { |
1606 top_frame_index = frame_index; | 1607 top_frame_index = frame_index; |
1607 break; | 1608 break; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 | 1870 |
1870 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 1871 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
1871 return false; | 1872 return false; |
1872 } | 1873 } |
1873 | 1874 |
1874 #endif // ENABLE_DEBUGGER_SUPPORT | 1875 #endif // ENABLE_DEBUGGER_SUPPORT |
1875 | 1876 |
1876 | 1877 |
1877 | 1878 |
1878 } } // namespace v8::internal | 1879 } } // namespace v8::internal |
OLD | NEW |