[JSC] Implement ArrayBuffer and typed array cloning in JSC
authordslomov@google.com <dslomov@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2012 02:51:20 +0000 (02:51 +0000)
committerdslomov@google.com <dslomov@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Feb 2012 02:51:20 +0000 (02:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79294

Reviewed by Oliver Hunt.

Source/WebCore:

Covered by existing tests.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::typedArrayElementSize):
(WebCore):
(WebCore::CloneSerializer::dumpArrayBufferView):
(CloneSerializer):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::readArrayBufferViewSubtag):
(CloneDeserializer):
(WebCore::CloneDeserializer::readArrayBuffer):
(WebCore::CloneDeserializer::readArrayBufferView):
(WebCore::CloneDeserializer::getJSValue):
(WebCore::CloneDeserializer::readTerminal):

LayoutTests:

* fast/canvas/webgl/array-message-passing-expected.txt: Updated expectation after cloning implemented.
* fast/canvas/webgl/script-tests/array-message-passing.js: Added Uint8ClampedArray
* platform/chromium/fast/canvas/webgl/array-message-passing-expected.txt: Updated expectations. Fixing covered by https://bugs.webkit.org/show_bug.cgi?id=79291

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108594 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/array-message-passing-expected.txt
LayoutTests/fast/canvas/webgl/script-tests/array-message-passing.js
LayoutTests/platform/chromium/fast/canvas/webgl/array-message-passing-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/SerializedScriptValue.cpp

index 74b5a77..45cdf84 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-22  Dmitry Lomov  <dslomov@google.com>
+
+        [JSC] Implement ArrayBuffer and typed array cloning in JSC
+        https://bugs.webkit.org/show_bug.cgi?id=79294
+
+        Reviewed by Oliver Hunt.
+
+        * fast/canvas/webgl/array-message-passing-expected.txt: Updated expectation after cloning implemented.
+        * fast/canvas/webgl/script-tests/array-message-passing.js: Added Uint8ClampedArray
+        * platform/chromium/fast/canvas/webgl/array-message-passing-expected.txt: Updated expectations. Fixing covered by https://bugs.webkit.org/show_bug.cgi?id=79291
+
 2012-02-22  Raymond Toy  <rtoy@google.com>
 
         exponentialRampToValue doesn't use starting value
