| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 19470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19481 Handle<String> src = handle(String::cast(the_script->source()), isolate); | 19481 Handle<String> src = handle(String::cast(the_script->source()), isolate); |
| 19482 return isolate->factory()->NewSubString(src, info.line_start, info.line_end); | 19482 return isolate->factory()->NewSubString(src, info.line_start, info.line_end); |
| 19483 } | 19483 } |
| 19484 | 19484 |
| 19485 void JSArrayBuffer::Neuter() { | 19485 void JSArrayBuffer::Neuter() { |
| 19486 CHECK(is_neuterable()); | 19486 CHECK(is_neuterable()); |
| 19487 CHECK(is_external()); | 19487 CHECK(is_external()); |
| 19488 set_backing_store(NULL); | 19488 set_backing_store(NULL); |
| 19489 set_byte_length(Smi::kZero); | 19489 set_byte_length(Smi::kZero); |
| 19490 set_was_neutered(true); | 19490 set_was_neutered(true); |
| 19491 // Invalidate the neutering protector. |
| 19492 Isolate* const isolate = GetIsolate(); |
| 19493 if (isolate->IsArrayBufferNeuteringIntact()) { |
| 19494 isolate->InvalidateArrayBufferNeuteringProtector(); |
| 19495 } |
| 19491 } | 19496 } |
| 19492 | 19497 |
| 19493 | 19498 |
| 19494 void JSArrayBuffer::Setup(Handle<JSArrayBuffer> array_buffer, Isolate* isolate, | 19499 void JSArrayBuffer::Setup(Handle<JSArrayBuffer> array_buffer, Isolate* isolate, |
| 19495 bool is_external, void* data, size_t allocated_length, | 19500 bool is_external, void* data, size_t allocated_length, |
| 19496 SharedFlag shared) { | 19501 SharedFlag shared) { |
| 19497 DCHECK(array_buffer->GetInternalFieldCount() == | 19502 DCHECK(array_buffer->GetInternalFieldCount() == |
| 19498 v8::ArrayBuffer::kInternalFieldCount); | 19503 v8::ArrayBuffer::kInternalFieldCount); |
| 19499 for (int i = 0; i < v8::ArrayBuffer::kInternalFieldCount; i++) { | 19504 for (int i = 0; i < v8::ArrayBuffer::kInternalFieldCount; i++) { |
| 19500 array_buffer->SetInternalField(i, Smi::kZero); | 19505 array_buffer->SetInternalField(i, Smi::kZero); |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20414 // depend on this. | 20419 // depend on this. |
| 20415 return DICTIONARY_ELEMENTS; | 20420 return DICTIONARY_ELEMENTS; |
| 20416 } | 20421 } |
| 20417 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20422 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
| 20418 return kind; | 20423 return kind; |
| 20419 } | 20424 } |
| 20420 } | 20425 } |
| 20421 | 20426 |
| 20422 } // namespace internal | 20427 } // namespace internal |
| 20423 } // namespace v8 | 20428 } // namespace v8 |
| OLD | NEW |