Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: src/objects.h

Issue 684103002: allow disabling of ArrayBuffer neutering (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 9943 matching lines...) Expand 10 before | Expand all | Expand 10 after
9954 9954
9955 // [flags] 9955 // [flags]
9956 DECL_ACCESSORS(flag, Smi) 9956 DECL_ACCESSORS(flag, Smi)
9957 9957
9958 inline bool is_external(); 9958 inline bool is_external();
9959 inline void set_is_external(bool value); 9959 inline void set_is_external(bool value);
9960 9960
9961 inline bool should_be_freed(); 9961 inline bool should_be_freed();
9962 inline void set_should_be_freed(bool value); 9962 inline void set_should_be_freed(bool value);
9963 9963
9964 inline bool is_neuterable();
9965 inline void set_is_neuterable(bool value);
9966
9964 // [weak_next]: linked list of array buffers. 9967 // [weak_next]: linked list of array buffers.
9965 DECL_ACCESSORS(weak_next, Object) 9968 DECL_ACCESSORS(weak_next, Object)
9966 9969
9967 // [weak_first_array]: weak linked list of views. 9970 // [weak_first_array]: weak linked list of views.
9968 DECL_ACCESSORS(weak_first_view, Object) 9971 DECL_ACCESSORS(weak_first_view, Object)
9969 9972
9970 DECLARE_CAST(JSArrayBuffer) 9973 DECLARE_CAST(JSArrayBuffer)
9971 9974
9972 // Neutering. Only neuters the buffer, not associated typed arrays. 9975 // Neutering. Only neuters the buffer, not associated typed arrays.
9973 void Neuter(); 9976 void Neuter();
9974 9977
9975 // Dispatched behavior. 9978 // Dispatched behavior.
9976 DECLARE_PRINTER(JSArrayBuffer) 9979 DECLARE_PRINTER(JSArrayBuffer)
9977 DECLARE_VERIFIER(JSArrayBuffer) 9980 DECLARE_VERIFIER(JSArrayBuffer)
9978 9981
9979 static const int kBackingStoreOffset = JSObject::kHeaderSize; 9982 static const int kBackingStoreOffset = JSObject::kHeaderSize;
9980 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; 9983 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
9981 static const int kFlagOffset = kByteLengthOffset + kPointerSize; 9984 static const int kFlagOffset = kByteLengthOffset + kPointerSize;
9982 static const int kWeakNextOffset = kFlagOffset + kPointerSize; 9985 static const int kWeakNextOffset = kFlagOffset + kPointerSize;
9983 static const int kWeakFirstViewOffset = kWeakNextOffset + kPointerSize; 9986 static const int kWeakFirstViewOffset = kWeakNextOffset + kPointerSize;
9984 static const int kSize = kWeakFirstViewOffset + kPointerSize; 9987 static const int kSize = kWeakFirstViewOffset + kPointerSize;
9985 9988
9986 static const int kSizeWithInternalFields = 9989 static const int kSizeWithInternalFields =
9987 kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize; 9990 kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize;
9988 9991
9989 private: 9992 private:
9990 // Bit position in a flag 9993 // Bit position in a flag
9991 static const int kIsExternalBit = 0; 9994 static const int kIsExternalBit = 0;
9992 static const int kShouldBeFreed = 1; 9995 static const int kShouldBeFreed = 1;
9996 static const int kIsNeuterableBit = 2;
9993 9997
9994 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer); 9998 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer);
9995 }; 9999 };
9996 10000
9997 10001
9998 class JSArrayBufferView: public JSObject { 10002 class JSArrayBufferView: public JSObject {
9999 public: 10003 public:
10000 // [buffer]: ArrayBuffer that this typed array views. 10004 // [buffer]: ArrayBuffer that this typed array views.
10001 DECL_ACCESSORS(buffer, Object) 10005 DECL_ACCESSORS(buffer, Object)
10002 10006
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
10909 } else { 10913 } else {
10910 value &= ~(1 << bit_position); 10914 value &= ~(1 << bit_position);
10911 } 10915 }
10912 return value; 10916 return value;
10913 } 10917 }
10914 }; 10918 };
10915 10919
10916 } } // namespace v8::internal 10920 } } // namespace v8::internal
10917 10921
10918 #endif // V8_OBJECTS_H_ 10922 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698