index 337f9ad..3936f52 100644 (file)
@@ -2,106 +2,663 @@ Test passing ArrayBuffers and ArrayBufferViews in messages.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-FAIL ArrayBuffer0: class [object ArrayBuffer] became [object Object]
-FAIL ArrayBuffer1: class [object ArrayBuffer] became [object Object]
-FAIL ArrayBuffer128: class [object ArrayBuffer] became [object Object]
-FAIL DataView0: class [object DataView] became [object Object]
-FAIL DataView1: class [object DataView] became [object Object]
-FAIL DataView128: class [object DataView] became [object Object]
-FAIL DataView1_offset_at_end: class [object DataView] became [object Object]
-FAIL DataView128_offset_at_end: class [object DataView] became [object Object]
-FAIL DataView128_offset_slice_length_0: class [object DataView] became [object Object]
-FAIL DataView128_offset_slice_length_1: class [object DataView] became [object Object]
-FAIL DataView128_offset_slice_length_16: class [object DataView] became [object Object]
-FAIL DataView128_offset_slice_unaligned: class [object DataView] became [object Object]
-FAIL Int32_0: class [object Int32Array] became [object Object]
-FAIL Uint32_0: class [object Uint32Array] became [object Object]
-FAIL Int8_0: class [object Int8Array] became [object Object]
-FAIL Uint8_0: class [object Uint8Array] became [object Object]
-FAIL Int16_0: class [object Int16Array] became [object Object]
-FAIL Uint16_0: class [object Uint16Array] became [object Object]
-FAIL Float32_0: class [object Float32Array] became [object Object]
-FAIL Float64_0: class [object Float64Array] became [object Object]
-FAIL Int32_1: class [object Int32Array] became [object Object]
-FAIL Uint32_1: class [object Uint32Array] became [object Object]
-FAIL Int8_1: class [object Int8Array] became [object Object]
-FAIL Uint8_1: class [object Uint8Array] became [object Object]
-FAIL Int16_1: class [object Int16Array] became [object Object]
-FAIL Uint16_1: class [object Uint16Array] became [object Object]
-FAIL Float32_1: class [object Float32Array] became [object Object]
-FAIL Float64_1: class [object Float64Array] became [object Object]
-FAIL Int32_128: class [object Int32Array] became [object Object]
-FAIL Uint32_128: class [object Uint32Array] became [object Object]
-FAIL Int8_128: class [object Int8Array] became [object Object]
-FAIL Uint8_128: class [object Uint8Array] became [object Object]
-FAIL Int16_128: class [object Int16Array] became [object Object]
-FAIL Uint16_128: class [object Uint16Array] became [object Object]
-FAIL Float32_128: class [object Float32Array] became [object Object]
-FAIL Float64_128: class [object Float64Array] became [object Object]
-FAIL Int32_0_buffer: class [object Int32Array] became [object Object]
-FAIL Uint32_0_buffer: class [object Uint32Array] became [object Object]
-FAIL Int8_0_buffer: class [object Int8Array] became [object Object]
-FAIL Uint8_0_buffer: class [object Uint8Array] became [object Object]
-FAIL Int16_0_buffer: class [object Int16Array] became [object Object]
-FAIL Uint16_0_buffer: class [object Uint16Array] became [object Object]
-FAIL Float32_0_buffer: class [object Float32Array] became [object Object]
-FAIL Float64_0_buffer: class [object Float64Array] became [object Object]
-FAIL Int32_1_buffer: class [object Int32Array] became [object Object]
-FAIL Uint32_1_buffer: class [object Uint32Array] became [object Object]
-FAIL Int8_1_buffer: class [object Int8Array] became [object Object]
-FAIL Uint8_1_buffer: class [object Uint8Array] became [object Object]
-FAIL Int16_1_buffer: class [object Int16Array] became [object Object]
-FAIL Uint16_1_buffer: class [object Uint16Array] became [object Object]
-FAIL Float32_1_buffer: class [object Float32Array] became [object Object]
-FAIL Float64_1_buffer: class [object Float64Array] became [object Object]
-FAIL Int32_128_buffer: class [object Int32Array] became [object Object]
-FAIL Uint32_128_buffer: class [object Uint32Array] became [object Object]
-FAIL Int8_128_buffer: class [object Int8Array] became [object Object]
-FAIL Uint8_128_buffer: class [object Uint8Array] became [object Object]
-FAIL Int16_128_buffer: class [object Int16Array] became [object Object]
-FAIL Uint16_128_buffer: class [object Uint16Array] became [object Object]
-FAIL Float32_128_buffer: class [object Float32Array] became [object Object]
-FAIL Float64_128_buffer: class [object Float64Array] became [object Object]
-FAIL Int32_1_buffer_offset_at_end: class [object Int32Array] became [object Object]
-FAIL Uint32_1_buffer_offset_at_end: class [object Uint32Array] became [object Object]
-FAIL Int8_1_buffer_offset_at_end: class [object Int8Array] became [object Object]
-FAIL Uint8_1_buffer_offset_at_end: class [object Uint8Array] became [object Object]
-FAIL Int16_1_buffer_offset_at_end: class [object Int16Array] became [object Object]
-FAIL Uint16_1_buffer_offset_at_end: class [object Uint16Array] became [object Object]
-FAIL Float32_1_buffer_offset_at_end: class [object Float32Array] became [object Object]
-FAIL Float64_1_buffer_offset_at_end: class [object Float64Array] became [object Object]
-FAIL Int32_128_buffer_offset_at_end: class [object Int32Array] became [object Object]
-FAIL Uint32_128_buffer_offset_at_end: class [object Uint32Array] became [object Object]
-FAIL Int8_128_buffer_offset_at_end: class [object Int8Array] became [object Object]
-FAIL Uint8_128_buffer_offset_at_end: class [object Uint8Array] became [object Object]
-FAIL Int16_128_buffer_offset_at_end: class [object Int16Array] became [object Object]
-FAIL Uint16_128_buffer_offset_at_end: class [object Uint16Array] became [object Object]
-FAIL Float32_128_buffer_offset_at_end: class [object Float32Array] became [object Object]
-FAIL Float64_128_buffer_offset_at_end: class [object Float64Array] became [object Object]
-FAIL Int32_128_buffer_offset_slice_length_0: class [object Int32Array] became [object Object]
-FAIL Uint32_128_buffer_offset_slice_length_0: class [object Uint32Array] became [object Object]
-FAIL Int8_128_buffer_offset_slice_length_0: class [object Int8Array] became [object Object]
-FAIL Uint8_128_buffer_offset_slice_length_0: class [object Uint8Array] became [object Object]
-FAIL Int16_128_buffer_offset_slice_length_0: class [object Int16Array] became [object Object]
-FAIL Uint16_128_buffer_offset_slice_length_0: class [object Uint16Array] became [object Object]
-FAIL Float32_128_buffer_offset_slice_length_0: class [object Float32Array] became [object Object]
-FAIL Float64_128_buffer_offset_slice_length_0: class [object Float64Array] became [object Object]
-FAIL Int32_128_buffer_offset_slice_length_1: class [object Int32Array] became [object Object]
-FAIL Uint32_128_buffer_offset_slice_length_1: class [object Uint32Array] became [object Object]
-FAIL Int8_128_buffer_offset_slice_length_1: class [object Int8Array] became [object Object]
-FAIL Uint8_128_buffer_offset_slice_length_1: class [object Uint8Array] became [object Object]
-FAIL Int16_128_buffer_offset_slice_length_1: class [object Int16Array] became [object Object]
-FAIL Uint16_128_buffer_offset_slice_length_1: class [object Uint16Array] became [object Object]
-FAIL Float32_128_buffer_offset_slice_length_1: class [object Float32Array] became [object Object]
-FAIL Float64_128_buffer_offset_slice_length_1: class [object Float64Array] became [object Object]
-FAIL Int32_128_buffer_offset_slice_length_16: class [object Int32Array] became [object Object]
-FAIL Uint32_128_buffer_offset_slice_length_16: class [object Uint32Array] became [object Object]
-FAIL Int8_128_buffer_offset_slice_length_16: class [object Int8Array] became [object Object]
-FAIL Uint8_128_buffer_offset_slice_length_16: class [object Uint8Array] became [object Object]
-FAIL Int16_128_buffer_offset_slice_length_16: class [object Int16Array] became [object Object]
-FAIL Uint16_128_buffer_offset_slice_length_16: class [object Uint16Array] became [object Object]
-FAIL Float32_128_buffer_offset_slice_length_16: class [object Float32Array] became [object Object]
-FAIL Float64_128_buffer_offset_slice_length_16: class [object Float64Array] became [object Object]
+PASS ArrayBuffer0: classes are [object ArrayBuffer]
+PASS ArrayBuffer0: buffer lengths are 0
+PASS ArrayBuffer0: buffers have the same contents
+PASS ArrayBuffer1: classes are [object ArrayBuffer]
+PASS ArrayBuffer1: buffer lengths are 1
+PASS ArrayBuffer1: buffers have the same contents
+PASS ArrayBuffer128: classes are [object ArrayBuffer]
+PASS ArrayBuffer128: buffer lengths are 128
+PASS ArrayBuffer128: buffers have the same contents
+PASS DataView0: classes are [object DataView]
+PASS DataView0: classes are [object ArrayBuffer]
+PASS DataView0: buffer lengths are 0
+PASS DataView0: buffers have the same contents
+PASS DataView0: offset is 0
+PASS DataView0: length is 0
+PASS DataView1: classes are [object DataView]
+PASS DataView1: classes are [object ArrayBuffer]
+PASS DataView1: buffer lengths are 1
+PASS DataView1: buffers have the same contents
+PASS DataView1: offset is 0
+PASS DataView1: length is 1
+PASS DataView128: classes are [object DataView]
+PASS DataView128: classes are [object ArrayBuffer]
+PASS DataView128: buffer lengths are 128
+PASS DataView128: buffers have the same contents
+PASS DataView128: offset is 0
+PASS DataView128: length is 128
+PASS DataView1_offset_at_end: classes are [object DataView]
+PASS DataView1_offset_at_end: classes are [object ArrayBuffer]
+PASS DataView1_offset_at_end: buffer lengths are 1
+PASS DataView1_offset_at_end: buffers have the same contents
+PASS DataView1_offset_at_end: offset is 1
+PASS DataView1_offset_at_end: length is 0
+PASS DataView128_offset_at_end: classes are [object DataView]
+PASS DataView128_offset_at_end: classes are [object ArrayBuffer]
+PASS DataView128_offset_at_end: buffer lengths are 128
+PASS DataView128_offset_at_end: buffers have the same contents
+PASS DataView128_offset_at_end: offset is 128
+PASS DataView128_offset_at_end: length is 0
+PASS DataView128_offset_slice_length_0: classes are [object DataView]
+PASS DataView128_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS DataView128_offset_slice_length_0: buffer lengths are 128
+PASS DataView128_offset_slice_length_0: buffers have the same contents
+PASS DataView128_offset_slice_length_0: offset is 64
+PASS DataView128_offset_slice_length_0: length is 0
+PASS DataView128_offset_slice_length_1: classes are [object DataView]
+PASS DataView128_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS DataView128_offset_slice_length_1: buffer lengths are 128
+PASS DataView128_offset_slice_length_1: buffers have the same contents
+PASS DataView128_offset_slice_length_1: offset is 64
+PASS DataView128_offset_slice_length_1: length is 1
+PASS DataView128_offset_slice_length_16: classes are [object DataView]
+PASS DataView128_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS DataView128_offset_slice_length_16: buffer lengths are 128
+PASS DataView128_offset_slice_length_16: buffers have the same contents
+PASS DataView128_offset_slice_length_16: offset is 64
+PASS DataView128_offset_slice_length_16: length is 16
+PASS DataView128_offset_slice_unaligned: classes are [object DataView]
+PASS DataView128_offset_slice_unaligned: classes are [object ArrayBuffer]
+PASS DataView128_offset_slice_unaligned: buffer lengths are 128
+PASS DataView128_offset_slice_unaligned: buffers have the same contents
+PASS DataView128_offset_slice_unaligned: offset is 63
+PASS DataView128_offset_slice_unaligned: length is 15
+PASS Int32_0: classes are [object Int32Array]
+PASS Int32_0: classes are [object ArrayBuffer]
+PASS Int32_0: buffer lengths are 0
+PASS Int32_0: buffers have the same contents
+PASS Int32_0: offset is 0
+PASS Int32_0: length is 0
+PASS Uint32_0: classes are [object Uint32Array]
+PASS Uint32_0: classes are [object ArrayBuffer]
+PASS Uint32_0: buffer lengths are 0
+PASS Uint32_0: buffers have the same contents
+PASS Uint32_0: offset is 0
+PASS Uint32_0: length is 0
+PASS Int8_0: classes are [object Int8Array]
+PASS Int8_0: classes are [object ArrayBuffer]
+PASS Int8_0: buffer lengths are 0
+PASS Int8_0: buffers have the same contents
+PASS Int8_0: offset is 0
+PASS Int8_0: length is 0
+PASS Uint8_0: classes are [object Uint8Array]
+PASS Uint8_0: classes are [object ArrayBuffer]
+PASS Uint8_0: buffer lengths are 0
+PASS Uint8_0: buffers have the same contents
+PASS Uint8_0: offset is 0
+PASS Uint8_0: length is 0
+PASS Uint8Clamped_0: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_0: classes are [object ArrayBuffer]
+PASS Uint8Clamped_0: buffer lengths are 0
+PASS Uint8Clamped_0: buffers have the same contents
+PASS Uint8Clamped_0: offset is 0
+PASS Uint8Clamped_0: length is 0
+PASS Int16_0: classes are [object Int16Array]
+PASS Int16_0: classes are [object ArrayBuffer]
+PASS Int16_0: buffer lengths are 0
+PASS Int16_0: buffers have the same contents
+PASS Int16_0: offset is 0
+PASS Int16_0: length is 0
+PASS Uint16_0: classes are [object Uint16Array]
+PASS Uint16_0: classes are [object ArrayBuffer]
+PASS Uint16_0: buffer lengths are 0
+PASS Uint16_0: buffers have the same contents
+PASS Uint16_0: offset is 0
+PASS Uint16_0: length is 0
+PASS Float32_0: classes are [object Float32Array]
+PASS Float32_0: classes are [object ArrayBuffer]
+PASS Float32_0: buffer lengths are 0
+PASS Float32_0: buffers have the same contents
+PASS Float32_0: offset is 0
+PASS Float32_0: length is 0
+PASS Float64_0: classes are [object Float64Array]
+PASS Float64_0: classes are [object ArrayBuffer]
+PASS Float64_0: buffer lengths are 0
+PASS Float64_0: buffers have the same contents
+PASS Float64_0: offset is 0
+PASS Float64_0: length is 0
+PASS Int32_1: classes are [object Int32Array]
+PASS Int32_1: classes are [object ArrayBuffer]
+PASS Int32_1: buffer lengths are 4
+PASS Int32_1: buffers have the same contents
+PASS Int32_1: offset is 0
+PASS Int32_1: length is 4
+PASS Uint32_1: classes are [object Uint32Array]
+PASS Uint32_1: classes are [object ArrayBuffer]
+PASS Uint32_1: buffer lengths are 4
+PASS Uint32_1: buffers have the same contents
+PASS Uint32_1: offset is 0
+PASS Uint32_1: length is 4
+PASS Int8_1: classes are [object Int8Array]
+PASS Int8_1: classes are [object ArrayBuffer]
+PASS Int8_1: buffer lengths are 1
+PASS Int8_1: buffers have the same contents
+PASS Int8_1: offset is 0
+PASS Int8_1: length is 1
+PASS Uint8_1: classes are [object Uint8Array]
+PASS Uint8_1: classes are [object ArrayBuffer]
+PASS Uint8_1: buffer lengths are 1
+PASS Uint8_1: buffers have the same contents
+PASS Uint8_1: offset is 0
+PASS Uint8_1: length is 1
+PASS Uint8Clamped_1: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_1: classes are [object ArrayBuffer]
+PASS Uint8Clamped_1: buffer lengths are 1
+PASS Uint8Clamped_1: buffers have the same contents
+PASS Uint8Clamped_1: offset is 0
+PASS Uint8Clamped_1: length is 1
+PASS Int16_1: classes are [object Int16Array]
+PASS Int16_1: classes are [object ArrayBuffer]
+PASS Int16_1: buffer lengths are 2
+PASS Int16_1: buffers have the same contents
+PASS Int16_1: offset is 0
+PASS Int16_1: length is 2
+PASS Uint16_1: classes are [object Uint16Array]
+PASS Uint16_1: classes are [object ArrayBuffer]
+PASS Uint16_1: buffer lengths are 2
+PASS Uint16_1: buffers have the same contents
+PASS Uint16_1: offset is 0
+PASS Uint16_1: length is 2
+PASS Float32_1: classes are [object Float32Array]
+PASS Float32_1: classes are [object ArrayBuffer]
+PASS Float32_1: buffer lengths are 4
+PASS Float32_1: buffers have the same contents
+PASS Float32_1: offset is 0
+PASS Float32_1: length is 4
+PASS Float64_1: classes are [object Float64Array]
+PASS Float64_1: classes are [object ArrayBuffer]
+PASS Float64_1: buffer lengths are 8
+PASS Float64_1: buffers have the same contents
+PASS Float64_1: offset is 0
+PASS Float64_1: length is 8
+PASS Int32_128: classes are [object Int32Array]
+PASS Int32_128: classes are [object ArrayBuffer]
+PASS Int32_128: buffer lengths are 512
+PASS Int32_128: buffers have the same contents
+PASS Int32_128: offset is 0
+PASS Int32_128: length is 512
+PASS Uint32_128: classes are [object Uint32Array]
+PASS Uint32_128: classes are [object ArrayBuffer]
+PASS Uint32_128: buffer lengths are 512
+PASS Uint32_128: buffers have the same contents
+PASS Uint32_128: offset is 0
+PASS Uint32_128: length is 512
+PASS Int8_128: classes are [object Int8Array]
+PASS Int8_128: classes are [object ArrayBuffer]
+PASS Int8_128: buffer lengths are 128
+PASS Int8_128: buffers have the same contents
+PASS Int8_128: offset is 0
+PASS Int8_128: length is 128
+PASS Uint8_128: classes are [object Uint8Array]
+PASS Uint8_128: classes are [object ArrayBuffer]
+PASS Uint8_128: buffer lengths are 128
+PASS Uint8_128: buffers have the same contents
+PASS Uint8_128: offset is 0
+PASS Uint8_128: length is 128
+PASS Uint8Clamped_128: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_128: classes are [object ArrayBuffer]
+PASS Uint8Clamped_128: buffer lengths are 128
+PASS Uint8Clamped_128: buffers have the same contents
+PASS Uint8Clamped_128: offset is 0
+PASS Uint8Clamped_128: length is 128
+PASS Int16_128: classes are [object Int16Array]
+PASS Int16_128: classes are [object ArrayBuffer]
+PASS Int16_128: buffer lengths are 256
+PASS Int16_128: buffers have the same contents
+PASS Int16_128: offset is 0
+PASS Int16_128: length is 256
+PASS Uint16_128: classes are [object Uint16Array]
+PASS Uint16_128: classes are [object ArrayBuffer]
+PASS Uint16_128: buffer lengths are 256
+PASS Uint16_128: buffers have the same contents
+PASS Uint16_128: offset is 0
+PASS Uint16_128: length is 256
+PASS Float32_128: classes are [object Float32Array]
+PASS Float32_128: classes are [object ArrayBuffer]
+PASS Float32_128: buffer lengths are 512
+PASS Float32_128: buffers have the same contents
+PASS Float32_128: offset is 0
+PASS Float32_128: length is 512
+PASS Float64_128: classes are [object Float64Array]
+PASS Float64_128: classes are [object ArrayBuffer]
+PASS Float64_128: buffer lengths are 1024
+PASS Float64_128: buffers have the same contents
+PASS Float64_128: offset is 0
+PASS Float64_128: length is 1024
+PASS Int32_0_buffer: classes are [object Int32Array]
+PASS Int32_0_buffer: classes are [object ArrayBuffer]
+PASS Int32_0_buffer: buffer lengths are 0
+PASS Int32_0_buffer: buffers have the same contents
+PASS Int32_0_buffer: offset is 0
+PASS Int32_0_buffer: length is 0
+PASS Uint32_0_buffer: classes are [object Uint32Array]
+PASS Uint32_0_buffer: classes are [object ArrayBuffer]
+PASS Uint32_0_buffer: buffer lengths are 0
+PASS Uint32_0_buffer: buffers have the same contents
+PASS Uint32_0_buffer: offset is 0
+PASS Uint32_0_buffer: length is 0
+PASS Int8_0_buffer: classes are [object Int8Array]
+PASS Int8_0_buffer: classes are [object ArrayBuffer]
+PASS Int8_0_buffer: buffer lengths are 0
+PASS Int8_0_buffer: buffers have the same contents
+PASS Int8_0_buffer: offset is 0
+PASS Int8_0_buffer: length is 0
+PASS Uint8_0_buffer: classes are [object Uint8Array]
+PASS Uint8_0_buffer: classes are [object ArrayBuffer]
+PASS Uint8_0_buffer: buffer lengths are 0
+PASS Uint8_0_buffer: buffers have the same contents
+PASS Uint8_0_buffer: offset is 0
+PASS Uint8_0_buffer: length is 0
+PASS Uint8Clamped_0_buffer: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_0_buffer: classes are [object ArrayBuffer]
+PASS Uint8Clamped_0_buffer: buffer lengths are 0
+PASS Uint8Clamped_0_buffer: buffers have the same contents
+PASS Uint8Clamped_0_buffer: offset is 0
+PASS Uint8Clamped_0_buffer: length is 0
+PASS Int16_0_buffer: classes are [object Int16Array]
+PASS Int16_0_buffer: classes are [object ArrayBuffer]
+PASS Int16_0_buffer: buffer lengths are 0
+PASS Int16_0_buffer: buffers have the same contents
+PASS Int16_0_buffer: offset is 0
+PASS Int16_0_buffer: length is 0
+PASS Uint16_0_buffer: classes are [object Uint16Array]
+PASS Uint16_0_buffer: classes are [object ArrayBuffer]
+PASS Uint16_0_buffer: buffer lengths are 0
+PASS Uint16_0_buffer: buffers have the same contents
+PASS Uint16_0_buffer: offset is 0
+PASS Uint16_0_buffer: length is 0
+PASS Float32_0_buffer: classes are [object Float32Array]
+PASS Float32_0_buffer: classes are [object ArrayBuffer]
+PASS Float32_0_buffer: buffer lengths are 0
+PASS Float32_0_buffer: buffers have the same contents
+PASS Float32_0_buffer: offset is 0
+PASS Float32_0_buffer: length is 0
+PASS Float64_0_buffer: classes are [object Float64Array]
+PASS Float64_0_buffer: classes are [object ArrayBuffer]
+PASS Float64_0_buffer: buffer lengths are 0
+PASS Float64_0_buffer: buffers have the same contents
+PASS Float64_0_buffer: offset is 0
+PASS Float64_0_buffer: length is 0
+PASS Int32_1_buffer: classes are [object Int32Array]
+PASS Int32_1_buffer: classes are [object ArrayBuffer]
+PASS Int32_1_buffer: buffer lengths are 4
+PASS Int32_1_buffer: buffers have the same contents
+PASS Int32_1_buffer: offset is 0
+PASS Int32_1_buffer: length is 4
+PASS Uint32_1_buffer: classes are [object Uint32Array]
+PASS Uint32_1_buffer: classes are [object ArrayBuffer]
+PASS Uint32_1_buffer: buffer lengths are 4
+PASS Uint32_1_buffer: buffers have the same contents
+PASS Uint32_1_buffer: offset is 0
+PASS Uint32_1_buffer: length is 4
+PASS Int8_1_buffer: classes are [object Int8Array]
+PASS Int8_1_buffer: classes are [object ArrayBuffer]
+PASS Int8_1_buffer: buffer lengths are 1
+PASS Int8_1_buffer: buffers have the same contents
+PASS Int8_1_buffer: offset is 0
+PASS Int8_1_buffer: length is 1
+PASS Uint8_1_buffer: classes are [object Uint8Array]
+PASS Uint8_1_buffer: classes are [object ArrayBuffer]
+PASS Uint8_1_buffer: buffer lengths are 1
+PASS Uint8_1_buffer: buffers have the same contents
+PASS Uint8_1_buffer: offset is 0
+PASS Uint8_1_buffer: length is 1
+PASS Uint8Clamped_1_buffer: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_1_buffer: classes are [object ArrayBuffer]
+PASS Uint8Clamped_1_buffer: buffer lengths are 1
+PASS Uint8Clamped_1_buffer: buffers have the same contents
+PASS Uint8Clamped_1_buffer: offset is 0
+PASS Uint8Clamped_1_buffer: length is 1
+PASS Int16_1_buffer: classes are [object Int16Array]
+PASS Int16_1_buffer: classes are [object ArrayBuffer]
+PASS Int16_1_buffer: buffer lengths are 2
+PASS Int16_1_buffer: buffers have the same contents
+PASS Int16_1_buffer: offset is 0
+PASS Int16_1_buffer: length is 2
+PASS Uint16_1_buffer: classes are [object Uint16Array]
+PASS Uint16_1_buffer: classes are [object ArrayBuffer]
+PASS Uint16_1_buffer: buffer lengths are 2
+PASS Uint16_1_buffer: buffers have the same contents
+PASS Uint16_1_buffer: offset is 0
+PASS Uint16_1_buffer: length is 2
+PASS Float32_1_buffer: classes are [object Float32Array]
+PASS Float32_1_buffer: classes are [object ArrayBuffer]
+PASS Float32_1_buffer: buffer lengths are 4
+PASS Float32_1_buffer: buffers have the same contents
+PASS Float32_1_buffer: offset is 0
+PASS Float32_1_buffer: length is 4
+PASS Float64_1_buffer: classes are [object Float64Array]
+PASS Float64_1_buffer: classes are [object ArrayBuffer]
+PASS Float64_1_buffer: buffer lengths are 8
+PASS Float64_1_buffer: buffers have the same contents
+PASS Float64_1_buffer: offset is 0
+PASS Float64_1_buffer: length is 8
+PASS Int32_128_buffer: classes are [object Int32Array]
+PASS Int32_128_buffer: classes are [object ArrayBuffer]
+PASS Int32_128_buffer: buffer lengths are 512
+PASS Int32_128_buffer: buffers have the same contents
+PASS Int32_128_buffer: offset is 0
+PASS Int32_128_buffer: length is 512
+PASS Uint32_128_buffer: classes are [object Uint32Array]
+PASS Uint32_128_buffer: classes are [object ArrayBuffer]
+PASS Uint32_128_buffer: buffer lengths are 512
+PASS Uint32_128_buffer: buffers have the same contents
+PASS Uint32_128_buffer: offset is 0
+PASS Uint32_128_buffer: length is 512
+PASS Int8_128_buffer: classes are [object Int8Array]
+PASS Int8_128_buffer: classes are [object ArrayBuffer]
+PASS Int8_128_buffer: buffer lengths are 128
+PASS Int8_128_buffer: buffers have the same contents
+PASS Int8_128_buffer: offset is 0
+PASS Int8_128_buffer: length is 128
+PASS Uint8_128_buffer: classes are [object Uint8Array]
+PASS Uint8_128_buffer: classes are [object ArrayBuffer]
+PASS Uint8_128_buffer: buffer lengths are 128
+PASS Uint8_128_buffer: buffers have the same contents
+PASS Uint8_128_buffer: offset is 0
+PASS Uint8_128_buffer: length is 128
+PASS Uint8Clamped_128_buffer: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_128_buffer: classes are [object ArrayBuffer]
+PASS Uint8Clamped_128_buffer: buffer lengths are 128
+PASS Uint8Clamped_128_buffer: buffers have the same contents
+PASS Uint8Clamped_128_buffer: offset is 0
+PASS Uint8Clamped_128_buffer: length is 128
+PASS Int16_128_buffer: classes are [object Int16Array]
+PASS Int16_128_buffer: classes are [object ArrayBuffer]
+PASS Int16_128_buffer: buffer lengths are 256
+PASS Int16_128_buffer: buffers have the same contents
+PASS Int16_128_buffer: offset is 0
+PASS Int16_128_buffer: length is 256
+PASS Uint16_128_buffer: classes are [object Uint16Array]
+PASS Uint16_128_buffer: classes are [object ArrayBuffer]
+PASS Uint16_128_buffer: buffer lengths are 256
+PASS Uint16_128_buffer: buffers have the same contents
+PASS Uint16_128_buffer: offset is 0
+PASS Uint16_128_buffer: length is 256
+PASS Float32_128_buffer: classes are [object Float32Array]
+PASS Float32_128_buffer: classes are [object ArrayBuffer]
+PASS Float32_128_buffer: buffer lengths are 512
+PASS Float32_128_buffer: buffers have the same contents
+PASS Float32_128_buffer: offset is 0
+PASS Float32_128_buffer: length is 512
+PASS Float64_128_buffer: classes are [object Float64Array]
+PASS Float64_128_buffer: classes are [object ArrayBuffer]
+PASS Float64_128_buffer: buffer lengths are 1024
+PASS Float64_128_buffer: buffers have the same contents
+PASS Float64_128_buffer: offset is 0
+PASS Float64_128_buffer: length is 1024
+PASS Int32_1_buffer_offset_at_end: classes are [object Int32Array]
+PASS Int32_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Int32_1_buffer_offset_at_end: buffer lengths are 4
+PASS Int32_1_buffer_offset_at_end: buffers have the same contents
+PASS Int32_1_buffer_offset_at_end: offset is 4
+PASS Int32_1_buffer_offset_at_end: length is 0
+PASS Uint32_1_buffer_offset_at_end: classes are [object Uint32Array]
+PASS Uint32_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint32_1_buffer_offset_at_end: buffer lengths are 4
+PASS Uint32_1_buffer_offset_at_end: buffers have the same contents
+PASS Uint32_1_buffer_offset_at_end: offset is 4
+PASS Uint32_1_buffer_offset_at_end: length is 0
+PASS Int8_1_buffer_offset_at_end: classes are [object Int8Array]
+PASS Int8_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Int8_1_buffer_offset_at_end: buffer lengths are 1
+PASS Int8_1_buffer_offset_at_end: buffers have the same contents
+PASS Int8_1_buffer_offset_at_end: offset is 1
+PASS Int8_1_buffer_offset_at_end: length is 0
+PASS Uint8_1_buffer_offset_at_end: classes are [object Uint8Array]
+PASS Uint8_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint8_1_buffer_offset_at_end: buffer lengths are 1
+PASS Uint8_1_buffer_offset_at_end: buffers have the same contents
+PASS Uint8_1_buffer_offset_at_end: offset is 1
+PASS Uint8_1_buffer_offset_at_end: length is 0
+PASS Uint8Clamped_1_buffer_offset_at_end: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint8Clamped_1_buffer_offset_at_end: buffer lengths are 1
+PASS Uint8Clamped_1_buffer_offset_at_end: buffers have the same contents
+PASS Uint8Clamped_1_buffer_offset_at_end: offset is 1
+PASS Uint8Clamped_1_buffer_offset_at_end: length is 0
+PASS Int16_1_buffer_offset_at_end: classes are [object Int16Array]
+PASS Int16_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Int16_1_buffer_offset_at_end: buffer lengths are 2
+PASS Int16_1_buffer_offset_at_end: buffers have the same contents
+PASS Int16_1_buffer_offset_at_end: offset is 2
+PASS Int16_1_buffer_offset_at_end: length is 0
+PASS Uint16_1_buffer_offset_at_end: classes are [object Uint16Array]
+PASS Uint16_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint16_1_buffer_offset_at_end: buffer lengths are 2
+PASS Uint16_1_buffer_offset_at_end: buffers have the same contents
+PASS Uint16_1_buffer_offset_at_end: offset is 2
+PASS Uint16_1_buffer_offset_at_end: length is 0
+PASS Float32_1_buffer_offset_at_end: classes are [object Float32Array]
+PASS Float32_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Float32_1_buffer_offset_at_end: buffer lengths are 4
+PASS Float32_1_buffer_offset_at_end: buffers have the same contents
+PASS Float32_1_buffer_offset_at_end: offset is 4
+PASS Float32_1_buffer_offset_at_end: length is 0
+PASS Float64_1_buffer_offset_at_end: classes are [object Float64Array]
+PASS Float64_1_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Float64_1_buffer_offset_at_end: buffer lengths are 8
+PASS Float64_1_buffer_offset_at_end: buffers have the same contents
+PASS Float64_1_buffer_offset_at_end: offset is 8
+PASS Float64_1_buffer_offset_at_end: length is 0
+PASS Int32_128_buffer_offset_at_end: classes are [object Int32Array]
+PASS Int32_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Int32_128_buffer_offset_at_end: buffer lengths are 512
+PASS Int32_128_buffer_offset_at_end: buffers have the same contents
+PASS Int32_128_buffer_offset_at_end: offset is 512
+PASS Int32_128_buffer_offset_at_end: length is 0
+PASS Uint32_128_buffer_offset_at_end: classes are [object Uint32Array]
+PASS Uint32_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint32_128_buffer_offset_at_end: buffer lengths are 512
+PASS Uint32_128_buffer_offset_at_end: buffers have the same contents
+PASS Uint32_128_buffer_offset_at_end: offset is 512
+PASS Uint32_128_buffer_offset_at_end: length is 0
+PASS Int8_128_buffer_offset_at_end: classes are [object Int8Array]
+PASS Int8_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Int8_128_buffer_offset_at_end: buffer lengths are 128
+PASS Int8_128_buffer_offset_at_end: buffers have the same contents
+PASS Int8_128_buffer_offset_at_end: offset is 128
+PASS Int8_128_buffer_offset_at_end: length is 0
+PASS Uint8_128_buffer_offset_at_end: classes are [object Uint8Array]
+PASS Uint8_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint8_128_buffer_offset_at_end: buffer lengths are 128
+PASS Uint8_128_buffer_offset_at_end: buffers have the same contents
+PASS Uint8_128_buffer_offset_at_end: offset is 128
+PASS Uint8_128_buffer_offset_at_end: length is 0
+PASS Uint8Clamped_128_buffer_offset_at_end: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint8Clamped_128_buffer_offset_at_end: buffer lengths are 128
+PASS Uint8Clamped_128_buffer_offset_at_end: buffers have the same contents
+PASS Uint8Clamped_128_buffer_offset_at_end: offset is 128
+PASS Uint8Clamped_128_buffer_offset_at_end: length is 0
+PASS Int16_128_buffer_offset_at_end: classes are [object Int16Array]
+PASS Int16_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Int16_128_buffer_offset_at_end: buffer lengths are 256
+PASS Int16_128_buffer_offset_at_end: buffers have the same contents
+PASS Int16_128_buffer_offset_at_end: offset is 256
+PASS Int16_128_buffer_offset_at_end: length is 0
+PASS Uint16_128_buffer_offset_at_end: classes are [object Uint16Array]
+PASS Uint16_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Uint16_128_buffer_offset_at_end: buffer lengths are 256
+PASS Uint16_128_buffer_offset_at_end: buffers have the same contents
+PASS Uint16_128_buffer_offset_at_end: offset is 256
+PASS Uint16_128_buffer_offset_at_end: length is 0
+PASS Float32_128_buffer_offset_at_end: classes are [object Float32Array]
+PASS Float32_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Float32_128_buffer_offset_at_end: buffer lengths are 512
+PASS Float32_128_buffer_offset_at_end: buffers have the same contents
+PASS Float32_128_buffer_offset_at_end: offset is 512
+PASS Float32_128_buffer_offset_at_end: length is 0
+PASS Float64_128_buffer_offset_at_end: classes are [object Float64Array]
+PASS Float64_128_buffer_offset_at_end: classes are [object ArrayBuffer]
+PASS Float64_128_buffer_offset_at_end: buffer lengths are 1024
+PASS Float64_128_buffer_offset_at_end: buffers have the same contents
+PASS Float64_128_buffer_offset_at_end: offset is 1024
+PASS Float64_128_buffer_offset_at_end: length is 0
+PASS Int32_128_buffer_offset_slice_length_0: classes are [object Int32Array]
+PASS Int32_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Int32_128_buffer_offset_slice_length_0: buffer lengths are 512
+PASS Int32_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Int32_128_buffer_offset_slice_length_0: offset is 256
+PASS Int32_128_buffer_offset_slice_length_0: length is 0
+PASS Uint32_128_buffer_offset_slice_length_0: classes are [object Uint32Array]
+PASS Uint32_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Uint32_128_buffer_offset_slice_length_0: buffer lengths are 512
+PASS Uint32_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Uint32_128_buffer_offset_slice_length_0: offset is 256
+PASS Uint32_128_buffer_offset_slice_length_0: length is 0
+PASS Int8_128_buffer_offset_slice_length_0: classes are [object Int8Array]
+PASS Int8_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Int8_128_buffer_offset_slice_length_0: buffer lengths are 128
+PASS Int8_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Int8_128_buffer_offset_slice_length_0: offset is 64
+PASS Int8_128_buffer_offset_slice_length_0: length is 0
+PASS Uint8_128_buffer_offset_slice_length_0: classes are [object Uint8Array]
+PASS Uint8_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Uint8_128_buffer_offset_slice_length_0: buffer lengths are 128
+PASS Uint8_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Uint8_128_buffer_offset_slice_length_0: offset is 64
+PASS Uint8_128_buffer_offset_slice_length_0: length is 0
+PASS Uint8Clamped_128_buffer_offset_slice_length_0: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Uint8Clamped_128_buffer_offset_slice_length_0: buffer lengths are 128
+PASS Uint8Clamped_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Uint8Clamped_128_buffer_offset_slice_length_0: offset is 64
+PASS Uint8Clamped_128_buffer_offset_slice_length_0: length is 0
+PASS Int16_128_buffer_offset_slice_length_0: classes are [object Int16Array]
+PASS Int16_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Int16_128_buffer_offset_slice_length_0: buffer lengths are 256
+PASS Int16_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Int16_128_buffer_offset_slice_length_0: offset is 128
+PASS Int16_128_buffer_offset_slice_length_0: length is 0
+PASS Uint16_128_buffer_offset_slice_length_0: classes are [object Uint16Array]
+PASS Uint16_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Uint16_128_buffer_offset_slice_length_0: buffer lengths are 256
+PASS Uint16_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Uint16_128_buffer_offset_slice_length_0: offset is 128
+PASS Uint16_128_buffer_offset_slice_length_0: length is 0
+PASS Float32_128_buffer_offset_slice_length_0: classes are [object Float32Array]
+PASS Float32_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Float32_128_buffer_offset_slice_length_0: buffer lengths are 512
+PASS Float32_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Float32_128_buffer_offset_slice_length_0: offset is 256
+PASS Float32_128_buffer_offset_slice_length_0: length is 0
+PASS Float64_128_buffer_offset_slice_length_0: classes are [object Float64Array]
+PASS Float64_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
+PASS Float64_128_buffer_offset_slice_length_0: buffer lengths are 1024
+PASS Float64_128_buffer_offset_slice_length_0: buffers have the same contents
+PASS Float64_128_buffer_offset_slice_length_0: offset is 512
+PASS Float64_128_buffer_offset_slice_length_0: length is 0
+PASS Int32_128_buffer_offset_slice_length_1: classes are [object Int32Array]
+PASS Int32_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Int32_128_buffer_offset_slice_length_1: buffer lengths are 512
+PASS Int32_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Int32_128_buffer_offset_slice_length_1: offset is 256
+PASS Int32_128_buffer_offset_slice_length_1: length is 4
+PASS Uint32_128_buffer_offset_slice_length_1: classes are [object Uint32Array]
+PASS Uint32_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Uint32_128_buffer_offset_slice_length_1: buffer lengths are 512
+PASS Uint32_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Uint32_128_buffer_offset_slice_length_1: offset is 256
+PASS Uint32_128_buffer_offset_slice_length_1: length is 4
+PASS Int8_128_buffer_offset_slice_length_1: classes are [object Int8Array]
+PASS Int8_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Int8_128_buffer_offset_slice_length_1: buffer lengths are 128
+PASS Int8_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Int8_128_buffer_offset_slice_length_1: offset is 64
+PASS Int8_128_buffer_offset_slice_length_1: length is 1
+PASS Uint8_128_buffer_offset_slice_length_1: classes are [object Uint8Array]
+PASS Uint8_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Uint8_128_buffer_offset_slice_length_1: buffer lengths are 128
+PASS Uint8_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Uint8_128_buffer_offset_slice_length_1: offset is 64
+PASS Uint8_128_buffer_offset_slice_length_1: length is 1
+PASS Uint8Clamped_128_buffer_offset_slice_length_1: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Uint8Clamped_128_buffer_offset_slice_length_1: buffer lengths are 128
+PASS Uint8Clamped_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Uint8Clamped_128_buffer_offset_slice_length_1: offset is 64
+PASS Uint8Clamped_128_buffer_offset_slice_length_1: length is 1
+PASS Int16_128_buffer_offset_slice_length_1: classes are [object Int16Array]
+PASS Int16_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Int16_128_buffer_offset_slice_length_1: buffer lengths are 256
+PASS Int16_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Int16_128_buffer_offset_slice_length_1: offset is 128
+PASS Int16_128_buffer_offset_slice_length_1: length is 2
+PASS Uint16_128_buffer_offset_slice_length_1: classes are [object Uint16Array]
+PASS Uint16_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Uint16_128_buffer_offset_slice_length_1: buffer lengths are 256
+PASS Uint16_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Uint16_128_buffer_offset_slice_length_1: offset is 128
+PASS Uint16_128_buffer_offset_slice_length_1: length is 2
+PASS Float32_128_buffer_offset_slice_length_1: classes are [object Float32Array]
+PASS Float32_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Float32_128_buffer_offset_slice_length_1: buffer lengths are 512
+PASS Float32_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Float32_128_buffer_offset_slice_length_1: offset is 256
+PASS Float32_128_buffer_offset_slice_length_1: length is 4
+PASS Float64_128_buffer_offset_slice_length_1: classes are [object Float64Array]
+PASS Float64_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
+PASS Float64_128_buffer_offset_slice_length_1: buffer lengths are 1024
+PASS Float64_128_buffer_offset_slice_length_1: buffers have the same contents
+PASS Float64_128_buffer_offset_slice_length_1: offset is 512
+PASS Float64_128_buffer_offset_slice_length_1: length is 8
+PASS Int32_128_buffer_offset_slice_length_16: classes are [object Int32Array]
+PASS Int32_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Int32_128_buffer_offset_slice_length_16: buffer lengths are 512
+PASS Int32_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Int32_128_buffer_offset_slice_length_16: offset is 256
+PASS Int32_128_buffer_offset_slice_length_16: length is 64
+PASS Uint32_128_buffer_offset_slice_length_16: classes are [object Uint32Array]
+PASS Uint32_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Uint32_128_buffer_offset_slice_length_16: buffer lengths are 512
+PASS Uint32_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Uint32_128_buffer_offset_slice_length_16: offset is 256
+PASS Uint32_128_buffer_offset_slice_length_16: length is 64
+PASS Int8_128_buffer_offset_slice_length_16: classes are [object Int8Array]
+PASS Int8_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Int8_128_buffer_offset_slice_length_16: buffer lengths are 128
+PASS Int8_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Int8_128_buffer_offset_slice_length_16: offset is 64
+PASS Int8_128_buffer_offset_slice_length_16: length is 16
+PASS Uint8_128_buffer_offset_slice_length_16: classes are [object Uint8Array]
+PASS Uint8_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Uint8_128_buffer_offset_slice_length_16: buffer lengths are 128
+PASS Uint8_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Uint8_128_buffer_offset_slice_length_16: offset is 64
+PASS Uint8_128_buffer_offset_slice_length_16: length is 16
+PASS Uint8Clamped_128_buffer_offset_slice_length_16: classes are [object Uint8ClampedArray]
+PASS Uint8Clamped_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Uint8Clamped_128_buffer_offset_slice_length_16: buffer lengths are 128
+PASS Uint8Clamped_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Uint8Clamped_128_buffer_offset_slice_length_16: offset is 64
+PASS Uint8Clamped_128_buffer_offset_slice_length_16: length is 16
+PASS Int16_128_buffer_offset_slice_length_16: classes are [object Int16Array]
+PASS Int16_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Int16_128_buffer_offset_slice_length_16: buffer lengths are 256
+PASS Int16_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Int16_128_buffer_offset_slice_length_16: offset is 128
+PASS Int16_128_buffer_offset_slice_length_16: length is 32
+PASS Uint16_128_buffer_offset_slice_length_16: classes are [object Uint16Array]
+PASS Uint16_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Uint16_128_buffer_offset_slice_length_16: buffer lengths are 256
+PASS Uint16_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Uint16_128_buffer_offset_slice_length_16: offset is 128
+PASS Uint16_128_buffer_offset_slice_length_16: length is 32
+PASS Float32_128_buffer_offset_slice_length_16: classes are [object Float32Array]
+PASS Float32_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Float32_128_buffer_offset_slice_length_16: buffer lengths are 512
+PASS Float32_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Float32_128_buffer_offset_slice_length_16: offset is 256
+PASS Float32_128_buffer_offset_slice_length_16: length is 64
+PASS Float64_128_buffer_offset_slice_length_16: classes are [object Float64Array]
+PASS Float64_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
+PASS Float64_128_buffer_offset_slice_length_16: buffer lengths are 1024
+PASS Float64_128_buffer_offset_slice_length_16: buffers have the same contents
+PASS Float64_128_buffer_offset_slice_length_16: offset is 512
+PASS Float64_128_buffer_offset_slice_length_16: length is 128
 PASS successfullyParsed is true
 
 TEST COMPLETE
