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 "src/v8.h" | 6 #include "src/v8.h" |
7 | 7 |
8 #include "src/liveedit.h" | 8 #include "src/liveedit.h" |
9 | 9 |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 | 1464 |
1465 Handle<Object> LiveEdit::ChangeScriptSource(Handle<Script> original_script, | 1465 Handle<Object> LiveEdit::ChangeScriptSource(Handle<Script> original_script, |
1466 Handle<String> new_source, | 1466 Handle<String> new_source, |
1467 Handle<Object> old_script_name) { | 1467 Handle<Object> old_script_name) { |
1468 Isolate* isolate = original_script->GetIsolate(); | 1468 Isolate* isolate = original_script->GetIsolate(); |
1469 Handle<Object> old_script_object; | 1469 Handle<Object> old_script_object; |
1470 if (old_script_name->IsString()) { | 1470 if (old_script_name->IsString()) { |
1471 Handle<Script> old_script = CreateScriptCopy(original_script); | 1471 Handle<Script> old_script = CreateScriptCopy(original_script); |
1472 old_script->set_name(String::cast(*old_script_name)); | 1472 old_script->set_name(String::cast(*old_script_name)); |
1473 old_script_object = old_script; | 1473 old_script_object = old_script; |
1474 isolate->debug()->OnAfterCompile(old_script, Debug::SEND_WHEN_DEBUGGING); | 1474 isolate->debug()->OnAfterCompile(old_script); |
1475 } else { | 1475 } else { |
1476 old_script_object = isolate->factory()->null_value(); | 1476 old_script_object = isolate->factory()->null_value(); |
1477 } | 1477 } |
1478 | 1478 |
1479 original_script->set_source(*new_source); | 1479 original_script->set_source(*new_source); |
1480 | 1480 |
1481 // Drop line ends so that they will be recalculated. | 1481 // Drop line ends so that they will be recalculated. |
1482 original_script->set_line_ends(isolate->heap()->undefined_value()); | 1482 original_script->set_line_ends(isolate->heap()->undefined_value()); |
1483 | 1483 |
1484 return old_script_object; | 1484 return old_script_object; |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) { | 2072 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) { |
2073 isolate_->active_function_info_listener()->FunctionCode(code); | 2073 isolate_->active_function_info_listener()->FunctionCode(code); |
2074 } | 2074 } |
2075 | 2075 |
2076 | 2076 |
2077 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 2077 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
2078 return isolate->active_function_info_listener() != NULL; | 2078 return isolate->active_function_info_listener() != NULL; |
2079 } | 2079 } |
2080 | 2080 |
2081 } } // namespace v8::internal | 2081 } } // namespace v8::internal |
OLD | NEW |