Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: src/api.cc

Issue 1149203003: Revert of Implement SharedArrayBuffer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.h ('k') | src/arraybuffer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 709dcc2b8215072581d28f08aef14eece9ba9a5e..125a31be06f94b802e9f61a465335ee641b8c189 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2677,8 +2677,7 @@
bool Value::IsArrayBuffer() const {
- i::Handle<i::Object> obj = Utils::OpenHandle(this);
- return obj->IsJSArrayBuffer() && !i::JSArrayBuffer::cast(*obj)->is_shared();
+ return Utils::OpenHandle(this)->IsJSArrayBuffer();
}
@@ -2699,7 +2698,6 @@
i::JSTypedArray::cast(*obj)->type() == i::kExternal##Type##Array; \
}
-
TYPED_ARRAYS(VALUE_IS_TYPED_ARRAY)
#undef VALUE_IS_TYPED_ARRAY
@@ -2707,12 +2705,6 @@
bool Value::IsDataView() const {
return Utils::OpenHandle(this)->IsJSDataView();
-}
-
-
-bool Value::IsSharedArrayBuffer() const {
- i::Handle<i::Object> obj = Utils::OpenHandle(this);
- return obj->IsJSArrayBuffer() && i::JSArrayBuffer::cast(*obj)->is_shared();
}
@@ -3092,9 +3084,9 @@
void v8::ArrayBuffer::CheckCast(Value* that) {
i::Handle<i::Object> obj = Utils::OpenHandle(that);
- Utils::ApiCheck(
- obj->IsJSArrayBuffer() && !i::JSArrayBuffer::cast(*obj)->is_shared(),
- "v8::ArrayBuffer::Cast()", "Could not convert to ArrayBuffer");
+ Utils::ApiCheck(obj->IsJSArrayBuffer(),
+ "v8::ArrayBuffer::Cast()",
+ "Could not convert to ArrayBuffer");
}
@@ -3134,15 +3126,6 @@
Utils::ApiCheck(obj->IsJSDataView(),
"v8::DataView::Cast()",
"Could not convert to DataView");
-}
-
-
-void v8::SharedArrayBuffer::CheckCast(Value* that) {
- i::Handle<i::Object> obj = Utils::OpenHandle(that);
- Utils::ApiCheck(
- obj->IsJSArrayBuffer() && i::JSArrayBuffer::cast(*obj)->is_shared(),
- "v8::SharedArrayBuffer::Cast()",
- "Could not convert to SharedArrayBuffer");
}
@@ -6320,7 +6303,7 @@
LOG_API(i_isolate, "v8::ArrayBuffer::New(size_t)");
ENTER_V8(i_isolate);
i::Handle<i::JSArrayBuffer> obj =
- i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kNotShared);
+ i_isolate->factory()->NewJSArrayBuffer();
i::Runtime::SetupArrayBufferAllocatingData(i_isolate, obj, byte_length);
return Utils::ToLocal(obj);
}
@@ -6333,7 +6316,7 @@
LOG_API(i_isolate, "v8::ArrayBuffer::New(void*, size_t)");
ENTER_V8(i_isolate);
i::Handle<i::JSArrayBuffer> obj =
- i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kNotShared);
+ i_isolate->factory()->NewJSArrayBuffer();
i::Runtime::SetupArrayBuffer(i_isolate, obj,
mode == ArrayBufferCreationMode::kExternalized,
data, byte_length);
@@ -6439,66 +6422,6 @@
}
-bool v8::SharedArrayBuffer::IsExternal() const {
- return Utils::OpenHandle(this)->is_external();
-}
-
-
-v8::SharedArrayBuffer::Contents v8::SharedArrayBuffer::Externalize() {
- i::Handle<i::JSArrayBuffer> self = Utils::OpenHandle(this);
- i::Isolate* isolate = self->GetIsolate();
- Utils::ApiCheck(!self->is_external(), "v8::SharedArrayBuffer::Externalize",
- "SharedArrayBuffer already externalized");
- self->set_is_external(true);
- isolate->heap()->UnregisterArrayBuffer(self->backing_store());
- return GetContents();
-}
-
-
-v8::SharedArrayBuffer::Contents v8::SharedArrayBuffer::GetContents() {
- i::Handle<i::JSArrayBuffer> self = Utils::OpenHandle(this);
- size_t byte_length = static_cast<size_t>(self->byte_length()->Number());
- Contents contents;
- contents.data_ = self->backing_store();
- contents.byte_length_ = byte_length;
- return contents;
-}
-
-
-size_t v8::SharedArrayBuffer::ByteLength() const {
- i::Handle<i::JSArrayBuffer> obj = Utils::OpenHandle(this);
- return static_cast<size_t>(obj->byte_length()->Number());
-}
-
-
-Local<SharedArrayBuffer> v8::SharedArrayBuffer::New(Isolate* isolate,
- size_t byte_length) {
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
- LOG_API(i_isolate, "v8::SharedArrayBuffer::New(size_t)");
- ENTER_V8(i_isolate);
- i::Handle<i::JSArrayBuffer> obj =
- i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kShared);
- i::Runtime::SetupArrayBufferAllocatingData(i_isolate, obj, byte_length, true,
- i::SharedFlag::kShared);
- return Utils::ToLocalShared(obj);
-}
-
-
-Local<SharedArrayBuffer> v8::SharedArrayBuffer::New(
- Isolate* isolate, void* data, size_t byte_length,
- ArrayBufferCreationMode mode) {
- i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
- LOG_API(i_isolate, "v8::SharedArrayBuffer::New(void*, size_t)");
- ENTER_V8(i_isolate);
- i::Handle<i::JSArrayBuffer> obj =
- i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kShared);
- i::Runtime::SetupArrayBuffer(i_isolate, obj,
- mode == ArrayBufferCreationMode::kExternalized,
- data, byte_length, i::SharedFlag::kShared);
- return Utils::ToLocalShared(obj);
-}
-
-
Local<Symbol> v8::Symbol::New(Isolate* isolate, Local<String> name) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
LOG_API(i_isolate, "Symbol::New()");
« no previous file with comments | « src/api.h ('k') | src/arraybuffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698