index c652ef9..74f1891 100644 (file)
@@ -108,6 +108,7 @@ var basicBufferTypes = [
     ["Uint32", Uint32Array, 4],
     ["Int8", Int8Array, 1],
     ["Uint8", Uint8Array, 1],
+    ["Uint8Clamped", Uint8ClampedArray, 1],
     ["Int16", Int16Array, 2],
     ["Uint16", Uint16Array, 2],
     ["Float32", Float32Array, 4],
index 4da67b4..7f0de1b 100644 (file)
@@ -89,6 +89,7 @@ PASS Uint8_0: buffer lengths are 0
 PASS Uint8_0: buffers have the same contents
 PASS Uint8_0: offset is 0
 PASS Uint8_0: length is 0
+FAIL Uint8Clamped_0: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_0: classes are [object Int16Array]
 PASS Int16_0: classes are [object ArrayBuffer]
 PASS Int16_0: buffer lengths are 0
@@ -137,6 +138,7 @@ PASS Uint8_1: buffer lengths are 1
 PASS Uint8_1: buffers have the same contents
 PASS Uint8_1: offset is 0
 PASS Uint8_1: length is 1
+FAIL Uint8Clamped_1: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_1: classes are [object Int16Array]
 PASS Int16_1: classes are [object ArrayBuffer]
 PASS Int16_1: buffer lengths are 2
@@ -185,6 +187,7 @@ PASS Uint8_128: buffer lengths are 128
 PASS Uint8_128: buffers have the same contents
 PASS Uint8_128: offset is 0
 PASS Uint8_128: length is 128
+FAIL Uint8Clamped_128: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_128: classes are [object Int16Array]
 PASS Int16_128: classes are [object ArrayBuffer]
 PASS Int16_128: buffer lengths are 256
@@ -233,6 +236,7 @@ PASS Uint8_0_buffer: buffer lengths are 0
 PASS Uint8_0_buffer: buffers have the same contents
 PASS Uint8_0_buffer: offset is 0
 PASS Uint8_0_buffer: length is 0
+FAIL Uint8Clamped_0_buffer: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_0_buffer: classes are [object Int16Array]
 PASS Int16_0_buffer: classes are [object ArrayBuffer]
 PASS Int16_0_buffer: buffer lengths are 0
@@ -281,6 +285,7 @@ PASS Uint8_1_buffer: buffer lengths are 1
 PASS Uint8_1_buffer: buffers have the same contents
 PASS Uint8_1_buffer: offset is 0
 PASS Uint8_1_buffer: length is 1
+FAIL Uint8Clamped_1_buffer: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_1_buffer: classes are [object Int16Array]
 PASS Int16_1_buffer: classes are [object ArrayBuffer]
 PASS Int16_1_buffer: buffer lengths are 2
@@ -329,6 +334,7 @@ PASS Uint8_128_buffer: buffer lengths are 128
 PASS Uint8_128_buffer: buffers have the same contents
 PASS Uint8_128_buffer: offset is 0
 PASS Uint8_128_buffer: length is 128
+FAIL Uint8Clamped_128_buffer: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_128_buffer: classes are [object Int16Array]
 PASS Int16_128_buffer: classes are [object ArrayBuffer]
 PASS Int16_128_buffer: buffer lengths are 256
@@ -377,6 +383,7 @@ PASS Uint8_1_buffer_offset_at_end: buffer lengths are 1
 PASS Uint8_1_buffer_offset_at_end: buffers have the same contents
 PASS Uint8_1_buffer_offset_at_end: offset is 1
 PASS Uint8_1_buffer_offset_at_end: length is 0
+FAIL Uint8Clamped_1_buffer_offset_at_end: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_1_buffer_offset_at_end: classes are [object Int16Array]
 PASS Int16_1_buffer_offset_at_end: classes are [object ArrayBuffer]
 PASS Int16_1_buffer_offset_at_end: buffer lengths are 2
@@ -425,6 +432,7 @@ PASS Uint8_128_buffer_offset_at_end: buffer lengths are 128
 PASS Uint8_128_buffer_offset_at_end: buffers have the same contents
 PASS Uint8_128_buffer_offset_at_end: offset is 128
 PASS Uint8_128_buffer_offset_at_end: length is 0
+FAIL Uint8Clamped_128_buffer_offset_at_end: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_128_buffer_offset_at_end: classes are [object Int16Array]
 PASS Int16_128_buffer_offset_at_end: classes are [object ArrayBuffer]
 PASS Int16_128_buffer_offset_at_end: buffer lengths are 256
@@ -473,6 +481,7 @@ PASS Uint8_128_buffer_offset_slice_length_0: buffer lengths are 128
 PASS Uint8_128_buffer_offset_slice_length_0: buffers have the same contents
 PASS Uint8_128_buffer_offset_slice_length_0: offset is 64
 PASS Uint8_128_buffer_offset_slice_length_0: length is 0
+FAIL Uint8Clamped_128_buffer_offset_slice_length_0: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_128_buffer_offset_slice_length_0: classes are [object Int16Array]
 PASS Int16_128_buffer_offset_slice_length_0: classes are [object ArrayBuffer]
 PASS Int16_128_buffer_offset_slice_length_0: buffer lengths are 256
@@ -521,6 +530,7 @@ PASS Uint8_128_buffer_offset_slice_length_1: buffer lengths are 128
 PASS Uint8_128_buffer_offset_slice_length_1: buffers have the same contents
 PASS Uint8_128_buffer_offset_slice_length_1: offset is 64
 PASS Uint8_128_buffer_offset_slice_length_1: length is 1
+FAIL Uint8Clamped_128_buffer_offset_slice_length_1: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_128_buffer_offset_slice_length_1: classes are [object Int16Array]
 PASS Int16_128_buffer_offset_slice_length_1: classes are [object ArrayBuffer]
 PASS Int16_128_buffer_offset_slice_length_1: buffer lengths are 256
@@ -569,6 +579,7 @@ PASS Uint8_128_buffer_offset_slice_length_16: buffer lengths are 128
 PASS Uint8_128_buffer_offset_slice_length_16: buffers have the same contents
 PASS Uint8_128_buffer_offset_slice_length_16: offset is 64
 PASS Uint8_128_buffer_offset_slice_length_16: length is 16
+FAIL Uint8Clamped_128_buffer_offset_slice_length_16: class [object Uint8ClampedArray] became [object Uint8Array]
 PASS Int16_128_buffer_offset_slice_length_16: classes are [object Int16Array]
 PASS Int16_128_buffer_offset_slice_length_16: classes are [object ArrayBuffer]
 PASS Int16_128_buffer_offset_slice_length_16: buffer lengths are 256
index 08c7e5c..bb61c35 100644 (file)
@@ -1,3 +1,26 @@
+2012-02-22  Dmitry Lomov  <dslomov@google.com>
+
+        [JSC] Implement ArrayBuffer and typed array cloning in JSC
+        https://bugs.webkit.org/show_bug.cgi?id=79294
+
+        Reviewed by Oliver Hunt.
+
+        Covered by existing tests.
+
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::typedArrayElementSize):
+        (WebCore):
+        (WebCore::CloneSerializer::dumpArrayBufferView):
+        (CloneSerializer):
+        (WebCore::CloneSerializer::dumpIfTerminal):
+        (WebCore::CloneSerializer::write):
+        (WebCore::CloneDeserializer::readArrayBufferViewSubtag):
+        (CloneDeserializer):
+        (WebCore::CloneDeserializer::readArrayBuffer):
+        (WebCore::CloneDeserializer::readArrayBufferView):
+        (WebCore::CloneDeserializer::getJSValue):
+        (WebCore::CloneDeserializer::readTerminal):
+
 2012-02-22  Adrienne Walker  <enne@google.com>
 
         [chromium] Unreviewed speculative chromium-mac build fix.
