OLD | NEW |
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 Loading... |
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 } | |
9944 | 9927 |
9945 void HOptimizedGraphBuilder::GenerateTypedArrayGetLength( | 9928 void HOptimizedGraphBuilder::GenerateTypedArrayGetLength( |
9946 CallRuntime* expr) { | 9929 CallRuntime* expr) { |
9947 NoObservableSideEffectsScope scope(this); | 9930 NoObservableSideEffectsScope scope(this); |
9948 DCHECK(expr->arguments()->length() == 1); | 9931 DCHECK(expr->arguments()->length() == 1); |
9949 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); | 9932 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); |
9950 HValue* view = Pop(); | 9933 HValue* view = Pop(); |
9951 | 9934 |
9952 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( | 9935 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( |
9953 view, nullptr, | 9936 view, nullptr, |
(...skipping 2798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12752 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12735 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12753 } | 12736 } |
12754 | 12737 |
12755 #ifdef DEBUG | 12738 #ifdef DEBUG |
12756 graph_->Verify(false); // No full verify. | 12739 graph_->Verify(false); // No full verify. |
12757 #endif | 12740 #endif |
12758 } | 12741 } |
12759 | 12742 |
12760 } // namespace internal | 12743 } // namespace internal |
12761 } // namespace v8 | 12744 } // namespace v8 |
OLD | NEW |