@@ -219,28 +219,6 @@ Local<Context> ContextFromNeverReadOnlySpaceObject(
219
219
return reinterpret_cast<v8::Isolate*>(obj->GetIsolate())->GetCurrentContext();
220
220
}
221
221
222
- // TODO(delphick): Remove this completely when the deprecated functions that use
223
- // it are removed.
224
- // DO NOT USE THIS IN NEW CODE!
225
- i::Isolate* UnsafeIsolateFromHeapObject(i::Handle<i::HeapObject> obj) {
226
- // Use MemoryChunk directly instead of Isolate::FromWritableHeapObject to
227
- // temporarily allow isolate access from read-only space objects.
228
- i::MemoryChunk* chunk = i::MemoryChunk::FromHeapObject(*obj);
229
- return chunk->heap()->isolate();
230
- }
231
-
232
- // TODO(delphick): Remove this completely when the deprecated functions that use
233
- // it are removed.
234
- // DO NOT USE THIS IN NEW CODE!
235
- Local<Context> UnsafeContextFromHeapObject(i::Handle<i::Object> obj) {
236
- // Use MemoryChunk directly instead of Isolate::FromWritableHeapObject to
237
- // temporarily allow isolate access from read-only space objects.
238
- i::MemoryChunk* chunk =
239
- i::MemoryChunk::FromHeapObject(i::HeapObject::cast(*obj));
240
- return reinterpret_cast<Isolate*>(chunk->heap()->isolate())
241
- ->GetCurrentContext();
242
- }
243
-
244
222
class InternalEscapableScope : public v8::EscapableHandleScope {
245
223
public:
246
224
explicit inline InternalEscapableScope(i::Isolate* isolate)
@@ -2192,12 +2170,6 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index,
2192
2170
array->set(index, *i_item);
2193
2171
}
2194
2172
2195
- void PrimitiveArray::Set(int index, Local<Primitive> item) {
2196
- i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
2197
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(array);
2198
- Set(reinterpret_cast<Isolate*>(isolate), index, item);
2199
- }
2200
-
2201
2173
Local<Primitive> PrimitiveArray::Get(Isolate* v8_isolate, int index) {
2202
2174
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
2203
2175
i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
@@ -2210,12 +2182,6 @@ Local<Primitive> PrimitiveArray::Get(Isolate* v8_isolate, int index) {
2210
2182
return ToApiHandle<Primitive>(i_item);
2211
2183
}
2212
2184
2213
- Local<Primitive> PrimitiveArray::Get(int index) {
2214
- i::Handle<i::FixedArray> array = Utils::OpenHandle(this);
2215
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(array);
2216
- return Get(reinterpret_cast<Isolate*>(isolate), index);
2217
- }
2218
-
2219
2185
Module::Status Module::GetStatus() const {
2220
2186
i::Handle<i::Module> self = Utils::OpenHandle(this);
2221
2187
switch (self->status()) {
@@ -2944,11 +2910,6 @@ Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
2944
2910
return scope.Escape(Utils::StackFrameToLocal(info));
2945
2911
}
2946
2912
2947
- Local<StackFrame> StackTrace::GetFrame(uint32_t index) const {
2948
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(Utils::OpenHandle(this));
2949
- return GetFrame(reinterpret_cast<Isolate*>(isolate), index);
2950
- }
2951
-
2952
2913
int StackTrace::GetFrameCount() const {
2953
2914
return Utils::OpenHandle(this)->length();
2954
2915
}
@@ -3920,14 +3881,6 @@ Maybe<bool> Value::BooleanValue(Local<Context> context) const {
3920
3881
return Just(Utils::OpenHandle(this)->BooleanValue(isolate));
3921
3882
}
3922
3883
3923
- bool Value::BooleanValue() const {
3924
- auto obj = Utils::OpenHandle(this);
3925
- if (obj->IsSmi()) return *obj != i::Smi::kZero;
3926
- DCHECK(obj->IsHeapObject());
3927
- i::Isolate* isolate =
3928
- UnsafeIsolateFromHeapObject(i::Handle<i::HeapObject>::cast(obj));
3929
- return obj->BooleanValue(isolate);
3930
- }
3931
3884
3932
3885
Maybe<double> Value::NumberValue(Local<Context> context) const {
3933
3886
auto obj = Utils::OpenHandle(this);
@@ -3941,12 +3894,6 @@ Maybe<double> Value::NumberValue(Local<Context> context) const {
3941
3894
return Just(num->Number());
3942
3895
}
3943
3896
3944
- double Value::NumberValue() const {
3945
- auto obj = Utils::OpenHandle(this);
3946
- if (obj->IsNumber()) return obj->Number();
3947
- return NumberValue(UnsafeContextFromHeapObject(obj))
3948
- .FromMaybe(std::numeric_limits<double>::quiet_NaN());
3949
- }
3950
3897
3951
3898
Maybe<int64_t> Value::IntegerValue(Local<Context> context) const {
3952
3899
auto obj = Utils::OpenHandle(this);
@@ -3962,17 +3909,6 @@ Maybe<int64_t> Value::IntegerValue(Local<Context> context) const {
3962
3909
return Just(NumberToInt64(*num));
3963
3910
}
3964
3911
3965
- int64_t Value::IntegerValue() const {
3966
- auto obj = Utils::OpenHandle(this);
3967
- if (obj->IsNumber()) {
3968
- if (obj->IsSmi()) {
3969
- return i::Smi::ToInt(*obj);
3970
- } else {
3971
- return static_cast<int64_t>(obj->Number());
3972
- }
3973
- }
3974
- return IntegerValue(UnsafeContextFromHeapObject(obj)).FromMaybe(0);
3975
- }
3976
3912
3977
3913
Maybe<int32_t> Value::Int32Value(Local<Context> context) const {
3978
3914
auto obj = Utils::OpenHandle(this);
@@ -3987,11 +3923,6 @@ Maybe<int32_t> Value::Int32Value(Local<Context> context) const {
3987
3923
: static_cast<int32_t>(num->Number()));
3988
3924
}
3989
3925
3990
- int32_t Value::Int32Value() const {
3991
- auto obj = Utils::OpenHandle(this);
3992
- if (obj->IsNumber()) return NumberToInt32(*obj);
3993
- return Int32Value(UnsafeContextFromHeapObject(obj)).FromMaybe(0);
3994
- }
3995
3926
3996
3927
Maybe<uint32_t> Value::Uint32Value(Local<Context> context) const {
3997
3928
auto obj = Utils::OpenHandle(this);
@@ -4006,11 +3937,6 @@ Maybe<uint32_t> Value::Uint32Value(Local<Context> context) const {
4006
3937
: static_cast<uint32_t>(num->Number()));
4007
3938
}
4008
3939
4009
- uint32_t Value::Uint32Value() const {
4010
- auto obj = Utils::OpenHandle(this);
4011
- if (obj->IsNumber()) return NumberToUint32(*obj);
4012
- return Uint32Value(UnsafeContextFromHeapObject(obj)).FromMaybe(0);
4013
- }
4014
3940
4015
3941
MaybeLocal<Uint32> Value::ToArrayIndex(Local<Context> context) const {
4016
3942
auto self = Utils::OpenHandle(this);
@@ -4045,19 +3971,6 @@ Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
4045
3971
return i::Object::Equals(isolate, self, other);
4046
3972
}
4047
3973
4048
- bool Value::Equals(Local<Value> that) const {
4049
- auto self = Utils::OpenHandle(this);
4050
- auto other = Utils::OpenHandle(*that);
4051
- if (self->IsSmi() && other->IsSmi()) {
4052
- return self->Number() == other->Number();
4053
- }
4054
- if (self->IsJSObject() && other->IsJSObject()) {
4055
- return *self == *other;
4056
- }
4057
- auto heap_object = self->IsSmi() ? other : self;
4058
- auto context = UnsafeContextFromHeapObject(heap_object);
4059
- return Equals(context, that).FromMaybe(false);
4060
- }
4061
3974
4062
3975
bool Value::StrictEquals(Local<Value> that) const {
4063
3976
auto self = Utils::OpenHandle(this);
@@ -5382,11 +5295,6 @@ bool String::ContainsOnlyOneByte() const {
5382
5295
return helper.Check(*str);
5383
5296
}
5384
5297
5385
- int String::Utf8Length() const {
5386
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(Utils::OpenHandle(this));
5387
- return Utf8Length(reinterpret_cast<Isolate*>(isolate));
5388
- }
5389
-
5390
5298
int String::Utf8Length(Isolate* isolate) const {
5391
5299
i::Handle<i::String> str = Utils::OpenHandle(this);
5392
5300
str = i::String::Flatten(reinterpret_cast<i::Isolate*>(isolate), str);
@@ -5655,14 +5563,6 @@ int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity,
5655
5563
return writer.CompleteWrite(write_null, nchars_ref);
5656
5564
}
5657
5565
5658
- int String::WriteUtf8(char* buffer, int capacity, int* nchars_ref,
5659
- int options) const {
5660
- i::Handle<i::String> str = Utils::OpenHandle(this);
5661
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(str);
5662
- return WriteUtf8(reinterpret_cast<Isolate*>(isolate), buffer, capacity,
5663
- nchars_ref, options);
5664
- }
5665
-
5666
5566
template <typename CharType>
5667
5567
static inline int WriteHelper(i::Isolate* isolate, const String* string,
5668
5568
CharType* buffer, int start, int length,
@@ -5684,22 +5584,13 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
5684
5584
return end - start;
5685
5585
}
5686
5586
5687
- int String::WriteOneByte(uint8_t* buffer, int start, int length,
5688
- int options) const {
5689
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(Utils::OpenHandle(this));
5690
- return WriteHelper(isolate, this, buffer, start, length, options);
5691
- }
5692
5587
5693
5588
int String::WriteOneByte(Isolate* isolate, uint8_t* buffer, int start,
5694
5589
int length, int options) const {
5695
5590
return WriteHelper(reinterpret_cast<i::Isolate*>(isolate), this, buffer,
5696
5591
start, length, options);
5697
5592
}
5698
5593
5699
- int String::Write(uint16_t* buffer, int start, int length, int options) const {
5700
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(Utils::OpenHandle(this));
5701
- return WriteHelper(isolate, this, buffer, start, length, options);
5702
- }
5703
5594
5704
5595
int String::Write(Isolate* isolate, uint16_t* buffer, int start, int length,
5705
5596
int options) const {
@@ -6658,12 +6549,6 @@ Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
6658
6549
return Utils::ToLocal(result);
6659
6550
}
6660
6551
6661
- Local<String> v8::String::Concat(Local<String> left, Local<String> right) {
6662
- i::Handle<i::String> left_string = Utils::OpenHandle(*left);
6663
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(left_string);
6664
- return Concat(reinterpret_cast<Isolate*>(isolate), left, right);
6665
- }
6666
-
6667
6552
MaybeLocal<String> v8::String::NewExternalTwoByte(
6668
6553
Isolate* isolate, v8::String::ExternalStringResource* resource) {
6669
6554
CHECK(resource && resource->data());
@@ -6872,11 +6757,6 @@ bool v8::BooleanObject::ValueOf() const {
6872
6757
return jsvalue->value()->IsTrue(isolate);
6873
6758
}
6874
6759
6875
- Local<v8::Value> v8::StringObject::New(Local<String> value) {
6876
- i::Handle<i::String> string = Utils::OpenHandle(*value);
6877
- i::Isolate* isolate = UnsafeIsolateFromHeapObject(string);
6878
- return New(reinterpret_cast<Isolate*>(isolate), value);
6879
- }
6880
6760
6881
6761
Local<v8::Value> v8::StringObject::New(Isolate* v8_isolate,
6882
6762
Local<String> value) {
0 commit comments