index 5f58e14..77cd65b 100644 (file)
 #include "File.h"
 #include "FileList.h"
 #include "ImageData.h"
+#include "JSArrayBuffer.h"
+#include "JSArrayBufferView.h"
 #include "JSBlob.h"
+#include "JSDataView.h"
 #include "JSDOMGlobalObject.h"
 #include "JSFile.h"
 #include "JSFileList.h"
+#include "JSFloat32Array.h"
+#include "JSFloat64Array.h"
 #include "JSImageData.h"
+#include "JSInt16Array.h"
+#include "JSInt32Array.h"
+#include "JSInt8Array.h"
 #include "JSMessagePort.h"
 #include "JSNavigator.h"
+#include "JSUint16Array.h"
+#include "JSUint32Array.h"
+#include "JSUint8Array.h"
+#include "JSUint8ClampedArray.h"
 #include "ScriptValue.h"
 #include "SharedBuffer.h"
 #include <limits>
@@ -91,9 +103,47 @@ enum SerializationTag {
     RegExpTag = 18,
     ObjectReferenceTag = 19,
     MessagePortReferenceTag = 20,
+    ArrayBufferTag = 21,
+    ArrayBufferViewTag = 22,
     ErrorTag = 255
 };
 
+enum ArrayBufferViewSubtag {
+    DataViewTag = 0,
+    Int8ArrayTag = 1,
+    Uint8ArrayTag = 2,
+    Uint8ClampedArrayTag = 3,
+    Int16ArrayTag = 4,
+    Uint16ArrayTag = 5,
+    Int32ArrayTag = 6,
+    Uint32ArrayTag = 7,
+    Float32ArrayTag = 8,
+    Float64ArrayTag = 9
+};
+
+static unsigned typedArrayElementSize(ArrayBufferViewSubtag tag)
+{
+    switch (tag) {
+    case DataViewTag:
+    case Int8ArrayTag:
+    case Uint8ArrayTag:
+    case Uint8ClampedArrayTag:
+        return 1;
+    case Int16ArrayTag:
+    case Uint16ArrayTag:
+        return 2;
+    case Int32ArrayTag:
+    case Uint32ArrayTag:
+    case Float32ArrayTag:
+        return 4;
+    case Float64ArrayTag:
+        return 8;
+    default:
+        return 0;
+    }
+
+}
+
 /* CurrentVersion tracks the serialization version so that persistant stores
  * are able to correctly bail out in the case of encountering newer formats.
  *
@@ -137,8 +187,10 @@ static const unsigned int StringPoolTag = 0xFFFFFFFE;
  *    | FileList
  *    | ImageData
  *    | Blob
- *    | ObjectReferenceTag <opIndex:IndexType>
+ *    | ObjectReference
  *    | MessagePortReferenceTag <value:uint32_t>
+ *    | ArrayBuffer
+ *    | ArrayBufferViewTag ArrayBufferViewSubtag <byteOffset:uint32_t> <byteLenght:uint32_t> (ArrayBuffer | ObjectReference)
  *
  * String :-
  *      EmptyStringTag
@@ -165,6 +217,12 @@ static const unsigned int StringPoolTag = 0xFFFFFFFE;
  *
  * RegExp :-
  *    RegExpTag <pattern:StringData><flags:StringData>
+ *
+ * ObjectReference :-
+ *    ObjectReferenceTag <opIndex:IndexType>
+ *
+ * ArrayBuffer :-
+ *    ArrayBufferTag <length:uint32_t> <contents:byte{length}>
  */
 
 typedef pair<JSC::JSValue, SerializationReturnCode> DeserializationResult;
