OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
11 var GlobalSharedArrayBuffer = global.SharedArrayBuffer; | 11 var GlobalSharedArrayBuffer = global.SharedArrayBuffer; |
12 var GlobalObject = global.Object; | 12 var GlobalObject = global.Object; |
| 13 var MakeTypeError; |
13 var ToPositiveInteger; | 14 var ToPositiveInteger; |
14 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 15 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
15 | 16 |
16 utils.Import(function(from) { | 17 utils.Import(function(from) { |
| 18 MakeTypeError = from.MakeTypeError; |
17 ToPositiveInteger = from.ToPositiveInteger; | 19 ToPositiveInteger = from.ToPositiveInteger; |
18 }) | 20 }) |
19 | 21 |
20 // ------------------------------------------------------------------- | 22 // ------------------------------------------------------------------- |
21 | 23 |
22 function SharedArrayBufferConstructor(length) { // length = 1 | 24 function SharedArrayBufferConstructor(length) { // length = 1 |
23 if (%_IsConstructCall()) { | 25 if (%_IsConstructCall()) { |
24 var byteLength = ToPositiveInteger(length, kInvalidArrayBufferLength); | 26 var byteLength = ToPositiveInteger(length, kInvalidArrayBufferLength); |
25 %ArrayBufferInitialize(this, byteLength, kShared); | 27 %ArrayBufferInitialize(this, byteLength, kShared); |
26 } else { | 28 } else { |
(...skipping 26 matching lines...) Expand all Loading... |
53 toStringTagSymbol, "SharedArrayBuffer", DONT_ENUM | READ_ONLY); | 55 toStringTagSymbol, "SharedArrayBuffer", DONT_ENUM | READ_ONLY); |
54 | 56 |
55 utils.InstallGetter(GlobalSharedArrayBuffer.prototype, "byteLength", | 57 utils.InstallGetter(GlobalSharedArrayBuffer.prototype, "byteLength", |
56 SharedArrayBufferGetByteLen); | 58 SharedArrayBufferGetByteLen); |
57 | 59 |
58 utils.InstallFunctions(GlobalSharedArrayBuffer, DONT_ENUM, [ | 60 utils.InstallFunctions(GlobalSharedArrayBuffer, DONT_ENUM, [ |
59 "isView", SharedArrayBufferIsViewJS | 61 "isView", SharedArrayBufferIsViewJS |
60 ]); | 62 ]); |
61 | 63 |
62 }) | 64 }) |
OLD | NEW |