| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
| 6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
| 7 #include "src/conversions.h" | 7 #include "src/conversions.h" |
| 8 #include "src/counters.h" | 8 #include "src/counters.h" |
| 9 #include "src/factory.h" | 9 #include "src/factory.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 // 10. Let O be ? OrdinaryCreateFromConstructor(NewTarget, | 86 // 10. Let O be ? OrdinaryCreateFromConstructor(NewTarget, |
| 87 // "%DataViewPrototype%", «[[DataView]], [[ViewedArrayBuffer]], | 87 // "%DataViewPrototype%", «[[DataView]], [[ViewedArrayBuffer]], |
| 88 // [[ByteLength]], [[ByteOffset]]»). | 88 // [[ByteLength]], [[ByteOffset]]»). |
| 89 // 11. Set O's [[DataView]] internal slot to true. | 89 // 11. Set O's [[DataView]] internal slot to true. |
| 90 Handle<JSObject> result; | 90 Handle<JSObject> result; |
| 91 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 91 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
| 92 JSObject::New(target, new_target)); | 92 JSObject::New(target, new_target)); |
| 93 for (int i = 0; i < ArrayBufferView::kInternalFieldCount; ++i) { | 93 for (int i = 0; i < ArrayBufferView::kEmbedderFieldCount; ++i) { |
| 94 Handle<JSDataView>::cast(result)->SetInternalField(i, Smi::kZero); | 94 Handle<JSDataView>::cast(result)->SetEmbedderField(i, Smi::kZero); |
| 95 } | 95 } |
| 96 | 96 |
| 97 // 12. Set O's [[ViewedArrayBuffer]] internal slot to buffer. | 97 // 12. Set O's [[ViewedArrayBuffer]] internal slot to buffer. |
| 98 Handle<JSDataView>::cast(result)->set_buffer(*array_buffer); | 98 Handle<JSDataView>::cast(result)->set_buffer(*array_buffer); |
| 99 | 99 |
| 100 // 13. Set O's [[ByteLength]] internal slot to viewByteLength. | 100 // 13. Set O's [[ByteLength]] internal slot to viewByteLength. |
| 101 Handle<JSDataView>::cast(result)->set_byte_length(*view_byte_length); | 101 Handle<JSDataView>::cast(result)->set_byte_length(*view_byte_length); |
| 102 | 102 |
| 103 // 14. Set O's [[ByteOffset]] internal slot to offset. | 103 // 14. Set O's [[ByteOffset]] internal slot to offset. |
| 104 Handle<JSDataView>::cast(result)->set_byte_offset(*offset); | 104 Handle<JSDataView>::cast(result)->set_byte_offset(*offset); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 DATA_VIEW_PROTOTYPE_SET(Int16, int16_t) | 331 DATA_VIEW_PROTOTYPE_SET(Int16, int16_t) |
| 332 DATA_VIEW_PROTOTYPE_SET(Uint16, uint16_t) | 332 DATA_VIEW_PROTOTYPE_SET(Uint16, uint16_t) |
| 333 DATA_VIEW_PROTOTYPE_SET(Int32, int32_t) | 333 DATA_VIEW_PROTOTYPE_SET(Int32, int32_t) |
| 334 DATA_VIEW_PROTOTYPE_SET(Uint32, uint32_t) | 334 DATA_VIEW_PROTOTYPE_SET(Uint32, uint32_t) |
| 335 DATA_VIEW_PROTOTYPE_SET(Float32, float) | 335 DATA_VIEW_PROTOTYPE_SET(Float32, float) |
| 336 DATA_VIEW_PROTOTYPE_SET(Float64, double) | 336 DATA_VIEW_PROTOTYPE_SET(Float64, double) |
| 337 #undef DATA_VIEW_PROTOTYPE_SET | 337 #undef DATA_VIEW_PROTOTYPE_SET |
| 338 | 338 |
| 339 } // namespace internal | 339 } // namespace internal |
| 340 } // namespace v8 | 340 } // namespace v8 |
| OLD | NEW |