@@ -23,13 +23,14 @@ using v8::Number;
|
23 | 23 | using v8::Object; |
24 | 24 | using v8::Value; |
25 | 25 | |
26 | | -thread_local std::unordered_map<std::string_view, int> v8_fast_api_call_counts; |
| 26 | +thread_local std::unordered_map<FastStringKey, int, FastStringKey::Hash> |
| 27 | + v8_fast_api_call_counts; |
27 | 28 | |
28 | | -void TrackV8FastApiCall(std::string_view key) { |
| 29 | +void TrackV8FastApiCall(FastStringKey key) { |
29 | 30 | v8_fast_api_call_counts[key]++; |
30 | 31 | } |
31 | 32 | |
32 | | -int GetV8FastApiCallCount(std::string_view key) { |
| 33 | +int GetV8FastApiCallCount(FastStringKey key) { |
33 | 34 | return v8_fast_api_call_counts[key]; |
34 | 35 | } |
35 | 36 | |
@@ -40,7 +41,8 @@ void GetV8FastApiCallCount(const FunctionCallbackInfo<Value>& args) {
|
40 | 41 | return; |
41 | 42 | } |
42 | 43 | Utf8Value utf8_key(env->isolate(), args[0]); |
43 | | - args.GetReturnValue().Set(GetV8FastApiCallCount(utf8_key.ToStringView())); |
| 44 | + args.GetReturnValue().Set(GetV8FastApiCallCount( |
| 45 | +FastStringKey::AllowDynamic(utf8_key.ToStringView()))); |
44 | 46 | } |
45 | 47 | |
46 | 48 | void SlowIsEven(const FunctionCallbackInfo<Value>& args) { |
|