@@ -58,7 +58,6 @@ using v8::ArrayBufferView;
58
58
using v8::BackingStore;
59
59
using v8::Context;
60
60
using v8::EscapableHandleScope;
61
- using v8::FastApiTypedArray;
62
61
using v8::FunctionCallbackInfo;
63
62
using v8::Global;
64
63
using v8::HandleScope;
@@ -845,24 +844,6 @@ void Compare(const FunctionCallbackInfo<Value> &args) {
845
844
args.GetReturnValue ().Set (val);
846
845
}
847
846
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
-
866
847
// Computes the offset for starting an indexOf or lastIndexOf search.
867
848
// Returns either a valid offset in [0...<length - 1>], ie inside the Buffer,
868
849
// or -1 to signal that there is no possible match.
@@ -1128,20 +1109,6 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) {
1128
1109
buffer.data (), buffer.length (), needle, offset_i64, is_forward));
1129
1110
}
1130
1111
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
-
1145
1112
void Swap16 (const FunctionCallbackInfo<Value>& args) {
1146
1113
Environment* env = Environment::GetCurrent (args);
1147
1114
THROW_AND_RETURN_UNLESS_BUFFER (env, args[0 ]);
@@ -1448,15 +1415,11 @@ void Initialize(Local<Object> target,
1448
1415
SlowByteLengthUtf8,
1449
1416
&fast_byte_length_utf8);
1450
1417
SetMethod (context, target, " copy" , Copy);
1451
- SetFastMethodNoSideEffect (context, target, " compare" , Compare, &fast_compare );
1418
+ SetMethod (context, target, " compare" , Compare);
1452
1419
SetMethodNoSideEffect (context, target, " compareOffset" , CompareOffset);
1453
1420
SetMethod (context, target, " fill" , Fill);
1454
1421
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);
1460
1423
SetMethodNoSideEffect (context, target, " indexOfString" , IndexOfString);
1461
1424
1462
1425
SetMethod (context, target, " detachArrayBuffer" , DetachArrayBuffer);
@@ -1512,14 +1475,10 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
1512
1475
registry->Register (FastByteLengthUtf8);
1513
1476
registry->Register (Copy);
1514
1477
registry->Register (Compare);
1515
- registry->Register (FastCompare);
1516
- registry->Register (fast_compare.GetTypeInfo ());
1517
1478
registry->Register (CompareOffset);
1518
1479
registry->Register (Fill);
1519
1480
registry->Register (IndexOfBuffer);
1520
1481
registry->Register (SlowIndexOfNumber);
1521
- registry->Register (FastIndexOfNumber);
1522
- registry->Register (fast_index_of_number.GetTypeInfo ());
1523
1482
registry->Register (IndexOfString);
1524
1483
1525
1484
registry->Register (Swap16);
0 commit comments