OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 6902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6913 } | 6913 } |
6914 | 6914 |
6915 | 6915 |
6916 void JSTypedArray::set_length(Object* value, WriteBarrierMode mode) { | 6916 void JSTypedArray::set_length(Object* value, WriteBarrierMode mode) { |
6917 WRITE_FIELD(this, kLengthOffset, value); | 6917 WRITE_FIELD(this, kLengthOffset, value); |
6918 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kLengthOffset, value, mode); | 6918 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kLengthOffset, value, mode); |
6919 } | 6919 } |
6920 | 6920 |
6921 // static | 6921 // static |
6922 MaybeHandle<JSTypedArray> JSTypedArray::Validate(Isolate* isolate, | 6922 MaybeHandle<JSTypedArray> JSTypedArray::Validate(Isolate* isolate, |
6923 Handle<Object> receiver, | 6923 Handle<Object> receiver) { |
danno
2017/04/24 16:11:16
Nice cleanup.
| |
6924 const char* method_name) { | |
6925 if (V8_UNLIKELY(!receiver->IsJSTypedArray())) { | 6924 if (V8_UNLIKELY(!receiver->IsJSTypedArray())) { |
6926 const MessageTemplate::Template message = MessageTemplate::kNotTypedArray; | 6925 const MessageTemplate::Template message = MessageTemplate::kNotTypedArray; |
6927 THROW_NEW_ERROR(isolate, NewTypeError(message), JSTypedArray); | 6926 THROW_NEW_ERROR(isolate, NewTypeError(message), JSTypedArray); |
6928 } | 6927 } |
6929 | 6928 |
6930 // TODO(caitp): throw if array.[[ViewedArrayBuffer]] is neutered (per v8:4648) | 6929 // TODO(caitp): throw if array.[[ViewedArrayBuffer]] is neutered (per v8:4648) |
6931 return Handle<JSTypedArray>::cast(receiver); | 6930 return Handle<JSTypedArray>::cast(receiver); |
6932 } | 6931 } |
6933 | 6932 |
6934 #ifdef VERIFY_HEAP | 6933 #ifdef VERIFY_HEAP |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8270 #undef WRITE_BYTE_FIELD | 8269 #undef WRITE_BYTE_FIELD |
8271 #undef NOBARRIER_READ_BYTE_FIELD | 8270 #undef NOBARRIER_READ_BYTE_FIELD |
8272 #undef NOBARRIER_WRITE_BYTE_FIELD | 8271 #undef NOBARRIER_WRITE_BYTE_FIELD |
8273 | 8272 |
8274 } // namespace internal | 8273 } // namespace internal |
8275 } // namespace v8 | 8274 } // namespace v8 |
8276 | 8275 |
8277 #include "src/objects/object-macros-undef.h" | 8276 #include "src/objects/object-macros-undef.h" |
8278 | 8277 |
8279 #endif // V8_OBJECTS_INL_H_ | 8278 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |