Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index dbbddf3ba697fe97f08856fe6f16eebb393c4686..91691e08baac35879bf7fad76cde16f7a59451af 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -9924,6 +9924,23 @@ void HOptimizedGraphBuilder::GenerateArrayBufferViewGetByteOffset( |
FieldIndex::ForInObjectOffset(JSArrayBufferView::kByteOffsetOffset))); |
} |
+void HOptimizedGraphBuilder::GenerateArrayBufferViewWasNeutered( |
+ CallRuntime* expr) { |
+ NoObservableSideEffectsScope scope(this); |
+ DCHECK_EQ(expr->arguments()->length(), 1); |
+ CHECK_ALIVE(VisitForValue(expr->arguments()->at(0))); |
+ HValue* view = Pop(); |
+ |
+ HInstruction* buffer = Add<HLoadNamedField>( |
+ view, nullptr, HObjectAccess::ForJSArrayBufferViewBuffer()); |
+ HInstruction* flags = Add<HLoadNamedField>( |
+ buffer, nullptr, HObjectAccess::ForJSArrayBufferBitField()); |
+ HValue* was_neutered_mask = |
+ Add<HConstant>(1 << JSArrayBuffer::WasNeutered::kShift); |
+ HValue* was_neutered = |
+ AddUncasted<HBitwise>(Token::BIT_AND, flags, was_neutered_mask); |
+ return ast_context()->ReturnValue(was_neutered); |
+} |
void HOptimizedGraphBuilder::GenerateTypedArrayGetLength( |
CallRuntime* expr) { |