| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
| 8 #include "src/crankshaft/hydrogen.h" | 8 #include "src/crankshaft/hydrogen.h" |
| 9 #include "src/crankshaft/lithium.h" | 9 #include "src/crankshaft/lithium.h" |
| 10 #include "src/field-index.h" | 10 #include "src/field-index.h" |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 Add<HConstant>(static_cast<int>(Map::IsPrototypeMapBits::kMask) | | 756 Add<HConstant>(static_cast<int>(Map::IsPrototypeMapBits::kMask) | |
| 757 (1 << Map::kIsExtensible)); | 757 (1 << Map::kIsExtensible)); |
| 758 HValue* bits = AddUncasted<HBitwise>(Token::BIT_AND, bit_field2, mask); | 758 HValue* bits = AddUncasted<HBitwise>(Token::BIT_AND, bit_field2, mask); |
| 759 IfBuilder check(this); | 759 IfBuilder check(this); |
| 760 check.If<HCompareNumericAndBranch>( | 760 check.If<HCompareNumericAndBranch>( |
| 761 bits, Add<HConstant>(1 << Map::kIsExtensible), Token::NE); | 761 bits, Add<HConstant>(1 << Map::kIsExtensible), Token::NE); |
| 762 check.ThenDeopt(Deoptimizer::kFastArrayPushFailed); | 762 check.ThenDeopt(Deoptimizer::kFastArrayPushFailed); |
| 763 check.End(); | 763 check.End(); |
| 764 } | 764 } |
| 765 | 765 |
| 766 // Disallow pushing onto observed objects. | |
| 767 { | |
| 768 HValue* bit_field = | |
| 769 Add<HLoadNamedField>(map, nullptr, HObjectAccess::ForMapBitField()); | |
| 770 HValue* mask = Add<HConstant>(1 << Map::kIsObserved); | |
| 771 HValue* bit = AddUncasted<HBitwise>(Token::BIT_AND, bit_field, mask); | |
| 772 IfBuilder check(this); | |
| 773 check.If<HCompareNumericAndBranch>(bit, mask, Token::EQ); | |
| 774 check.ThenDeopt(Deoptimizer::kFastArrayPushFailed); | |
| 775 check.End(); | |
| 776 } | |
| 777 | |
| 778 // Disallow pushing onto arrays in dictionary named property mode. We need to | 766 // Disallow pushing onto arrays in dictionary named property mode. We need to |
| 779 // figure out whether the length property is still writable. | 767 // figure out whether the length property is still writable. |
| 780 { | 768 { |
| 781 HValue* bit_field3 = | 769 HValue* bit_field3 = |
| 782 Add<HLoadNamedField>(map, nullptr, HObjectAccess::ForMapBitField3()); | 770 Add<HLoadNamedField>(map, nullptr, HObjectAccess::ForMapBitField3()); |
| 783 HValue* mask = Add<HConstant>(static_cast<int>(Map::DictionaryMap::kMask)); | 771 HValue* mask = Add<HConstant>(static_cast<int>(Map::DictionaryMap::kMask)); |
| 784 HValue* bit = AddUncasted<HBitwise>(Token::BIT_AND, bit_field3, mask); | 772 HValue* bit = AddUncasted<HBitwise>(Token::BIT_AND, bit_field3, mask); |
| 785 IfBuilder check(this); | 773 IfBuilder check(this); |
| 786 check.If<HCompareNumericAndBranch>(bit, mask, Token::EQ); | 774 check.If<HCompareNumericAndBranch>(bit, mask, Token::EQ); |
| 787 check.ThenDeopt(Deoptimizer::kFastArrayPushFailed); | 775 check.ThenDeopt(Deoptimizer::kFastArrayPushFailed); |
| (...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2304 return Pop(); | 2292 return Pop(); |
| 2305 } | 2293 } |
| 2306 | 2294 |
| 2307 | 2295 |
| 2308 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 2296 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
| 2309 return DoGenerateCode(this); | 2297 return DoGenerateCode(this); |
| 2310 } | 2298 } |
| 2311 | 2299 |
| 2312 } // namespace internal | 2300 } // namespace internal |
| 2313 } // namespace v8 | 2301 } // namespace v8 |
| OLD | NEW |