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

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 2778623003: [typedarrays] Check detached buffer at start of typed array methods (Closed)
Patch Set: pass test262 for subarray Created 3 years, 8 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/crankshaft/hydrogen.h ('k') | src/js/typedarray.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/crankshaft/hydrogen.h" 5 #include "src/crankshaft/hydrogen.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 9906 matching lines...) Expand 10 before | Expand all | Expand 10 after
9917 NoObservableSideEffectsScope scope(this); 9917 NoObservableSideEffectsScope scope(this);
9918 DCHECK(expr->arguments()->length() == 1); 9918 DCHECK(expr->arguments()->length() == 1);
9919 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); 9919 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
9920 HValue* view = Pop(); 9920 HValue* view = Pop();
9921 9921
9922 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( 9922 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor(
9923 view, nullptr, 9923 view, nullptr,
9924 FieldIndex::ForInObjectOffset(JSArrayBufferView::kByteOffsetOffset))); 9924 FieldIndex::ForInObjectOffset(JSArrayBufferView::kByteOffsetOffset)));
9925 } 9925 }
9926 9926
9927 void HOptimizedGraphBuilder::GenerateArrayBufferViewWasNeutered(
9928 CallRuntime* expr) {
9929 NoObservableSideEffectsScope scope(this);
9930 DCHECK_EQ(expr->arguments()->length(), 1);
9931 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
9932 HValue* view = Pop();
9933
9934 HInstruction* buffer = Add<HLoadNamedField>(
9935 view, nullptr, HObjectAccess::ForJSArrayBufferViewBuffer());
9936 HInstruction* flags = Add<HLoadNamedField>(
9937 buffer, nullptr, HObjectAccess::ForJSArrayBufferBitField());
9938 HValue* was_neutered_mask =
9939 Add<HConstant>(1 << JSArrayBuffer::WasNeutered::kShift);
9940 HValue* was_neutered =
9941 AddUncasted<HBitwise>(Token::BIT_AND, flags, was_neutered_mask);
9942 return ast_context()->ReturnValue(was_neutered);
9943 }
9927 9944
9928 void HOptimizedGraphBuilder::GenerateTypedArrayGetLength( 9945 void HOptimizedGraphBuilder::GenerateTypedArrayGetLength(
9929 CallRuntime* expr) { 9946 CallRuntime* expr) {
9930 NoObservableSideEffectsScope scope(this); 9947 NoObservableSideEffectsScope scope(this);
9931 DCHECK(expr->arguments()->length() == 1); 9948 DCHECK(expr->arguments()->length() == 1);
9932 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); 9949 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0)));
9933 HValue* view = Pop(); 9950 HValue* view = Pop();
9934 9951
9935 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( 9952 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor(
9936 view, nullptr, 9953 view, nullptr,
(...skipping 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after
12735 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12752 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12736 } 12753 }
12737 12754
12738 #ifdef DEBUG 12755 #ifdef DEBUG
12739 graph_->Verify(false); // No full verify. 12756 graph_->Verify(false); // No full verify.
12740 #endif 12757 #endif
12741 } 12758 }
12742 12759
12743 } // namespace internal 12760 } // namespace internal
12744 } // namespace v8 12761 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/js/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698