OLD | NEW |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 array_buffer->set_flag(Smi::FromInt(0)); | 45 array_buffer->set_flag(Smi::FromInt(0)); |
46 array_buffer->set_is_external(is_external); | 46 array_buffer->set_is_external(is_external); |
47 array_buffer->set_is_neuterable(true); | 47 array_buffer->set_is_neuterable(true); |
48 | 48 |
49 Handle<Object> byte_length = | 49 Handle<Object> byte_length = |
50 isolate->factory()->NewNumberFromSize(allocated_length); | 50 isolate->factory()->NewNumberFromSize(allocated_length); |
51 CHECK(byte_length->IsSmi() || byte_length->IsHeapNumber()); | 51 CHECK(byte_length->IsSmi() || byte_length->IsHeapNumber()); |
52 array_buffer->set_byte_length(*byte_length); | 52 array_buffer->set_byte_length(*byte_length); |
53 | 53 |
54 array_buffer->set_weak_next(isolate->heap()->array_buffers_list()); | 54 array_buffer->set_weak_next(isolate->heap()->array_buffers_list()); |
| 55 CHECK(isolate->heap()->InNewSpace(*array_buffer)); |
55 isolate->heap()->set_array_buffers_list(*array_buffer); | 56 isolate->heap()->set_array_buffers_list(*array_buffer); |
56 array_buffer->set_weak_first_view(isolate->heap()->undefined_value()); | 57 array_buffer->set_weak_first_view(isolate->heap()->undefined_value()); |
57 } | 58 } |
58 | 59 |
59 | 60 |
60 bool Runtime::SetupArrayBufferAllocatingData(Isolate* isolate, | 61 bool Runtime::SetupArrayBufferAllocatingData(Isolate* isolate, |
61 Handle<JSArrayBuffer> array_buffer, | 62 Handle<JSArrayBuffer> array_buffer, |
62 size_t allocated_length, | 63 size_t allocated_length, |
63 bool initialize) { | 64 bool initialize) { |
64 void* data; | 65 void* data; |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 DATA_VIEW_SETTER(Uint16, uint16_t) | 802 DATA_VIEW_SETTER(Uint16, uint16_t) |
802 DATA_VIEW_SETTER(Int16, int16_t) | 803 DATA_VIEW_SETTER(Int16, int16_t) |
803 DATA_VIEW_SETTER(Uint32, uint32_t) | 804 DATA_VIEW_SETTER(Uint32, uint32_t) |
804 DATA_VIEW_SETTER(Int32, int32_t) | 805 DATA_VIEW_SETTER(Int32, int32_t) |
805 DATA_VIEW_SETTER(Float32, float) | 806 DATA_VIEW_SETTER(Float32, float) |
806 DATA_VIEW_SETTER(Float64, double) | 807 DATA_VIEW_SETTER(Float64, double) |
807 | 808 |
808 #undef DATA_VIEW_SETTER | 809 #undef DATA_VIEW_SETTER |
809 } | 810 } |
810 } // namespace v8::internal | 811 } // namespace v8::internal |
OLD | NEW |