| 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/v8.h" | 9 #include "src/v8.h" |
| 10 | 10 |
| (...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2432 } else { | 2432 } else { |
| 2433 backing_store = elements; | 2433 backing_store = elements; |
| 2434 } | 2434 } |
| 2435 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { | 2435 if (store_mode == STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS) { |
| 2436 NoObservableSideEffectsScope no_effects(this); | 2436 NoObservableSideEffectsScope no_effects(this); |
| 2437 if (IsExternalArrayElementsKind(elements_kind)) { | 2437 if (IsExternalArrayElementsKind(elements_kind)) { |
| 2438 HInstruction* buffer = | 2438 HInstruction* buffer = |
| 2439 Add<HLoadNamedField>(checked_object, nullptr, | 2439 Add<HLoadNamedField>(checked_object, nullptr, |
| 2440 HObjectAccess::ForJSArrayBufferViewBuffer()); | 2440 HObjectAccess::ForJSArrayBufferViewBuffer()); |
| 2441 HInstruction* flags = Add<HLoadNamedField>( | 2441 HInstruction* flags = Add<HLoadNamedField>( |
| 2442 buffer, nullptr, HObjectAccess::ForJSArrayBufferFlag()); | 2442 buffer, nullptr, HObjectAccess::ForJSArrayBufferBitField()); |
| 2443 HValue* was_neutered_mask = | 2443 HValue* was_neutered_mask = |
| 2444 Add<HConstant>(1 << JSArrayBuffer::kWasNeuteredBit); | 2444 Add<HConstant>(1 << JSArrayBuffer::WasNeutered::kShift); |
| 2445 HValue* was_neutered_test = | 2445 HValue* was_neutered_test = |
| 2446 AddUncasted<HBitwise>(Token::BIT_AND, flags, was_neutered_mask); | 2446 AddUncasted<HBitwise>(Token::BIT_AND, flags, was_neutered_mask); |
| 2447 | 2447 |
| 2448 IfBuilder if_was_neutered(this); | 2448 IfBuilder if_was_neutered(this); |
| 2449 if_was_neutered.If<HCompareNumericAndBranch>( | 2449 if_was_neutered.If<HCompareNumericAndBranch>( |
| 2450 was_neutered_test, graph()->GetConstant0(), Token::NE); | 2450 was_neutered_test, graph()->GetConstant0(), Token::NE); |
| 2451 if_was_neutered.ThenDeopt(Deoptimizer::kOutOfBounds); | 2451 if_was_neutered.ThenDeopt(Deoptimizer::kOutOfBounds); |
| 2452 if_was_neutered.End(); | 2452 if_was_neutered.End(); |
| 2453 } | 2453 } |
| 2454 IfBuilder length_checker(this); | 2454 IfBuilder length_checker(this); |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3188 index.offset(), Representation::Tagged()); | 3188 index.offset(), Representation::Tagged()); |
| 3189 HInstruction* buffer = Add<HLoadNamedField>( | 3189 HInstruction* buffer = Add<HLoadNamedField>( |
| 3190 object, checked_object, HObjectAccess::ForJSArrayBufferViewBuffer()); | 3190 object, checked_object, HObjectAccess::ForJSArrayBufferViewBuffer()); |
| 3191 HInstruction* field = Add<HLoadNamedField>(object, checked_object, access); | 3191 HInstruction* field = Add<HLoadNamedField>(object, checked_object, access); |
| 3192 | 3192 |
| 3193 IfBuilder if_has_buffer(this); | 3193 IfBuilder if_has_buffer(this); |
| 3194 HValue* has_buffer = if_has_buffer.IfNot<HIsSmiAndBranch>(buffer); | 3194 HValue* has_buffer = if_has_buffer.IfNot<HIsSmiAndBranch>(buffer); |
| 3195 if_has_buffer.Then(); | 3195 if_has_buffer.Then(); |
| 3196 { | 3196 { |
| 3197 HInstruction* flags = Add<HLoadNamedField>( | 3197 HInstruction* flags = Add<HLoadNamedField>( |
| 3198 buffer, has_buffer, HObjectAccess::ForJSArrayBufferFlag()); | 3198 buffer, has_buffer, HObjectAccess::ForJSArrayBufferBitField()); |
| 3199 HValue* was_neutered_mask = | 3199 HValue* was_neutered_mask = |
| 3200 Add<HConstant>(1 << JSArrayBuffer::kWasNeuteredBit); | 3200 Add<HConstant>(1 << JSArrayBuffer::WasNeutered::kShift); |
| 3201 HValue* was_neutered_test = | 3201 HValue* was_neutered_test = |
| 3202 AddUncasted<HBitwise>(Token::BIT_AND, flags, was_neutered_mask); | 3202 AddUncasted<HBitwise>(Token::BIT_AND, flags, was_neutered_mask); |
| 3203 | 3203 |
| 3204 IfBuilder if_was_neutered(this); | 3204 IfBuilder if_was_neutered(this); |
| 3205 if_was_neutered.If<HCompareNumericAndBranch>( | 3205 if_was_neutered.If<HCompareNumericAndBranch>( |
| 3206 was_neutered_test, graph()->GetConstant0(), Token::NE); | 3206 was_neutered_test, graph()->GetConstant0(), Token::NE); |
| 3207 if_was_neutered.Then(); | 3207 if_was_neutered.Then(); |
| 3208 Push(graph()->GetConstant0()); | 3208 Push(graph()->GetConstant0()); |
| 3209 if_was_neutered.Else(); | 3209 if_was_neutered.Else(); |
| 3210 Push(field); | 3210 Push(field); |
| (...skipping 9918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13129 if (ShouldProduceTraceOutput()) { | 13129 if (ShouldProduceTraceOutput()) { |
| 13130 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13130 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13131 } | 13131 } |
| 13132 | 13132 |
| 13133 #ifdef DEBUG | 13133 #ifdef DEBUG |
| 13134 graph_->Verify(false); // No full verify. | 13134 graph_->Verify(false); // No full verify. |
| 13135 #endif | 13135 #endif |
| 13136 } | 13136 } |
| 13137 | 13137 |
| 13138 } } // namespace v8::internal | 13138 } } // namespace v8::internal |
| OLD | NEW |