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

Side by Side Diff: src/api.cc

Issue 2801023003: 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 9534 matching lines...) Expand 10 before | Expand all | Expand 10 after
9573 break; 9572 break;
9574 } 9573 }
9575 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name)); 9574 i::Handle<i::Code> call_code(isolate->builtins()->builtin(name));
9576 i::Handle<i::JSFunction> fun = 9575 i::Handle<i::JSFunction> fun =
9577 isolate->factory()->NewFunctionWithoutPrototype( 9576 isolate->factory()->NewFunctionWithoutPrototype(
9578 isolate->factory()->empty_string(), call_code, false); 9577 isolate->factory()->empty_string(), call_code, false);
9579 fun->shared()->DontAdaptArguments(); 9578 fun->shared()->DontAdaptArguments();
9580 return Utils::ToLocal(handle_scope.CloseAndEscape(fun)); 9579 return Utils::ToLocal(handle_scope.CloseAndEscape(fun));
9581 } 9580 }
9582 9581
9583 void debug::SetConsoleDelegate(Isolate* v8_isolate, ConsoleDelegate* delegate) {
9584 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
9585 ENTER_V8(isolate);
9586 isolate->set_console_delegate(delegate);
9587 }
9588
9589 debug::ConsoleCallArguments::ConsoleCallArguments(
9590 const v8::FunctionCallbackInfo<v8::Value>& info)
9591 : v8::FunctionCallbackInfo<v8::Value>(nullptr, info.values_, info.length_) {
9592 }
9593
9594 debug::ConsoleCallArguments::ConsoleCallArguments(
9595 internal::BuiltinArguments& args)
9596 : v8::FunctionCallbackInfo<v8::Value>(nullptr, &args[0] - 1,
9597 args.length() - 1) {}
9598
9599 MaybeLocal<debug::Script> debug::GeneratorObject::Script() { 9582 MaybeLocal<debug::Script> debug::GeneratorObject::Script() {
9600 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); 9583 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this);
9601 i::Object* maybe_script = obj->function()->shared()->script(); 9584 i::Object* maybe_script = obj->function()->shared()->script();
9602 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>(); 9585 if (!maybe_script->IsScript()) return MaybeLocal<debug::Script>();
9603 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate()); 9586 i::Handle<i::Script> script(i::Script::cast(maybe_script), obj->GetIsolate());
9604 return ToApiHandle<debug::Script>(script); 9587 return ToApiHandle<debug::Script>(script);
9605 } 9588 }
9606 9589
9607 Local<Function> debug::GeneratorObject::Function() { 9590 Local<Function> debug::GeneratorObject::Function() {
9608 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this); 9591 i::Handle<i::JSGeneratorObject> obj = Utils::OpenHandle(this);
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
10356 Address callback_address = 10339 Address callback_address =
10357 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10340 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10358 VMState<EXTERNAL> state(isolate); 10341 VMState<EXTERNAL> state(isolate);
10359 ExternalCallbackScope call_scope(isolate, callback_address); 10342 ExternalCallbackScope call_scope(isolate, callback_address);
10360 callback(info); 10343 callback(info);
10361 } 10344 }
10362 10345
10363 10346
10364 } // namespace internal 10347 } // namespace internal
10365 } // namespace v8 10348 } // 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