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 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
11 #include <cmath> // For isnan. | 11 #include <cmath> // For isnan. |
12 #include <limits> | 12 #include <limits> |
13 #include <vector> | 13 #include <vector> |
14 #include "include/v8-debug.h" | 14 #include "include/v8-debug.h" |
15 #include "include/v8-profiler.h" | 15 #include "include/v8-profiler.h" |
16 #include "include/v8-testing.h" | 16 #include "include/v8-testing.h" |
17 #include "include/v8-util.h" | 17 #include "include/v8-util.h" |
18 #include "src/accessors.h" | 18 #include "src/accessors.h" |
19 #include "src/api-natives.h" | 19 #include "src/api-natives.h" |
20 #include "src/assert-scope.h" | 20 #include "src/assert-scope.h" |
21 #include "src/background-parsing-task.h" | 21 #include "src/background-parsing-task.h" |
22 #include "src/base/functional.h" | 22 #include "src/base/functional.h" |
23 #include "src/base/platform/platform.h" | 23 #include "src/base/platform/platform.h" |
24 #include "src/base/platform/time.h" | 24 #include "src/base/platform/time.h" |
25 #include "src/base/safe_conversions.h" | 25 #include "src/base/safe_conversions.h" |
26 #include "src/base/utils/random-number-generator.h" | 26 #include "src/base/utils/random-number-generator.h" |
27 #include "src/bootstrapper.h" | 27 #include "src/bootstrapper.h" |
| 28 #include "src/builtins/builtins-utils.h" |
28 #include "src/char-predicates-inl.h" | 29 #include "src/char-predicates-inl.h" |
29 #include "src/code-stubs.h" | 30 #include "src/code-stubs.h" |
30 #include "src/compiler-dispatcher/compiler-dispatcher.h" | 31 #include "src/compiler-dispatcher/compiler-dispatcher.h" |
31 #include "src/compiler.h" | 32 #include "src/compiler.h" |
32 #include "src/contexts.h" | 33 #include "src/contexts.h" |
33 #include "src/conversions-inl.h" | 34 #include "src/conversions-inl.h" |
34 #include "src/counters.h" | 35 #include "src/counters.h" |
35 #include "src/debug/debug-coverage.h" | 36 #include "src/debug/debug-coverage.h" |
36 #include "src/debug/debug.h" | 37 #include "src/debug/debug.h" |
37 #include "src/deoptimizer.h" | 38 #include "src/deoptimizer.h" |
(...skipping 9626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9664 break; | 9665 break; |
9665 } | 9666 } |
9666 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name)); | 9667 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name)); |
9667 i::Handle<i::JSFunction> fun = | 9668 i::Handle<i::JSFunction> fun = |
9668 isolate->factory()->NewFunctionWithoutPrototype( | 9669 isolate->factory()->NewFunctionWithoutPrototype( |
9669 isolate->factory()->empty_string(), call_code, false); | 9670 isolate->factory()->empty_string(), call_code, false); |
9670 fun->shared()->DontAdaptArguments(); | 9671 fun->shared()->DontAdaptArguments(); |
9671 return Utils::ToLocal(handle_scope.CloseAndEscape(fun)); | 9672 return Utils::ToLocal(handle_scope.CloseAndEscape(fun)); |
9672 } | 9673 } |
9673 | 9674 |
| 9675 void debug::SetConsoleDelegate(Isolate* v8_isolate, ConsoleDelegate* delegate) { |
| 9676 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9677 ENTER_V8(isolate); |
| 9678 isolate->set_console_delegate(delegate); |
| 9679 } |
| 9680 |
| 9681 debug::ConsoleCallArguments::ConsoleCallArguments( |
| 9682 const v8::FunctionCallbackInfo<v8::Value>& info) |
| 9683 : v8::FunctionCallbackInfo<v8::Value>(nullptr, info.values_, info.length_) { |
| 9684 } |
| 9685 |
| 9686 debug::ConsoleCallArguments::ConsoleCallArguments( |
| 9687 internal::BuiltinArguments& args) |
| 9688 : v8::FunctionCallbackInfo<v8::Value>(nullptr, &args[0] - 1, |
| 9689 args.length() - 1) {} |
| 9690 |
9674 MaybeLocal<debug::Script> debug::GeneratorObject::Script() { | 9691 MaybeLocal<debug::Script> debug::GeneratorObject::Script() { |
9675 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); | 9692 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); |
9676 i::Object* maybe_script = obj->function()->shared()->script(); | 9693 i::Object* maybe_script = obj->function()->shared()->script(); |
9677 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>(); | 9694 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>(); |
9678 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate()); | 9695 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate()); |
9679 return ToApiHandle<debug::Script>(script); | 9696 return ToApiHandle<debug::Script>(script); |
9680 } | 9697 } |
9681 | 9698 |
9682 Local<Function> debug::GeneratorObject::Function() { | 9699 Local<Function> debug::GeneratorObject::Function() { |
9683 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); | 9700 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10431 Address callback_address = | 10448 Address callback_address = |
10432 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10449 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10433 VMState<EXTERNAL> state(isolate); | 10450 VMState<EXTERNAL> state(isolate); |
10434 ExternalCallbackScope call_scope(isolate, callback_address); | 10451 ExternalCallbackScope call_scope(isolate, callback_address); |
10435 callback(info); | 10452 callback(info); |
10436 } | 10453 } |
10437 | 10454 |
10438 | 10455 |
10439 } // namespace internal | 10456 } // namespace internal |
10440 } // namespace v8 | 10457 } // namespace v8 |
OLD | NEW |