@@ -417,6 +475,40 @@ private:
         }
     }
 
+    bool dumpArrayBufferView(JSObject* obj)
+    {
+        write(ArrayBufferViewTag);
+        if (obj->inherits(&JSDataView::s_info))
+            write(DataViewTag);
+        else if (obj->inherits(&JSUint8ClampedArray::s_info))
+            write(Uint8ClampedArrayTag);
+        else if (obj->inherits(&JSInt8Array::s_info))
+            write(Int8ArrayTag);
+        else if (obj->inherits(&JSUint8Array::s_info))
+            write(Uint8ArrayTag);
+        else if (obj->inherits(&JSInt16Array::s_info))
+            write(Int16ArrayTag);
+        else if (obj->inherits(&JSUint16Array::s_info))
+            write(Uint16ArrayTag);
+        else if (obj->inherits(&JSInt32Array::s_info))
+            write(Int32ArrayTag);
+        else if (obj->inherits(&JSUint32Array::s_info))
+            write(Uint32ArrayTag);
+        else if (obj->inherits(&JSFloat32Array::s_info))
+            write(Float32ArrayTag);
+        else if (obj->inherits(&JSFloat64Array::s_info))
+            write(Float64ArrayTag);
+        else
+            return false;
+
+        RefPtr<ArrayBufferView> arrayBufferView = toArrayBufferView(obj);
+        write(static_cast<uint32_t>(arrayBufferView->byteOffset()));
+        write(static_cast<uint32_t>(arrayBufferView->byteLength()));
+        RefPtr<ArrayBuffer> arrayBuffer = arrayBufferView->buffer();
+        JSValue bufferObj = toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject()), arrayBuffer.get());
+        return dumpIfTerminal(bufferObj);
+    }
+
     bool dumpIfTerminal(JSValue value)
     {
         if (!value.isCell()) {
@@ -510,6 +602,20 @@ private:
                 }
                 return false;
             }
