| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 5bc94bc155e7818c2f7cd7855f868e7fc5760e27..9aaa66335886d7eb6facd721032fcbd6927ce759 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -2624,38 +2624,36 @@ THREADED_TEST(FunctionPrototype) {
|
| CHECK_EQ(v8_run_int32value(script), 321);
|
| }
|
|
|
| -
|
| -THREADED_TEST(InternalFields) {
|
| +THREADED_TEST(EmbedderFields) {
|
| LocalContext env;
|
| v8::Isolate* isolate = env->GetIsolate();
|
| v8::HandleScope scope(isolate);
|
|
|
| Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate);
|
| Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate();
|
| - instance_templ->SetInternalFieldCount(1);
|
| + instance_templ->SetEmbedderFieldCount(1);
|
| Local<v8::Object> obj = templ->GetFunction(env.local())
|
| .ToLocalChecked()
|
| ->NewInstance(env.local())
|
| .ToLocalChecked();
|
| - CHECK_EQ(1, obj->InternalFieldCount());
|
| - CHECK(obj->GetInternalField(0)->IsUndefined());
|
| - obj->SetInternalField(0, v8_num(17));
|
| - CHECK_EQ(17, obj->GetInternalField(0)->Int32Value(env.local()).FromJust());
|
| + CHECK_EQ(1, obj->EmbedderFieldCount());
|
| + CHECK(obj->GetEmbedderField(0)->IsUndefined());
|
| + obj->SetEmbedderField(0, v8_num(17));
|
| + CHECK_EQ(17, obj->GetEmbedderField(0)->Int32Value(env.local()).FromJust());
|
| }
|
|
|
| -
|
| -THREADED_TEST(GlobalObjectInternalFields) {
|
| +THREADED_TEST(GlobalObjectEmbedderFields) {
|
| v8::Isolate* isolate = CcTest::isolate();
|
| v8::HandleScope scope(isolate);
|
| Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(isolate);
|
| - global_template->SetInternalFieldCount(1);
|
| + global_template->SetEmbedderFieldCount(1);
|
| LocalContext env(NULL, global_template);
|
| v8::Local<v8::Object> global_proxy = env->Global();
|
| v8::Local<v8::Object> global = global_proxy->GetPrototype().As<v8::Object>();
|
| - CHECK_EQ(1, global->InternalFieldCount());
|
| - CHECK(global->GetInternalField(0)->IsUndefined());
|
| - global->SetInternalField(0, v8_num(17));
|
| - CHECK_EQ(17, global->GetInternalField(0)->Int32Value(env.local()).FromJust());
|
| + CHECK_EQ(1, global->EmbedderFieldCount());
|
| + CHECK(global->GetEmbedderField(0)->IsUndefined());
|
| + global->SetEmbedderField(0, v8_num(17));
|
| + CHECK_EQ(17, global->GetEmbedderField(0)->Int32Value(env.local()).FromJust());
|
| }
|
|
|
|
|
| @@ -2668,77 +2666,75 @@ THREADED_TEST(GlobalObjectHasRealIndexedProperty) {
|
| CHECK(global->HasRealIndexedProperty(env.local(), 0).FromJust());
|
| }
|
|
|
| -
|
| -static void CheckAlignedPointerInInternalField(Local<v8::Object> obj,
|
| +static void CheckAlignedPointerInEmbedderField(Local<v8::Object> obj,
|
| void* value) {
|
| CHECK_EQ(0, static_cast<int>(reinterpret_cast<uintptr_t>(value) & 0x1));
|
| - obj->SetAlignedPointerInInternalField(0, value);
|
| + obj->SetAlignedPointerInEmbedderField(0, value);
|
| CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
|
| - CHECK_EQ(value, obj->GetAlignedPointerFromInternalField(0));
|
| + CHECK_EQ(value, obj->GetAlignedPointerFromEmbedderField(0));
|
| }
|
|
|
| -
|
| -THREADED_TEST(InternalFieldsAlignedPointers) {
|
| +THREADED_TEST(EmbedderFieldsAlignedPointers) {
|
| LocalContext env;
|
| v8::Isolate* isolate = env->GetIsolate();
|
| v8::HandleScope scope(isolate);
|
|
|
| Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate);
|
| Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate();
|
| - instance_templ->SetInternalFieldCount(1);
|
| + instance_templ->SetEmbedderFieldCount(1);
|
| Local<v8::Object> obj = templ->GetFunction(env.local())
|
| .ToLocalChecked()
|
| ->NewInstance(env.local())
|
| .ToLocalChecked();
|
| - CHECK_EQ(1, obj->InternalFieldCount());
|
| + CHECK_EQ(1, obj->EmbedderFieldCount());
|
|
|
| - CheckAlignedPointerInInternalField(obj, NULL);
|
| + CheckAlignedPointerInEmbedderField(obj, NULL);
|
|
|
| int* heap_allocated = new int[100];
|
| - CheckAlignedPointerInInternalField(obj, heap_allocated);
|
| + CheckAlignedPointerInEmbedderField(obj, heap_allocated);
|
| delete[] heap_allocated;
|
|
|
| int stack_allocated[100];
|
| - CheckAlignedPointerInInternalField(obj, stack_allocated);
|
| + CheckAlignedPointerInEmbedderField(obj, stack_allocated);
|
|
|
| void* huge = reinterpret_cast<void*>(~static_cast<uintptr_t>(1));
|
| - CheckAlignedPointerInInternalField(obj, huge);
|
| + CheckAlignedPointerInEmbedderField(obj, huge);
|
|
|
| v8::Global<v8::Object> persistent(isolate, obj);
|
| - CHECK_EQ(1, Object::InternalFieldCount(persistent));
|
| - CHECK_EQ(huge, Object::GetAlignedPointerFromInternalField(persistent, 0));
|
| + CHECK_EQ(1, Object::EmbedderFieldCount(persistent));
|
| + CHECK_EQ(huge, Object::GetAlignedPointerFromEmbedderField(persistent, 0));
|
| }
|
|
|
| -THREADED_TEST(SetAlignedPointerInInternalFields) {
|
| +THREADED_TEST(SetAlignedPointerInEmbedderFields) {
|
| LocalContext env;
|
| v8::Isolate* isolate = env->GetIsolate();
|
| v8::HandleScope scope(isolate);
|
|
|
| Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate);
|
| Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate();
|
| - instance_templ->SetInternalFieldCount(2);
|
| + instance_templ->SetEmbedderFieldCount(2);
|
| Local<v8::Object> obj = templ->GetFunction(env.local())
|
| .ToLocalChecked()
|
| ->NewInstance(env.local())
|
| .ToLocalChecked();
|
| - CHECK_EQ(2, obj->InternalFieldCount());
|
| + CHECK_EQ(2, obj->EmbedderFieldCount());
|
|
|
| int* heap_allocated_1 = new int[100];
|
| int* heap_allocated_2 = new int[100];
|
| int indices[] = {0, 1};
|
| void* values[] = {heap_allocated_1, heap_allocated_2};
|
|
|
| - obj->SetAlignedPointerInInternalFields(2, indices, values);
|
| + obj->SetAlignedPointerInEmbedderFields(2, indices, values);
|
| CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
|
| - CHECK_EQ(heap_allocated_1, obj->GetAlignedPointerFromInternalField(0));
|
| - CHECK_EQ(heap_allocated_2, obj->GetAlignedPointerFromInternalField(1));
|
| + CHECK_EQ(heap_allocated_1, obj->GetAlignedPointerFromEmbedderField(0));
|
| + CHECK_EQ(heap_allocated_2, obj->GetAlignedPointerFromEmbedderField(1));
|
|
|
| indices[0] = 1;
|
| indices[1] = 0;
|
| - obj->SetAlignedPointerInInternalFields(2, indices, values);
|
| + obj->SetAlignedPointerInEmbedderFields(2, indices, values);
|
| CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
|
| - CHECK_EQ(heap_allocated_2, obj->GetAlignedPointerFromInternalField(0));
|
| - CHECK_EQ(heap_allocated_1, obj->GetAlignedPointerFromInternalField(1));
|
| + CHECK_EQ(heap_allocated_2, obj->GetAlignedPointerFromEmbedderField(0));
|
| + CHECK_EQ(heap_allocated_1, obj->GetAlignedPointerFromEmbedderField(1));
|
|
|
| delete[] heap_allocated_1;
|
| delete[] heap_allocated_2;
|
| @@ -3402,10 +3398,10 @@ class ScopedArrayBufferContents {
|
| };
|
|
|
| template <typename T>
|
| -static void CheckInternalFieldsAreZero(v8::Local<T> value) {
|
| - CHECK_EQ(T::kInternalFieldCount, value->InternalFieldCount());
|
| - for (int i = 0; i < value->InternalFieldCount(); i++) {
|
| - CHECK_EQ(0, value->GetInternalField(i)
|
| +static void CheckEmbedderFieldsAreZero(v8::Local<T> value) {
|
| + CHECK_EQ(T::kEmbedderFieldCount, value->EmbedderFieldCount());
|
| + for (int i = 0; i < value->EmbedderFieldCount(); i++) {
|
| + CHECK_EQ(0, value->GetEmbedderField(i)
|
| ->Int32Value(CcTest::isolate()->GetCurrentContext())
|
| .FromJust());
|
| }
|
| @@ -3418,7 +3414,7 @@ THREADED_TEST(ArrayBuffer_ApiInternalToExternal) {
|
| v8::HandleScope handle_scope(isolate);
|
|
|
| Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, 1024);
|
| - CheckInternalFieldsAreZero(ab);
|
| + CheckEmbedderFieldsAreZero(ab);
|
| CHECK_EQ(1024, static_cast<int>(ab->ByteLength()));
|
| CHECK(!ab->IsExternal());
|
| CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
|
| @@ -3461,7 +3457,7 @@ THREADED_TEST(ArrayBuffer_JSInternalToExternal) {
|
| "u8_a[0] = 0xAA;"
|
| "u8_a[1] = 0xFF; u8_a.buffer");
|
| Local<v8::ArrayBuffer> ab1 = Local<v8::ArrayBuffer>::Cast(result);
|
| - CheckInternalFieldsAreZero(ab1);
|
| + CheckEmbedderFieldsAreZero(ab1);
|
| CHECK_EQ(2, static_cast<int>(ab1->ByteLength()));
|
| CHECK(!ab1->IsExternal());
|
| ScopedArrayBufferContents ab1_contents(ab1->Externalize());
|
| @@ -3501,7 +3497,7 @@ THREADED_TEST(ArrayBuffer_External) {
|
| memset(my_data.start(), 0, 100);
|
| Local<v8::ArrayBuffer> ab3 =
|
| v8::ArrayBuffer::New(isolate, my_data.start(), 100);
|
| - CheckInternalFieldsAreZero(ab3);
|
| + CheckEmbedderFieldsAreZero(ab3);
|
| CHECK_EQ(100, static_cast<int>(ab3->ByteLength()));
|
| CHECK(ab3->IsExternal());
|
|
|
| @@ -3572,7 +3568,7 @@ template <typename TypedArray, int kElementSize>
|
| static Local<TypedArray> CreateAndCheck(Local<v8::ArrayBuffer> ab,
|
| int byteOffset, int length) {
|
| v8::Local<TypedArray> ta = TypedArray::New(ab, byteOffset, length);
|
| - CheckInternalFieldsAreZero<v8::ArrayBufferView>(ta);
|
| + CheckEmbedderFieldsAreZero<v8::ArrayBufferView>(ta);
|
| CHECK_EQ(byteOffset, static_cast<int>(ta->ByteOffset()));
|
| CHECK_EQ(length, static_cast<int>(ta->Length()));
|
| CHECK_EQ(length * kElementSize, static_cast<int>(ta->ByteLength()));
|
| @@ -3610,7 +3606,7 @@ THREADED_TEST(ArrayBuffer_NeuteringApi) {
|
| CreateAndCheck<v8::Float64Array, 8>(buffer, 8, 127);
|
|
|
| v8::Local<v8::DataView> dv = v8::DataView::New(buffer, 1, 1023);
|
| - CheckInternalFieldsAreZero<v8::ArrayBufferView>(dv);
|
| + CheckEmbedderFieldsAreZero<v8::ArrayBufferView>(dv);
|
| CHECK_EQ(1, static_cast<int>(dv->ByteOffset()));
|
| CHECK_EQ(1023, static_cast<int>(dv->ByteLength()));
|
|
|
| @@ -3694,7 +3690,7 @@ THREADED_TEST(SharedArrayBuffer_ApiInternalToExternal) {
|
| v8::HandleScope handle_scope(isolate);
|
|
|
| Local<v8::SharedArrayBuffer> ab = v8::SharedArrayBuffer::New(isolate, 1024);
|
| - CheckInternalFieldsAreZero(ab);
|
| + CheckEmbedderFieldsAreZero(ab);
|
| CHECK_EQ(1024, static_cast<int>(ab->ByteLength()));
|
| CHECK(!ab->IsExternal());
|
| CcTest::CollectAllGarbage(i::Heap::kFinalizeIncrementalMarkingMask);
|
| @@ -3738,7 +3734,7 @@ THREADED_TEST(SharedArrayBuffer_JSInternalToExternal) {
|
| "u8_a[0] = 0xAA;"
|
| "u8_a[1] = 0xFF; u8_a.buffer");
|
| Local<v8::SharedArrayBuffer> ab1 = Local<v8::SharedArrayBuffer>::Cast(result);
|
| - CheckInternalFieldsAreZero(ab1);
|
| + CheckEmbedderFieldsAreZero(ab1);
|
| CHECK_EQ(2, static_cast<int>(ab1->ByteLength()));
|
| CHECK(!ab1->IsExternal());
|
| ScopedSharedArrayBufferContents ab1_contents(ab1->Externalize());
|
| @@ -3779,7 +3775,7 @@ THREADED_TEST(SharedArrayBuffer_External) {
|
| memset(my_data.start(), 0, 100);
|
| Local<v8::SharedArrayBuffer> ab3 =
|
| v8::SharedArrayBuffer::New(isolate, my_data.start(), 100);
|
| - CheckInternalFieldsAreZero(ab3);
|
| + CheckEmbedderFieldsAreZero(ab3);
|
| CHECK_EQ(100, static_cast<int>(ab3->ByteLength()));
|
| CHECK(ab3->IsExternal());
|
|
|
| @@ -4227,7 +4223,7 @@ Local<v8::Object> NewObjectForIntKey(
|
| int key) {
|
| auto local = Local<v8::ObjectTemplate>::New(isolate, templ);
|
| auto obj = local->NewInstance(isolate->GetCurrentContext()).ToLocalChecked();
|
| - obj->SetAlignedPointerInInternalField(0, IntKeyToVoidPointer(key));
|
| + obj->SetAlignedPointerInEmbedderField(0, IntKeyToVoidPointer(key));
|
| return obj;
|
| }
|
|
|
| @@ -4237,7 +4233,7 @@ class PhantomStdMapTraits : public v8::StdMapTraits<K, V> {
|
| public:
|
| typedef typename v8::GlobalValueMap<K, V, PhantomStdMapTraits<K, V>> MapType;
|
| static const v8::PersistentContainerCallbackType kCallbackType =
|
| - v8::kWeakWithInternalFields;
|
| + v8::kWeakWithEmbedderFields;
|
| struct WeakCallbackDataType {
|
| MapType* map;
|
| K key;
|
| @@ -4260,14 +4256,14 @@ class PhantomStdMapTraits : public v8::StdMapTraits<K, V> {
|
| static void DisposeCallbackData(WeakCallbackDataType* data) { delete data; }
|
| static void Dispose(v8::Isolate* isolate, v8::Global<V> value, K key) {
|
| CHECK_EQ(IntKeyToVoidPointer(key),
|
| - v8::Object::GetAlignedPointerFromInternalField(value, 0));
|
| + v8::Object::GetAlignedPointerFromEmbedderField(value, 0));
|
| }
|
| static void OnWeakCallback(
|
| const v8::WeakCallbackInfo<WeakCallbackDataType>&) {}
|
| static void DisposeWeak(
|
| const v8::WeakCallbackInfo<WeakCallbackDataType>& info) {
|
| K key = KeyFromWeakCallbackInfo(info);
|
| - CHECK_EQ(IntKeyToVoidPointer(key), info.GetInternalField(0));
|
| + CHECK_EQ(IntKeyToVoidPointer(key), info.GetEmbedderField(0));
|
| DisposeCallbackData(info.GetParameter());
|
| }
|
| };
|
| @@ -4281,7 +4277,7 @@ void TestGlobalValueMap() {
|
| {
|
| HandleScope scope(isolate);
|
| auto t = ObjectTemplate::New(isolate);
|
| - t->SetInternalFieldCount(1);
|
| + t->SetEmbedderFieldCount(1);
|
| templ.Reset(isolate, t);
|
| }
|
| Map map(isolate);
|
| @@ -7547,21 +7543,19 @@ class Trivial2 {
|
| int x_;
|
| };
|
|
|
| -
|
| -void CheckInternalFields(
|
| +void CheckEmbedderFields(
|
| const v8::WeakCallbackInfo<v8::Persistent<v8::Object>>& data) {
|
| v8::Persistent<v8::Object>* handle = data.GetParameter();
|
| handle->Reset();
|
| - Trivial* t1 = reinterpret_cast<Trivial*>(data.GetInternalField(0));
|
| - Trivial2* t2 = reinterpret_cast<Trivial2*>(data.GetInternalField(1));
|
| + Trivial* t1 = reinterpret_cast<Trivial*>(data.GetEmbedderField(0));
|
| + Trivial2* t2 = reinterpret_cast<Trivial2*>(data.GetEmbedderField(1));
|
| CHECK_EQ(42, t1->x());
|
| CHECK_EQ(103, t2->x());
|
| t1->set_x(1729);
|
| t2->set_x(33550336);
|
| }
|
|
|
| -
|
| -void InternalFieldCallback(bool global_gc) {
|
| +void EmbedderFieldCallback(bool global_gc) {
|
| LocalContext env;
|
| v8::Isolate* isolate = env->GetIsolate();
|
| v8::HandleScope scope(isolate);
|
| @@ -7570,7 +7564,7 @@ void InternalFieldCallback(bool global_gc) {
|
| Local<v8::ObjectTemplate> instance_templ = templ->InstanceTemplate();
|
| Trivial* t1;
|
| Trivial2* t2;
|
| - instance_templ->SetInternalFieldCount(2);
|
| + instance_templ->SetEmbedderFieldCount(2);
|
| v8::Persistent<v8::Object> handle;
|
| {
|
| v8::HandleScope scope(isolate);
|
| @@ -7579,22 +7573,22 @@ void InternalFieldCallback(bool global_gc) {
|
| ->NewInstance(env.local())
|
| .ToLocalChecked();
|
| handle.Reset(isolate, obj);
|
| - CHECK_EQ(2, obj->InternalFieldCount());
|
| - CHECK(obj->GetInternalField(0)->IsUndefined());
|
| + CHECK_EQ(2, obj->EmbedderFieldCount());
|
| + CHECK(obj->GetEmbedderField(0)->IsUndefined());
|
| t1 = new Trivial(42);
|
| t2 = new Trivial2(103, 9);
|
|
|
| - obj->SetAlignedPointerInInternalField(0, t1);
|
| - t1 = reinterpret_cast<Trivial*>(obj->GetAlignedPointerFromInternalField(0));
|
| + obj->SetAlignedPointerInEmbedderField(0, t1);
|
| + t1 = reinterpret_cast<Trivial*>(obj->GetAlignedPointerFromEmbedderField(0));
|
| CHECK_EQ(42, t1->x());
|
|
|
| - obj->SetAlignedPointerInInternalField(1, t2);
|
| + obj->SetAlignedPointerInEmbedderField(1, t2);
|
| t2 =
|
| - reinterpret_cast<Trivial2*>(obj->GetAlignedPointerFromInternalField(1));
|
| + reinterpret_cast<Trivial2*>(obj->GetAlignedPointerFromEmbedderField(1));
|
| CHECK_EQ(103, t2->x());
|
|
|
| handle.SetWeak<v8::Persistent<v8::Object>>(
|
| - &handle, CheckInternalFields, v8::WeakCallbackType::kInternalFields);
|
| + &handle, CheckEmbedderFields, v8::WeakCallbackType::kEmbedderFields);
|
| if (!global_gc) {
|
| handle.MarkIndependent();
|
| }
|
| @@ -7612,10 +7606,9 @@ void InternalFieldCallback(bool global_gc) {
|
| delete t2;
|
| }
|
|
|
| -
|
| -THREADED_TEST(InternalFieldCallback) {
|
| - InternalFieldCallback(false);
|
| - InternalFieldCallback(true);
|
| +THREADED_TEST(EmbedderFieldCallback) {
|
| + EmbedderFieldCallback(false);
|
| + EmbedderFieldCallback(true);
|
| }
|
|
|
|
|
| @@ -14599,9 +14592,8 @@ TEST(Regress51719) {
|
| isolate->AdjustAmountOfExternalAllocatedMemory(kTriggerGCSize);
|
| }
|
|
|
| -
|
| -// Regression test for issue 54, object templates with internal fields
|
| -// but no accessors or interceptors did not get their internal field
|
| +// Regression test for issue 54, object templates with embedder fields
|
| +// but no accessors or interceptors did not get their embedder field
|
| // count set on instances.
|
| THREADED_TEST(Regress54) {
|
| LocalContext context;
|
| @@ -14611,14 +14603,14 @@ THREADED_TEST(Regress54) {
|
| if (templ.IsEmpty()) {
|
| v8::EscapableHandleScope inner(isolate);
|
| v8::Local<v8::ObjectTemplate> local = v8::ObjectTemplate::New(isolate);
|
| - local->SetInternalFieldCount(1);
|
| + local->SetEmbedderFieldCount(1);
|
| templ.Reset(isolate, inner.Escape(local));
|
| }
|
| v8::Local<v8::Object> result =
|
| v8::Local<v8::ObjectTemplate>::New(isolate, templ)
|
| ->NewInstance(context.local())
|
| .ToLocalChecked();
|
| - CHECK_EQ(1, result->InternalFieldCount());
|
| + CHECK_EQ(1, result->EmbedderFieldCount());
|
| }
|
|
|
|
|
| @@ -16452,7 +16444,7 @@ void TypedArrayTestHelper(i::ExternalArrayType array_type, int64_t low,
|
| (kElementCount + 2) * sizeof(ElementType));
|
| Local<TypedArray> ta =
|
| TypedArray::New(ab, 2*sizeof(ElementType), kElementCount);
|
| - CheckInternalFieldsAreZero<v8::ArrayBufferView>(ta);
|
| + CheckEmbedderFieldsAreZero<v8::ArrayBufferView>(ta);
|
| CHECK_EQ(kElementCount, static_cast<int>(ta->Length()));
|
| CHECK_EQ(2 * sizeof(ElementType), ta->ByteOffset());
|
| CHECK_EQ(kElementCount * sizeof(ElementType), ta->ByteLength());
|
| @@ -16537,7 +16529,7 @@ THREADED_TEST(DataView) {
|
| Local<v8::ArrayBuffer> ab =
|
| v8::ArrayBuffer::New(isolate, backing_store.start(), 2 + kSize);
|
| Local<v8::DataView> dv = v8::DataView::New(ab, 2, kSize);
|
| - CheckInternalFieldsAreZero<v8::ArrayBufferView>(dv);
|
| + CheckEmbedderFieldsAreZero<v8::ArrayBufferView>(dv);
|
| CHECK_EQ(2u, dv->ByteOffset());
|
| CHECK_EQ(kSize, static_cast<int>(dv->ByteLength()));
|
| CHECK(ab->Equals(env.local(), dv->Buffer()).FromJust());
|
| @@ -16677,13 +16669,12 @@ THREADED_TEST(SharedDataView) {
|
| v8::SharedArrayBuffer::New(isolate, backing_store.start(), 2 + kSize);
|
| Local<v8::DataView> dv =
|
| v8::DataView::New(ab, 2, kSize);
|
| - CheckInternalFieldsAreZero<v8::ArrayBufferView>(dv);
|
| + CheckEmbedderFieldsAreZero<v8::ArrayBufferView>(dv);
|
| CHECK_EQ(2u, dv->ByteOffset());
|
| CHECK_EQ(kSize, static_cast<int>(dv->ByteLength()));
|
| CHECK(ab->Equals(env.local(), dv->Buffer()).FromJust());
|
| }
|
|
|
| -
|
| #define IS_ARRAY_BUFFER_VIEW_TEST(View) \
|
| THREADED_TEST(Is##View) { \
|
| LocalContext env; \
|
| @@ -16695,7 +16686,7 @@ THREADED_TEST(SharedDataView) {
|
| "new " #View "(ab)"); \
|
| CHECK(result->IsArrayBufferView()); \
|
| CHECK(result->Is##View()); \
|
| - CheckInternalFieldsAreZero<v8::ArrayBufferView>(result.As<v8::View>()); \
|
| + CheckEmbedderFieldsAreZero<v8::ArrayBufferView>(result.As<v8::View>()); \
|
| }
|
|
|
| IS_ARRAY_BUFFER_VIEW_TEST(Uint8Array)
|
| @@ -22492,10 +22483,10 @@ THREADED_TEST(Regress2535) {
|
| v8::HandleScope scope(context->GetIsolate());
|
| Local<Value> set_value = CompileRun("new Set();");
|
| Local<Object> set_object(Local<Object>::Cast(set_value));
|
| - CHECK_EQ(0, set_object->InternalFieldCount());
|
| + CHECK_EQ(0, set_object->EmbedderFieldCount());
|
| Local<Value> map_value = CompileRun("new Map();");
|
| Local<Object> map_object(Local<Object>::Cast(map_value));
|
| - CHECK_EQ(0, map_object->InternalFieldCount());
|
| + CHECK_EQ(0, map_object->EmbedderFieldCount());
|
| }
|
|
|
|
|
| @@ -26250,16 +26241,16 @@ THREADED_TEST(ImmutableProtoWithParent) {
|
| .FromJust());
|
| }
|
|
|
| -TEST(InternalFieldsOnGlobalProxy) {
|
| +TEST(EmbedderFieldsOnGlobalProxy) {
|
| v8::Isolate* isolate = CcTest::isolate();
|
| v8::HandleScope scope(isolate);
|
|
|
| v8::Local<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(isolate);
|
| - obj_template->SetInternalFieldCount(1);
|
| + obj_template->SetEmbedderFieldCount(1);
|
|
|
| v8::Local<v8::Context> context = Context::New(isolate, nullptr, obj_template);
|
| v8::Local<v8::Object> global = context->Global();
|
| - CHECK_EQ(1, global->InternalFieldCount());
|
| + CHECK_EQ(1, global->EmbedderFieldCount());
|
| }
|
|
|
| THREADED_TEST(ImmutableProtoGlobal) {
|
| @@ -26303,7 +26294,7 @@ THREADED_TEST(MutableProtoGlobal) {
|
| .FromJust());
|
| }
|
|
|
| -TEST(InternalFieldsOnTypedArray) {
|
| +TEST(EmbedderFieldsOnTypedArray) {
|
| LocalContext env;
|
| v8::Isolate* isolate = env->GetIsolate();
|
| v8::HandleScope scope(isolate);
|
| @@ -26311,13 +26302,13 @@ TEST(InternalFieldsOnTypedArray) {
|
| Context::Scope context_scope(context);
|
| v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(isolate, 1);
|
| v8::Local<v8::Uint8Array> array = v8::Uint8Array::New(buffer, 0, 1);
|
| - for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) {
|
| + for (int i = 0; i < v8::ArrayBufferView::kEmbedderFieldCount; i++) {
|
| CHECK_EQ(static_cast<void*>(nullptr),
|
| - array->GetAlignedPointerFromInternalField(i));
|
| + array->GetAlignedPointerFromEmbedderField(i));
|
| }
|
| }
|
|
|
| -TEST(InternalFieldsOnDataView) {
|
| +TEST(EmbedderFieldsOnDataView) {
|
| LocalContext env;
|
| v8::Isolate* isolate = env->GetIsolate();
|
| v8::HandleScope scope(isolate);
|
| @@ -26325,9 +26316,9 @@ TEST(InternalFieldsOnDataView) {
|
| Context::Scope context_scope(context);
|
| v8::Local<v8::ArrayBuffer> buffer = v8::ArrayBuffer::New(isolate, 1);
|
| v8::Local<v8::DataView> array = v8::DataView::New(buffer, 0, 1);
|
| - for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) {
|
| + for (int i = 0; i < v8::ArrayBufferView::kEmbedderFieldCount; i++) {
|
| CHECK_EQ(static_cast<void*>(nullptr),
|
| - array->GetAlignedPointerFromInternalField(i));
|
| + array->GetAlignedPointerFromEmbedderField(i));
|
| }
|
| }
|
|
|
|
|