Lines Matching +full:js +full:- +full:native +full:- +full:api
7 #include "util-inl.h"
13 * Do not use this class directly when creating instances of it - use the
16 * This class encapsulates the technique of having a native buffer mapped to
17 * a JS object. Writes to the native buffer can happen efficiently without
18 * going through JS, and the data is then available to user's via the exposed
19 * JS object.
22 * write to JS program state w/out going through the standard
23 * (monitored) API. Thus any VM capabilities to detect the modification are
45 buffer_ = static_cast<NativeT*>(ab->GetContents().Data()); in AliasedBufferBase()
53 * Create an AliasedBufferBase over a sub-region of another aliased buffer.
55 * a native buffer, but will each read/write to different sections of the
56 * native buffer.
60 // TODO(refack): refactor into a non-owning `AliasedBufferBaseView`
72 CHECK_EQ(byte_offset & (sizeof(NativeT) - 1), 0); in AliasedBufferBase()
75 ab->ByteLength() - byte_offset); in AliasedBufferBase()
93 this->~AliasedBufferBase();
121 aliased_buffer_->SetValue(index_, val);
130 return aliased_buffer_->GetValue(index_); in NativeT()
134 const NativeT current = aliased_buffer_->GetValue(index_);
135 aliased_buffer_->SetValue(index_, current + val);
140 return this->operator+=(static_cast<NativeT>(val));
143 inline Reference& operator-=(const NativeT& val) {
144 const NativeT current = aliased_buffer_->GetValue(index_);
145 aliased_buffer_->SetValue(index_, current - val);
155 * Get the underlying v8 TypedArray overlayed on top of the native buffer
163 * overlaying the native buffer
166 return GetJSArray()->Buffer(); in GetArrayBuffer()
170 * Get the underlying native buffer. Note that all reads/writes should occur
231 // allocate new native buffer in reserve()
232 NativeT* new_buffer = static_cast<NativeT*>(ab->GetContents().Data()); in reserve()