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 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 | 1439 |
1440 Handle<Object> LiveEdit::ChangeScriptSource(Handle<Script> original_script, | 1440 Handle<Object> LiveEdit::ChangeScriptSource(Handle<Script> original_script, |
1441 Handle<String> new_source, | 1441 Handle<String> new_source, |
1442 Handle<Object> old_script_name) { | 1442 Handle<Object> old_script_name) { |
1443 Isolate* isolate = original_script->GetIsolate(); | 1443 Isolate* isolate = original_script->GetIsolate(); |
1444 Handle<Object> old_script_object; | 1444 Handle<Object> old_script_object; |
1445 if (old_script_name->IsString()) { | 1445 if (old_script_name->IsString()) { |
1446 Handle<Script> old_script = CreateScriptCopy(original_script); | 1446 Handle<Script> old_script = CreateScriptCopy(original_script); |
1447 old_script->set_name(String::cast(*old_script_name)); | 1447 old_script->set_name(String::cast(*old_script_name)); |
1448 old_script_object = old_script; | 1448 old_script_object = old_script; |
1449 isolate->debugger()->OnAfterCompile( | 1449 isolate->debug()->OnAfterCompile(old_script, Debug::SEND_WHEN_DEBUGGING); |
1450 old_script, Debugger::SEND_WHEN_DEBUGGING); | |
1451 } else { | 1450 } else { |
1452 old_script_object = isolate->factory()->null_value(); | 1451 old_script_object = isolate->factory()->null_value(); |
1453 } | 1452 } |
1454 | 1453 |
1455 original_script->set_source(*new_source); | 1454 original_script->set_source(*new_source); |
1456 | 1455 |
1457 // Drop line ends so that they will be recalculated. | 1456 // Drop line ends so that they will be recalculated. |
1458 original_script->set_line_ends(isolate->heap()->undefined_value()); | 1457 original_script->set_line_ends(isolate->heap()->undefined_value()); |
1459 | 1458 |
1460 return old_script_object; | 1459 return old_script_object; |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) { | 2018 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) { |
2020 isolate_->active_function_info_listener()->FunctionCode(code); | 2019 isolate_->active_function_info_listener()->FunctionCode(code); |
2021 } | 2020 } |
2022 | 2021 |
2023 | 2022 |
2024 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 2023 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
2025 return isolate->active_function_info_listener() != NULL; | 2024 return isolate->active_function_info_listener() != NULL; |
2026 } | 2025 } |
2027 | 2026 |
2028 } } // namespace v8::internal | 2027 } } // namespace v8::internal |
OLD | NEW |