22#include " base_object-inl.h"
33#include " histogram-inl.h"
44#include " memory_tracker-inl.h"
5+ #include " node_debug.h"
56#include " node_errors.h"
67#include " node_external_reference.h"
78#include " util.h"
@@ -11,7 +12,6 @@ namespace node {
1112using v8::BigInt;
1213using v8::CFunction;
1314using v8::Context;
14- using v8::FastApiCallbackOptions;
1515using v8::FunctionCallbackInfo;
1616using v8::FunctionTemplate;
1717using v8::Integer;
@@ -161,8 +161,8 @@ void HistogramBase::RecordDelta(const FunctionCallbackInfo<Value>& args) {
161161 (*histogram)->RecordDelta ();
162162}
163163
164- void HistogramBase::FastRecordDelta (Local<Value> unused,
165- Local<Value> receiver) {
164+ void HistogramBase::FastRecordDelta (Local<Value> receiver) {
165+ TRACK_V8_FAST_API_CALL ( " histogram.recordDelta " );
166166 HistogramBase* histogram;
167167 ASSIGN_OR_RETURN_UNWRAP (&histogram, receiver);
168168 (*histogram)->RecordDelta ();
@@ -182,14 +182,9 @@ void HistogramBase::Record(const FunctionCallbackInfo<Value>& args) {
182182 (*histogram)->Record (value);
183183}
184184
185- void HistogramBase::FastRecord (Local<Value> unused,
186- Local<Value> receiver,
187- const int64_t value,
188- FastApiCallbackOptions& options) {
189- if (value < 1 ) {
190- options.fallback = true ;
191- return ;
192- }
185+ void HistogramBase::FastRecord (Local<Value> receiver, const int64_t value) {
186+ CHECK_GE (value, 1 );
187+ TRACK_V8_FAST_API_CALL (" histogram.record" );
193188 HistogramBase* histogram;
194189 ASSIGN_OR_RETURN_UNWRAP (&histogram, receiver);
195190 (*histogram)->Record (value);
@@ -426,9 +421,8 @@ void IntervalHistogram::Start(const FunctionCallbackInfo<Value>& args) {
426421 histogram->OnStart (args[0 ]->IsTrue () ? StartFlags::RESET : StartFlags::NONE );
427422}
428423
429- void IntervalHistogram::FastStart (Local<Value> unused,
430- Local<Value> receiver,
431- bool reset) {
424+ void IntervalHistogram::FastStart (Local<Value> receiver, bool reset) {
425+ TRACK_V8_FAST_API_CALL (" histogram.start" );
432426 IntervalHistogram* histogram;
433427 ASSIGN_OR_RETURN_UNWRAP (&histogram, receiver);
434428 histogram->OnStart (reset ? StartFlags::RESET : StartFlags::NONE );
@@ -440,7 +434,8 @@ void IntervalHistogram::Stop(const FunctionCallbackInfo<Value>& args) {
440434 histogram->OnStop ();
441435}
442436
443- void IntervalHistogram::FastStop (Local<Value> unused, Local<Value> receiver) {
437+ void IntervalHistogram::FastStop (Local<Value> receiver) {
438+ TRACK_V8_FAST_API_CALL (" histogram.stop" );
444439 IntervalHistogram* histogram;
445440 ASSIGN_OR_RETURN_UNWRAP (&histogram, receiver);
446441 histogram->OnStop ();
@@ -553,46 +548,51 @@ void HistogramImpl::DoReset(const FunctionCallbackInfo<Value>& args) {
553548 (*histogram)->Reset ();
554549}
555550
556- void HistogramImpl::FastReset (Local<Value> unused, Local<Value> receiver) {
551+ void HistogramImpl::FastReset (Local<Value> receiver) {
552+ TRACK_V8_FAST_API_CALL (" histogram.reset" );
557553 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
558554 (*histogram)->Reset ();
559555}
560556
561- double HistogramImpl::FastGetCount (Local<Value> unused, Local<Value> receiver) {
557+ double HistogramImpl::FastGetCount (Local<Value> receiver) {
558+ TRACK_V8_FAST_API_CALL (" histogram.count" );
562559 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
563560 return static_cast <double >((*histogram)->Count ());
564561}
565562
566- double HistogramImpl::FastGetMin (Local<Value> unused, Local<Value> receiver) {
563+ double HistogramImpl::FastGetMin (Local<Value> receiver) {
564+ TRACK_V8_FAST_API_CALL (" histogram.min" );
567565 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
568566 return static_cast <double >((*histogram)->Min ());
569567}
570568
571- double HistogramImpl::FastGetMax (Local<Value> unused, Local<Value> receiver) {
569+ double HistogramImpl::FastGetMax (Local<Value> receiver) {
570+ TRACK_V8_FAST_API_CALL (" histogram.max" );
572571 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
573572 return static_cast <double >((*histogram)->Max ());
574573}
575574
576- double HistogramImpl::FastGetMean (Local<Value> unused, Local<Value> receiver) {
575+ double HistogramImpl::FastGetMean (Local<Value> receiver) {
576+ TRACK_V8_FAST_API_CALL (" histogram.mean" );
577577 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
578578 return (*histogram)->Mean ();
579579}
580580
581- double HistogramImpl::FastGetExceeds (Local<Value> unused,
582- Local<Value> receiver) {
581+ double HistogramImpl::FastGetExceeds (Local<Value> receiver) {
582+ TRACK_V8_FAST_API_CALL ( " histogram.exceeds " );
583583 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
584584 return static_cast <double >((*histogram)->Exceeds ());
585585}
586586
587- double HistogramImpl::FastGetStddev (Local<Value> unused,
588- Local<Value> receiver) {
587+ double HistogramImpl::FastGetStddev (Local<Value> receiver) {
588+ TRACK_V8_FAST_API_CALL ( " histogram.stddev " );
589589 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
590590 return (*histogram)->Stddev ();
591591}
592592
593- double HistogramImpl::FastGetPercentile (Local<Value> unused,
594- Local<Value> receiver,
593+ double HistogramImpl::FastGetPercentile (Local<Value> receiver,
595594 const double percentile) {
595+ TRACK_V8_FAST_API_CALL (" histogram.percentile" );
596596 HistogramImpl* histogram = HistogramImpl::FromJSObject (receiver);
597597 return static_cast <double >((*histogram)->Percentile (percentile));
598598}
0 commit comments