@@ -219,28 +219,6 @@ Local<Context> ContextFromNeverReadOnlySpaceObject(
219219 return reinterpret_cast <v8::Isolate*>(obj->GetIsolate ())->GetCurrentContext ();
220220}
221221
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-
244222class InternalEscapableScope : public v8 ::EscapableHandleScope {
245223 public:
246224 explicit inline InternalEscapableScope (i::Isolate* isolate)
@@ -2192,12 +2170,6 @@ void PrimitiveArray::Set(Isolate* v8_isolate, int index,
21922170 array->set (index, *i_item);
21932171}
21942172
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-
22012173Local<Primitive> PrimitiveArray::Get (Isolate* v8_isolate, int index) {
22022174 i::Isolate* isolate = reinterpret_cast <i::Isolate*>(v8_isolate);
22032175 i::Handle<i::FixedArray> array = Utils::OpenHandle (this );
@@ -2210,12 +2182,6 @@ Local<Primitive> PrimitiveArray::Get(Isolate* v8_isolate, int index) {
22102182 return ToApiHandle<Primitive>(i_item);
22112183}
22122184
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-
22192185Module::Status Module::GetStatus () const {
22202186 i::Handle<i::Module> self = Utils::OpenHandle (this );
22212187 switch (self->status ()) {
@@ -2944,11 +2910,6 @@ Local<StackFrame> StackTrace::GetFrame(Isolate* v8_isolate,
29442910 return scope.Escape (Utils::StackFrameToLocal (info));
29452911}
29462912
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-
29522913int StackTrace::GetFrameCount () const {
29532914 return Utils::OpenHandle (this )->length ();
29542915}
@@ -3920,14 +3881,6 @@ Maybe<bool> Value::BooleanValue(Local<Context> context) const {
39203881 return Just (Utils::OpenHandle (this )->BooleanValue (isolate));
39213882}
39223883
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- }
39313884
39323885Maybe<double > Value::NumberValue (Local<Context> context) const {
39333886 auto obj = Utils::OpenHandle (this );
@@ -3941,12 +3894,6 @@ Maybe<double> Value::NumberValue(Local<Context> context) const {
39413894 return Just (num->Number ());
39423895}
39433896
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- }
39503897
39513898Maybe<int64_t > Value::IntegerValue (Local<Context> context) const {
39523899 auto obj = Utils::OpenHandle (this );
@@ -3962,17 +3909,6 @@ Maybe<int64_t> Value::IntegerValue(Local<Context> context) const {
39623909 return Just (NumberToInt64 (*num));
39633910}
39643911
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- }
39763912
39773913Maybe<int32_t > Value::Int32Value (Local<Context> context) const {
39783914 auto obj = Utils::OpenHandle (this );
@@ -3987,11 +3923,6 @@ Maybe<int32_t> Value::Int32Value(Local<Context> context) const {
39873923 : static_cast <int32_t >(num->Number ()));
39883924}
39893925
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- }
39953926
39963927Maybe<uint32_t > Value::Uint32Value (Local<Context> context) const {
39973928 auto obj = Utils::OpenHandle (this );
@@ -4006,11 +3937,6 @@ Maybe<uint32_t> Value::Uint32Value(Local<Context> context) const {
40063937 : static_cast <uint32_t >(num->Number ()));
40073938}
40083939
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- }
40143940
40153941MaybeLocal<Uint32> Value::ToArrayIndex (Local<Context> context) const {
40163942 auto self = Utils::OpenHandle (this );
@@ -4045,19 +3971,6 @@ Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
40453971 return i::Object::Equals (isolate, self, other);
40463972}
40473973
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- }
40613974
40623975bool Value::StrictEquals (Local<Value> that) const {
40633976 auto self = Utils::OpenHandle (this );
@@ -5382,11 +5295,6 @@ bool String::ContainsOnlyOneByte() const {
53825295 return helper.Check (*str);
53835296}
53845297
5385- int String::Utf8Length () const {
5386- i::Isolate* isolate = UnsafeIsolateFromHeapObject (Utils::OpenHandle (this ));
5387- return Utf8Length (reinterpret_cast <Isolate*>(isolate));
5388- }
5389-
53905298int String::Utf8Length (Isolate* isolate) const {
53915299 i::Handle<i::String> str = Utils::OpenHandle (this );
53925300 str = i::String::Flatten (reinterpret_cast <i::Isolate*>(isolate), str);
@@ -5655,14 +5563,6 @@ int String::WriteUtf8(Isolate* v8_isolate, char* buffer, int capacity,
56555563 return writer.CompleteWrite (write_null, nchars_ref);
56565564}
56575565
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-
56665566template <typename CharType>
56675567static inline int WriteHelper (i::Isolate* isolate, const String* string,
56685568 CharType* buffer, int start, int length,
@@ -5684,22 +5584,13 @@ static inline int WriteHelper(i::Isolate* isolate, const String* string,
56845584 return end - start;
56855585}
56865586
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- }
56925587
56935588int String::WriteOneByte (Isolate* isolate, uint8_t * buffer, int start,
56945589 int length, int options) const {
56955590 return WriteHelper (reinterpret_cast <i::Isolate*>(isolate), this , buffer,
56965591 start, length, options);
56975592}
56985593
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- }
57035594
57045595int String::Write (Isolate* isolate, uint16_t * buffer, int start, int length,
57055596 int options) const {
@@ -6658,12 +6549,6 @@ Local<String> v8::String::Concat(Isolate* v8_isolate, Local<String> left,
66586549 return Utils::ToLocal (result);
66596550}
66606551
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-
66676552MaybeLocal<String> v8::String::NewExternalTwoByte (
66686553 Isolate* isolate, v8::String::ExternalStringResource* resource) {
66696554 CHECK (resource && resource->data ());
@@ -6872,11 +6757,6 @@ bool v8::BooleanObject::ValueOf() const {
68726757 return jsvalue->value ()->IsTrue (isolate);
68736758}
68746759
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- }
68806760
68816761Local<v8::Value> v8::StringObject::New (Isolate* v8_isolate,
68826762 Local<String> value) {
0 commit comments