OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 8736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8747 | 8747 |
8748 | 8748 |
8749 class JSArrayBuffer: public JSObject { | 8749 class JSArrayBuffer: public JSObject { |
8750 public: | 8750 public: |
8751 // [backing_store]: backing memory for this array | 8751 // [backing_store]: backing memory for this array |
8752 DECL_ACCESSORS(backing_store, void) | 8752 DECL_ACCESSORS(backing_store, void) |
8753 | 8753 |
8754 // [byte_length]: length in bytes | 8754 // [byte_length]: length in bytes |
8755 DECL_ACCESSORS(byte_length, Object) | 8755 DECL_ACCESSORS(byte_length, Object) |
8756 | 8756 |
| 8757 // [flags] |
| 8758 DECL_ACCESSORS(flag, Smi) |
| 8759 |
| 8760 inline bool is_external(); |
| 8761 inline void set_is_external(bool value); |
| 8762 |
8757 // Casting. | 8763 // Casting. |
8758 static inline JSArrayBuffer* cast(Object* obj); | 8764 static inline JSArrayBuffer* cast(Object* obj); |
8759 | 8765 |
8760 // Dispatched behavior. | 8766 // Dispatched behavior. |
8761 DECLARE_PRINTER(JSArrayBuffer) | 8767 DECLARE_PRINTER(JSArrayBuffer) |
8762 DECLARE_VERIFIER(JSArrayBuffer) | 8768 DECLARE_VERIFIER(JSArrayBuffer) |
8763 | 8769 |
8764 static const int kBackingStoreOffset = JSObject::kHeaderSize; | 8770 static const int kBackingStoreOffset = JSObject::kHeaderSize; |
8765 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; | 8771 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; |
8766 static const int kSize = kByteLengthOffset + kPointerSize; | 8772 static const int kFlagOffset = kByteLengthOffset + kPointerSize; |
| 8773 static const int kSize = kFlagOffset + kPointerSize; |
8767 | 8774 |
8768 private: | 8775 private: |
| 8776 // Bit position in a flag |
| 8777 static const int kIsExternalBit = 0; |
| 8778 |
8769 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer); | 8779 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer); |
8770 }; | 8780 }; |
8771 | 8781 |
8772 | 8782 |
8773 class JSTypedArray: public JSObject { | 8783 class JSTypedArray: public JSObject { |
8774 public: | 8784 public: |
8775 // [buffer]: ArrayBuffer that this typed array views. | 8785 // [buffer]: ArrayBuffer that this typed array views. |
8776 DECL_ACCESSORS(buffer, Object) | 8786 DECL_ACCESSORS(buffer, Object) |
8777 | 8787 |
8778 // [byte_length]: offset of typed array in bytes. | 8788 // [byte_length]: offset of typed array in bytes. |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9606 } else { | 9616 } else { |
9607 value &= ~(1 << bit_position); | 9617 value &= ~(1 << bit_position); |
9608 } | 9618 } |
9609 return value; | 9619 return value; |
9610 } | 9620 } |
9611 }; | 9621 }; |
9612 | 9622 |
9613 } } // namespace v8::internal | 9623 } } // namespace v8::internal |
9614 | 9624 |
9615 #endif // V8_OBJECTS_H_ | 9625 #endif // V8_OBJECTS_H_ |
OLD | NEW |