+            if (obj->inherits(&JSArrayBuffer::s_info)) {
+                if (!startObjectInternal(obj)) // handle duplicates
+                    return true;
+                write(ArrayBufferTag);
+                RefPtr<ArrayBuffer> arrayBuffer = toArrayBuffer(obj);
+                write(arrayBuffer->byteLength());
+                write(static_cast<const uint8_t *>(arrayBuffer->data()), arrayBuffer->byteLength());
+                return true;
+            }
+            if (obj->inherits(&JSArrayBufferView::s_info)) {
+                if (!startObjectInternal(obj))
+                    return true;
+                return dumpArrayBufferView(obj);
+            }
 
             CallData unusedData;
             if (getCallData(value, unusedData) == CallTypeNone)
@@ -525,6 +631,11 @@ private:
         writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
     }
 
+    void write(ArrayBufferViewSubtag tag)
+    {
+        writeLittleEndian<uint8_t>(m_buffer, static_cast<uint8_t>(tag));
+    }
+
     void write(uint8_t c)
     {
         writeLittleEndian(m_buffer, c);
@@ -1065,6 +1176,14 @@ private:
         return static_cast<SerializationTag>(*m_ptr++);
     }
 
+    bool readArrayBufferViewSubtag(ArrayBufferViewSubtag& tag)
+    {
+        if (m_ptr >= m_end)
+            return false;
+        tag = static_cast<ArrayBufferViewSubtag>(*m_ptr++);
+        return true;
+    }
+
     void putProperty(JSArray* array, unsigned index, JSValue value)
     {
         if (array->canSetIndex(index))
@@ -1094,6 +1213,83 @@ private:
         return true;
     }
 
+    bool readArrayBuffer(RefPtr<ArrayBuffer>& arrayBuffer)
+    {
+        uint32_t length;
+        if (!read(length))
+            return false;
+        if (m_ptr + length > m_end)
+            return false;
+        arrayBuffer = ArrayBuffer::create(m_ptr, length);
+        m_ptr += length;
+        return true;
+    }
+
+    bool readArrayBufferView(JSValue& arrayBufferView)
+    {
+        ArrayBufferViewSubtag arrayBufferViewSubtag;
+        if (!readArrayBufferViewSubtag(arrayBufferViewSubtag))
+            return false;
+        uint32_t byteOffset;
+        if (!read(byteOffset))
+            return false;
+        uint32_t byteLength;
+        if (!read(byteLength))
+            return false;
+        JSObject* arrayBufferObj = asObject(readTerminal());
+        if (!arrayBufferObj || !arrayBufferObj->inherits(&JSArrayBuffer::s_info))
+            return false;
+
+        unsigned elementSize = typedArrayElementSize(arrayBufferViewSubtag);
+        if (!elementSize)
+            return false;
+        unsigned length = byteLength / elementSize;
+        if (length * elementSize != byteLength)
+            return false;
+
+        RefPtr<ArrayBuffer> arrayBuffer = toArrayBuffer(arrayBufferObj);
+        switch (arrayBufferViewSubtag) {
+        case DataViewTag:
+            arrayBufferView = getJSValue(DataView::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Int8ArrayTag:
+            arrayBufferView = getJSValue(Int8Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Uint8ArrayTag:
+            arrayBufferView = getJSValue(Uint8Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Uint8ClampedArrayTag:
+            arrayBufferView = getJSValue(Uint8ClampedArray::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Int16ArrayTag:
+            arrayBufferView = getJSValue(Int16Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Uint16ArrayTag:
+            arrayBufferView = getJSValue(Uint16Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Int32ArrayTag:
+            arrayBufferView = getJSValue(Int32Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Uint32ArrayTag:
+            arrayBufferView = getJSValue(Uint32Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Float32ArrayTag:
+            arrayBufferView = getJSValue(Float32Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        case Float64ArrayTag:
+            arrayBufferView = getJSValue(Float64Array::create(arrayBuffer, byteOffset, length).get());
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    template<class T>
+    JSValue getJSValue(T* nativeObj)
+    {
+        return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), nativeObj);
+    }
+
     JSValue readTerminal()
     {
         SerializationTag tag = readTag();
@@ -1150,7 +1346,7 @@ private:
             }
             if (!m_isDOMGlobalObject)
                 return jsNull();
-            return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), result.get());
+            return getJSValue(result.get());
         }
         case ImageDataTag: {
             int32_t width;
@@ -1173,7 +1369,7 @@ private:
             RefPtr<ImageData> result = ImageData::create(IntSize(width, height));
             memcpy(result->data()->data()->data(), m_ptr, length);
             m_ptr += length;
-            return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), result.get());
+            return getJSValue(result.get());
         }
         case BlobTag: {
             CachedStringRef url;
@@ -1187,7 +1383,7 @@ private:
                 return JSValue();
             if (!m_isDOMGlobalObject)
                 return jsNull();
-            return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), Blob::create(KURL(KURL(), url->ustring().impl()), String(type->ustring().impl()), size));
+            return getJSValue(Blob::create(KURL(KURL(), url->ustring().impl()), String(type->ustring().impl()), size).get());
         }
         case StringTag: {
             CachedStringRef cachedString;
@@ -1224,8 +1420,26 @@ private:
                 fail();
                 return JSValue();
             }
-            return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject()),
-                        m_messagePorts->at(index).get());
+            return getJSValue(m_messagePorts->at(index).get());
+        }
+        case ArrayBufferTag: {
+            RefPtr<ArrayBuffer> arrayBuffer;
+            if (!readArrayBuffer(arrayBuffer)) {
+                fail();
+                return JSValue();
+            }
+            JSValue result = getJSValue(arrayBuffer.get());
+            m_gcBuffer.append(result);
+            return result;
+        }
+        case ArrayBufferViewTag: {
+            JSValue arrayBufferView;
+            if (!readArrayBufferView(arrayBufferView)) {
+                fail();
+                return JSValue();
+            }
+            m_gcBuffer.append(arrayBufferView);
+            return arrayBufferView;
         }
         default:
             m_ptr--; // Push the tag back