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

Side by Side Diff: src/runtime/runtime-typedarray.cc

Issue 851073002: Fix remaining issues in the custom snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix heap snapshot test expectation Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/serialize.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/runtime/runtime.h" 8 #include "src/runtime/runtime.h"
9 #include "src/runtime/runtime-utils.h" 9 #include "src/runtime/runtime-utils.h"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 array_buffer->set_weak_first_view(isolate->heap()->undefined_value()); 56 array_buffer->set_weak_first_view(isolate->heap()->undefined_value());
57 } 57 }
58 58
59 59
60 bool Runtime::SetupArrayBufferAllocatingData(Isolate* isolate, 60 bool Runtime::SetupArrayBufferAllocatingData(Isolate* isolate,
61 Handle<JSArrayBuffer> array_buffer, 61 Handle<JSArrayBuffer> array_buffer,
62 size_t allocated_length, 62 size_t allocated_length,
63 bool initialize) { 63 bool initialize) {
64 void* data; 64 void* data;
65 CHECK(V8::ArrayBufferAllocator() != NULL); 65 CHECK(V8::ArrayBufferAllocator() != NULL);
66 // Prevent creating array buffers when serializing.
67 DCHECK(!isolate->serializer_enabled());
66 if (allocated_length != 0) { 68 if (allocated_length != 0) {
67 if (initialize) { 69 if (initialize) {
68 data = V8::ArrayBufferAllocator()->Allocate(allocated_length); 70 data = V8::ArrayBufferAllocator()->Allocate(allocated_length);
69 } else { 71 } else {
70 data = 72 data =
71 V8::ArrayBufferAllocator()->AllocateUninitialized(allocated_length); 73 V8::ArrayBufferAllocator()->AllocateUninitialized(allocated_length);
72 } 74 }
73 if (data == NULL) return false; 75 if (data == NULL) return false;
74 } else { 76 } else {
75 data = NULL; 77 data = NULL;
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 DATA_VIEW_SETTER(Uint16, uint16_t) 761 DATA_VIEW_SETTER(Uint16, uint16_t)
760 DATA_VIEW_SETTER(Int16, int16_t) 762 DATA_VIEW_SETTER(Int16, int16_t)
761 DATA_VIEW_SETTER(Uint32, uint32_t) 763 DATA_VIEW_SETTER(Uint32, uint32_t)
762 DATA_VIEW_SETTER(Int32, int32_t) 764 DATA_VIEW_SETTER(Int32, int32_t)
763 DATA_VIEW_SETTER(Float32, float) 765 DATA_VIEW_SETTER(Float32, float)
764 DATA_VIEW_SETTER(Float64, double) 766 DATA_VIEW_SETTER(Float64, double)
765 767
766 #undef DATA_VIEW_SETTER 768 #undef DATA_VIEW_SETTER
767 } 769 }
768 } // namespace v8::internal 770 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698