@@ -58,7 +58,6 @@ using v8::ArrayBufferView;
5858using v8::BackingStore;
5959using v8::Context;
6060using v8::EscapableHandleScope;
61- using v8::FastApiTypedArray;
6261using v8::FunctionCallbackInfo;
6362using v8::Global;
6463using v8::HandleScope;
@@ -845,24 +844,6 @@ void Compare(const FunctionCallbackInfo<Value> &args) {
845844 args.GetReturnValue ().Set (val);
846845}
847846
848- int32_t FastCompare (v8::Local<v8::Value>,
849- const FastApiTypedArray<uint8_t >& a,
850- const FastApiTypedArray<uint8_t >& b) {
851- uint8_t * data_a;
852- uint8_t * data_b;
853- CHECK (a.getStorageIfAligned (&data_a));
854- CHECK (b.getStorageIfAligned (&data_b));
855-
856- size_t cmp_length = std::min (a.length (), b.length ());
857-
858- return normalizeCompareVal (
859- cmp_length > 0 ? memcmp (data_a, data_b, cmp_length) : 0 ,
860- a.length (),
861- b.length ());
862- }
863-
864- static v8::CFunction fast_compare (v8::CFunction::Make(FastCompare));
865-
866847// Computes the offset for starting an indexOf or lastIndexOf search.
867848// Returns either a valid offset in [0...<length - 1>], ie inside the Buffer,
868849// or -1 to signal that there is no possible match.
@@ -1128,20 +1109,6 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) {
11281109 buffer.data (), buffer.length (), needle, offset_i64, is_forward));
11291110}
11301111
1131- int32_t FastIndexOfNumber (v8::Local<v8::Value>,
1132- const FastApiTypedArray<uint8_t >& buffer,
1133- uint32_t needle,
1134- int64_t offset_i64,
1135- bool is_forward) {
1136- uint8_t * buffer_data;
1137- CHECK (buffer.getStorageIfAligned (&buffer_data));
1138- return IndexOfNumber (
1139- buffer_data, buffer.length (), needle, offset_i64, is_forward);
1140- }
1141-
1142- static v8::CFunction fast_index_of_number (
1143- v8::CFunction::Make (FastIndexOfNumber));
1144-
11451112void Swap16 (const FunctionCallbackInfo<Value>& args) {
11461113 Environment* env = Environment::GetCurrent (args);
11471114 THROW_AND_RETURN_UNLESS_BUFFER (env, args[0 ]);
@@ -1448,15 +1415,11 @@ void Initialize(Local<Object> target,
14481415 SlowByteLengthUtf8,
14491416 &fast_byte_length_utf8);
14501417 SetMethod (context, target, " copy" , Copy);
1451- SetFastMethodNoSideEffect (context, target, " compare" , Compare, &fast_compare );
1418+ SetMethod (context, target, " compare" , Compare);
14521419 SetMethodNoSideEffect (context, target, " compareOffset" , CompareOffset);
14531420 SetMethod (context, target, " fill" , Fill);
14541421 SetMethodNoSideEffect (context, target, " indexOfBuffer" , IndexOfBuffer);
1455- SetFastMethodNoSideEffect (context,
1456- target,
1457- " indexOfNumber" ,
1458- SlowIndexOfNumber,
1459- &fast_index_of_number);
1422+ SetMethod (context, target, " indexOfNumber" , SlowIndexOfNumber);
14601423 SetMethodNoSideEffect (context, target, " indexOfString" , IndexOfString);
14611424
14621425 SetMethod (context, target, " detachArrayBuffer" , DetachArrayBuffer);
@@ -1512,14 +1475,10 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
15121475 registry->Register (FastByteLengthUtf8);
15131476 registry->Register (Copy);
15141477 registry->Register (Compare);
1515- registry->Register (FastCompare);
1516- registry->Register (fast_compare.GetTypeInfo ());
15171478 registry->Register (CompareOffset);
15181479 registry->Register (Fill);
15191480 registry->Register (IndexOfBuffer);
15201481 registry->Register (SlowIndexOfNumber);
1521- registry->Register (FastIndexOfNumber);
1522- registry->Register (fast_index_of_number.GetTypeInfo ());
15231482 registry->Register (IndexOfString);
15241483
15251484 registry->Register (Swap16);
0 commit comments