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

Side by Side Diff: src/objects.cc

Issue 2504163002: [turbofan] Don't check for neutered array buffers eagerly. (Closed)
Patch Set: Created 4 years, 1 month 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/isolate-inl.h ('k') | test/mjsunit/es6/typedarray-neutered.js » ('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 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
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
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
OLDNEW
« no previous file with comments | « src/isolate-inl.h ('k') | test/mjsunit/es6/typedarray-neutered.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698