@@ -5702,12 +5702,10 @@ static bool RecursivelySerializeToUtf8(i::String* current,
5702
5702
}
5703
5703
5704
5704
5705
- int String::WriteUtf8 (char * buffer,
5706
- int capacity,
5707
- int * nchars_ref,
5708
- int options) const {
5705
+ int String::WriteUtf8 (Isolate* v8_isolate, char * buffer, int capacity,
5706
+ int * nchars_ref, int options) const {
5709
5707
i::Handle <i::String> str = Utils::OpenHandle (this );
5710
- i::Isolate* isolate = str-> GetIsolate ( );
5708
+ i::Isolate* isolate = reinterpret_cast <i::Isolate*>(v8_isolate );
5711
5709
LOG_API (isolate, String, WriteUtf8);
5712
5710
ENTER_V8_NO_SCRIPT_NO_EXCEPTION (isolate);
5713
5711
str = i::String::Flatten (str); // Flatten the string for efficiency.
@@ -5748,14 +5746,18 @@ int String::WriteUtf8(char* buffer,
5748
5746
return writer.CompleteWrite (write_null, nchars_ref);
5749
5747
}
5750
5748
5749
+ int String::WriteUtf8 (char * buffer, int capacity, int * nchars_ref,
5750
+ int options) const {
5751
+ i::Handle <i::String> str = Utils::OpenHandle (this );
5752
+ i::Isolate* isolate = str->GetIsolate ();
5753
+ return WriteUtf8 (reinterpret_cast <Isolate*>(isolate), buffer, capacity,
5754
+ nchars_ref, options);
5755
+ }
5751
5756
5752
- template <typename CharType>
5753
- static inline int WriteHelper (const String* string,
5754
- CharType* buffer,
5755
- int start,
5756
- int length,
5757
+ template <typename CharType>
5758
+ static inline int WriteHelper (i::Isolate* isolate, const String* string,
5759
+ CharType* buffer, int start, int length,
5757
5760
int options) {
5758
- i::Isolate* isolate = Utils::OpenHandle (string)->GetIsolate ();
5759
5761
LOG_API (isolate, String, Write);
5760
5762
ENTER_V8_NO_SCRIPT_NO_EXCEPTION (isolate);
5761
5763
DCHECK (start >= 0 && length >= -1 );
@@ -5778,15 +5780,29 @@ int String::WriteOneByte(uint8_t* buffer,
5778
5780
int start,
5779
5781
int length,
5780
5782
int options) const {
5781
- return WriteHelper (this , buffer, start, length, options);
5783
+ i::Isolate* isolate = Utils::OpenHandle (this )->GetIsolate ();
5784
+ return WriteHelper (isolate, this , buffer, start, length, options);
5785
+ }
5786
+
5787
+ int String::WriteOneByte (Isolate* isolate, uint8_t * buffer, int start,
5788
+ int length, int options) const {
5789
+ return WriteHelper (reinterpret_cast <i::Isolate*>(isolate), this , buffer,
5790
+ start, length, options);
5782
5791
}
5783
5792
5784
5793
5785
5794
int String::Write (uint16_t * buffer,
5786
5795
int start,
5787
5796
int length,
5788
5797
int options) const {
5789
- return WriteHelper (this , buffer, start, length, options);
5798
+ i::Isolate* isolate = Utils::OpenHandle (this )->GetIsolate ();
5799
+ return WriteHelper (isolate, this , buffer, start, length, options);
5800
+ }
5801
+
5802
+ int String::Write (Isolate* isolate, uint16_t * buffer, int start, int length,
5803
+ int options) const {
5804
+ return WriteHelper (reinterpret_cast <i::Isolate*>(isolate), this , buffer,
5805
+ start, length, options);
5790
5806
}
5791
5807
5792
5808
0 commit comments