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

Unified Diff: src/bootstrapper.cc

Issue 1347263003: Pretenure builtin typed arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 34e4dcf6eb470c9c98884bd807365bb2ca0657b0..5bd2bc7b3583dda3171c5c910afaadd6bec402e2 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1730,18 +1730,21 @@ static Handle<JSObject> ResolveBuiltinIdHolder(Handle<Context> native_context,
template <typename Data>
Data* SetBuiltinTypedArray(Isolate* isolate, Handle<JSBuiltinsObject> builtins,
ExternalArrayType type, Data* data,
- size_t num_elements, const char* name) {
+ size_t num_elements, const char* name,
+ const SharedFlag shared = SharedFlag::kNotShared,
+ const PretenureFlag pretenure = TENURED) {
size_t byte_length = num_elements * sizeof(*data);
- Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer();
+ Handle<JSArrayBuffer> buffer =
+ isolate->factory()->NewJSArrayBuffer(shared, pretenure);
bool is_external = data != nullptr;
if (!is_external) {
data = reinterpret_cast<Data*>(
isolate->array_buffer_allocator()->Allocate(byte_length));
}
- JSArrayBuffer::Setup(buffer, isolate, is_external, data, byte_length);
+ JSArrayBuffer::Setup(buffer, isolate, is_external, data, byte_length, shared);
- Handle<JSTypedArray> typed_array =
- isolate->factory()->NewJSTypedArray(type, buffer, 0, num_elements);
+ Handle<JSTypedArray> typed_array = isolate->factory()->NewJSTypedArray(
+ type, buffer, 0, num_elements, pretenure);
Handle<String> name_string = isolate->factory()->InternalizeUtf8String(name);
// Reset property cell type before (re)initializing.
JSBuiltinsObject::InvalidatePropertyCell(builtins, name_string);
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698