V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
ignition-statistics-extension.cc
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/extensions/ignition-statistics-extension.h"
6 
7 #include "src/base/logging.h"
8 #include "src/interpreter/bytecodes.h"
9 #include "src/interpreter/interpreter.h"
10 #include "src/isolate.h"
11 
12 namespace v8 {
13 namespace internal {
14 
16 IgnitionStatisticsExtension::GetNativeFunctionTemplate(
17  v8::Isolate* isolate, v8::Local<v8::String> name) {
18  DCHECK_EQ(strcmp(*v8::String::Utf8Value(isolate, name),
19  "getIgnitionDispatchCounters"),
20  0);
22  isolate, IgnitionStatisticsExtension::GetIgnitionDispatchCounters);
23 }
24 
25 const char* const IgnitionStatisticsExtension::kSource =
26  "native function getIgnitionDispatchCounters();";
27 
28 void IgnitionStatisticsExtension::GetIgnitionDispatchCounters(
30  DCHECK(FLAG_trace_ignition_dispatches);
31  args.GetReturnValue().Set(reinterpret_cast<Isolate*>(args.GetIsolate())
32  ->interpreter()
33  ->GetDispatchCountersObject());
34 }
35 
36 } // namespace internal
37 } // namespace v8
Definition: v8.h:85
Definition: libplatform.h:13
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=nullptr, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect)
Definition: api.cc:1417