Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: src/api.cc

Issue 2790343002: Revert of [inspector] move console to builtins (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
29 #include "src/char-predicates-inl.h" 28 #include "src/char-predicates-inl.h"
30 #include "src/code-stubs.h" 29 #include "src/code-stubs.h"
31 #include "src/compiler-dispatcher/compiler-dispatcher.h" 30 #include "src/compiler-dispatcher/compiler-dispatcher.h"
32 #include "src/compiler.h" 31 #include "src/compiler.h"
33 #include "src/contexts.h" 32 #include "src/contexts.h"
34 #include "src/conversions-inl.h" 33 #include "src/conversions-inl.h"
35 #include "src/counters.h" 34 #include "src/counters.h"
36 #include "src/debug/debug-coverage.h" 35 #include "src/debug/debug-coverage.h"
37 #include "src/debug/debug.h" 36 #include "src/debug/debug.h"
38 #include "src/deoptimizer.h" 37 #include "src/deoptimizer.h"
(...skipping 9519 matching lines...) Expand 10 before | Expand all | Expand 10 after
9558 break; 9557 break;
9559 } 9558 }
9560 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name)); 9559 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name));
9561 i::Handle<i::JSFunction> fun = 9560 i::Handle<i::JSFunction> fun =
9562 isolate->factory()->NewFunctionWithoutPrototype( 9561 isolate->factory()->NewFunctionWithoutPrototype(
9563 isolate->factory()->empty_string(), call_code, false); 9562 isolate->factory()->empty_string(), call_code, false);
9564 fun->shared()->DontAdaptArguments(); 9563 fun->shared()->DontAdaptArguments();
9565 return Utils::ToLocal(handle_scope.CloseAndEscape(fun)); 9564 return Utils::ToLocal(handle_scope.CloseAndEscape(fun));
9566 } 9565 }
9567 9566
9568 void debug::SetConsoleDelegate(Isolate* v8_isolate, ConsoleDelegate* delegate) {
9569 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
9570 ENTER_V8(isolate);
9571 isolate->set_console_delegate(delegate);
9572 }
9573
9574 debug::ConsoleCallArguments::ConsoleCallArguments(
9575 const v8::FunctionCallbackInfo<v8::Value>& info)
9576 : v8::FunctionCallbackInfo<v8::Value>(nullptr, info.values_, info.length_) {
9577 }
9578
9579 debug::ConsoleCallArguments::ConsoleCallArguments(
9580 internal::BuiltinArguments& args)
9581 : v8::FunctionCallbackInfo<v8::Value>(nullptr, &args[0] - 1,
9582 args.length() - 1) {}
9583
9584 MaybeLocal<debug::Script> debug::GeneratorObject::Script() { 9567 MaybeLocal<debug::Script> debug::GeneratorObject::Script() {
9585 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); 9568 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this);
9586 i::Object* maybe_script = obj->function()->shared()->script(); 9569 i::Object* maybe_script = obj->function()->shared()->script();
9587 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>(); 9570 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>();
9588 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate()); 9571 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate());
9589 return ToApiHandle<debug::Script>(script); 9572 return ToApiHandle<debug::Script>(script);
9590 } 9573 }
9591 9574
9592 Local<Function> debug::GeneratorObject::Function() { 9575 Local<Function> debug::GeneratorObject::Function() {
9593 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); 9576 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
10341 Address callback_address = 10324 Address callback_address =
10342 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10325 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10343 VMState<EXTERNAL> state(isolate); 10326 VMState<EXTERNAL> state(isolate);
10344 ExternalCallbackScope call_scope(isolate, callback_address); 10327 ExternalCallbackScope call_scope(isolate, callback_address);
10345 callback(info); 10328 callback(info);
10346 } 10329 }
10347 10330
10348 10331
10349 } // namespace internal 10332 } // namespace internal
10350 } // namespace v8 10333 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698