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 9910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9921 NoObservableSideEffectsScope scope(this); | 9921 NoObservableSideEffectsScope scope(this); |
9922 DCHECK(expr->arguments()->length() == 1); | 9922 DCHECK(expr->arguments()->length() == 1); |
9923 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); | 9923 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); |
9924 HValue* view = Pop(); | 9924 HValue* view = Pop(); |
9925 | 9925 |
9926 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( | 9926 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( |
9927 view, nullptr, | 9927 view, nullptr, |
9928 FieldIndex::ForInObjectOffset(JSArrayBufferView::kByteOffsetOffset))); | 9928 FieldIndex::ForInObjectOffset(JSArrayBufferView::kByteOffsetOffset))); |
9929 } | 9929 } |
9930 | 9930 |
| 9931 void HOptimizedGraphBuilder::GenerateArrayBufferViewWasNeutered( |
| 9932 CallRuntime* expr) { |
| 9933 NoObservableSideEffectsScope scope(this); |
| 9934 DCHECK_EQ(expr->arguments()->length(), 1); |
| 9935 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); |
| 9936 HValue* view = Pop(); |
| 9937 |
| 9938 HInstruction* buffer = Add<HLoadNamedField>( |
| 9939 view, nullptr, HObjectAccess::ForJSArrayBufferViewBuffer()); |
| 9940 HInstruction* flags = Add<HLoadNamedField>( |
| 9941 buffer, nullptr, HObjectAccess::ForJSArrayBufferBitField()); |
| 9942 HValue* was_neutered_mask = |
| 9943 Add<HConstant>(1 << JSArrayBuffer::WasNeutered::kShift); |
| 9944 HValue* was_neutered = |
| 9945 AddUncasted<HBitwise>(Token::BIT_AND, flags, was_neutered_mask); |
| 9946 return ast_context()->ReturnValue(was_neutered); |
| 9947 } |
9931 | 9948 |
9932 void HOptimizedGraphBuilder::GenerateTypedArrayGetLength( | 9949 void HOptimizedGraphBuilder::GenerateTypedArrayGetLength( |
9933 CallRuntime* expr) { | 9950 CallRuntime* expr) { |
9934 NoObservableSideEffectsScope scope(this); | 9951 NoObservableSideEffectsScope scope(this); |
9935 DCHECK(expr->arguments()->length() == 1); | 9952 DCHECK(expr->arguments()->length() == 1); |
9936 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); | 9953 CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); |
9937 HValue* view = Pop(); | 9954 HValue* view = Pop(); |
9938 | 9955 |
9939 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( | 9956 return ast_context()->ReturnValue(BuildArrayBufferViewFieldAccessor( |
9940 view, nullptr, | 9957 view, nullptr, |
(...skipping 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12745 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12762 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12746 } | 12763 } |
12747 | 12764 |
12748 #ifdef DEBUG | 12765 #ifdef DEBUG |
12749 graph_->Verify(false); // No full verify. | 12766 graph_->Verify(false); // No full verify. |
12750 #endif | 12767 #endif |
12751 } | 12768 } |
12752 | 12769 |
12753 } // namespace internal | 12770 } // namespace internal |
12754 } // namespace v8 | 12771 } // namespace v8 |
OLD | NEW |