| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/debug/debug-frames.h" | 9 #include "src/debug/debug-frames.h" |
| 10 #include "src/debug/liveedit.h" | 10 #include "src/debug/liveedit.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 RUNTIME_FUNCTION(Runtime_LiveEditGatherCompileInfo) { | 63 RUNTIME_FUNCTION(Runtime_LiveEditGatherCompileInfo) { |
| 64 HandleScope scope(isolate); | 64 HandleScope scope(isolate); |
| 65 CHECK(isolate->debug()->live_edit_enabled()); | 65 CHECK(isolate->debug()->live_edit_enabled()); |
| 66 DCHECK(args.length() == 2); | 66 DCHECK(args.length() == 2); |
| 67 CONVERT_ARG_CHECKED(JSValue, script, 0); | 67 CONVERT_ARG_CHECKED(JSValue, script, 0); |
| 68 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); | 68 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); |
| 69 | 69 |
| 70 RUNTIME_ASSERT(script->value()->IsScript()); | 70 RUNTIME_ASSERT(script->value()->IsScript()); |
| 71 Handle<Script> script_handle = Handle<Script>(Script::cast(script->value())); | 71 Handle<Script> script_handle = Handle<Script>(Script::cast(script->value())); |
| 72 | 72 |
| 73 Handle<JSArray> result; | 73 RETURN_RESULT_OR_FAILURE(isolate, |
| 74 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 74 LiveEdit::GatherCompileInfo(script_handle, source)); |
| 75 isolate, result, LiveEdit::GatherCompileInfo(script_handle, source)); | |
| 76 return *result; | |
| 77 } | 75 } |
| 78 | 76 |
| 79 | 77 |
| 80 // Changes the source of the script to a new_source. | 78 // Changes the source of the script to a new_source. |
| 81 // If old_script_name is provided (i.e. is a String), also creates a copy of | 79 // If old_script_name is provided (i.e. is a String), also creates a copy of |
| 82 // the script with its original source and sends notification to debugger. | 80 // the script with its original source and sends notification to debugger. |
| 83 RUNTIME_FUNCTION(Runtime_LiveEditReplaceScript) { | 81 RUNTIME_FUNCTION(Runtime_LiveEditReplaceScript) { |
| 84 HandleScope scope(isolate); | 82 HandleScope scope(isolate); |
| 85 CHECK(isolate->debug()->live_edit_enabled()); | 83 CHECK(isolate->debug()->live_edit_enabled()); |
| 86 DCHECK(args.length() == 3); | 84 DCHECK(args.length() == 3); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // We don't really care what the inlined frame index is, since we are | 278 // We don't really care what the inlined frame index is, since we are |
| 281 // throwing away the entire frame anyways. | 279 // throwing away the entire frame anyways. |
| 282 const char* error_message = LiveEdit::RestartFrame(it.frame()); | 280 const char* error_message = LiveEdit::RestartFrame(it.frame()); |
| 283 if (error_message) { | 281 if (error_message) { |
| 284 return *(isolate->factory()->InternalizeUtf8String(error_message)); | 282 return *(isolate->factory()->InternalizeUtf8String(error_message)); |
| 285 } | 283 } |
| 286 return heap->true_value(); | 284 return heap->true_value(); |
| 287 } | 285 } |
| 288 } // namespace internal | 286 } // namespace internal |
| 289 } // namespace v8 | 287 } // namespace v8 |
| OLD | NEW |