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 9709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9720 context(), nullptr, | 9720 context(), nullptr, |
9721 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); | 9721 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); |
9722 HValue* native_context = Add<HLoadNamedField>( | 9722 HValue* native_context = Add<HLoadNamedField>( |
9723 global_object, nullptr, HObjectAccess::ForGlobalObjectNativeContext()); | 9723 global_object, nullptr, HObjectAccess::ForGlobalObjectNativeContext()); |
9724 Add<HStoreNamedField>( | 9724 Add<HStoreNamedField>( |
9725 result, HObjectAccess::ForMap(), | 9725 result, HObjectAccess::ForMap(), |
9726 Add<HLoadNamedField>( | 9726 Add<HLoadNamedField>( |
9727 native_context, nullptr, | 9727 native_context, nullptr, |
9728 HObjectAccess::ForContextSlot(Context::ARRAY_BUFFER_MAP_INDEX))); | 9728 HObjectAccess::ForContextSlot(Context::ARRAY_BUFFER_MAP_INDEX))); |
9729 | 9729 |
9730 Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferBackingStore(), | 9730 HConstant* empty_fixed_array = |
9731 Add<HConstant>(ExternalReference())); | 9731 Add<HConstant>(isolate()->factory()->empty_fixed_array()); |
| 9732 Add<HStoreNamedField>( |
| 9733 result, HObjectAccess::ForJSArrayOffset(JSArray::kPropertiesOffset), |
| 9734 empty_fixed_array); |
| 9735 Add<HStoreNamedField>( |
| 9736 result, HObjectAccess::ForJSArrayOffset(JSArray::kElementsOffset), |
| 9737 empty_fixed_array); |
| 9738 Add<HStoreNamedField>( |
| 9739 result, HObjectAccess::ForJSArrayBufferBackingStore().WithRepresentation( |
| 9740 Representation::Smi()), |
| 9741 graph()->GetConstant0()); |
9732 Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferByteLength(), | 9742 Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferByteLength(), |
9733 byte_length); | 9743 byte_length); |
9734 Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferBitFieldSlot(), | 9744 Add<HStoreNamedField>(result, HObjectAccess::ForJSArrayBufferBitFieldSlot(), |
9735 graph()->GetConstant0()); | 9745 graph()->GetConstant0()); |
9736 Add<HStoreNamedField>( | 9746 Add<HStoreNamedField>( |
9737 result, HObjectAccess::ForJSArrayBufferBitField(), | 9747 result, HObjectAccess::ForJSArrayBufferBitField(), |
9738 Add<HConstant>((1 << JSArrayBuffer::IsExternal::kShift) | | 9748 Add<HConstant>((1 << JSArrayBuffer::IsExternal::kShift) | |
9739 (1 << JSArrayBuffer::IsNeuterable::kShift))); | 9749 (1 << JSArrayBuffer::IsNeuterable::kShift))); |
9740 | 9750 |
9741 for (int field = 0; field < v8::ArrayBuffer::kInternalFieldCount; ++field) { | 9751 for (int field = 0; field < v8::ArrayBuffer::kInternalFieldCount; ++field) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9928 static const int kBufferArg = 2; | 9938 static const int kBufferArg = 2; |
9929 static const int kByteOffsetArg = 3; | 9939 static const int kByteOffsetArg = 3; |
9930 static const int kByteLengthArg = 4; | 9940 static const int kByteLengthArg = 4; |
9931 static const int kArgsLength = 5; | 9941 static const int kArgsLength = 5; |
9932 DCHECK(arguments->length() == kArgsLength); | 9942 DCHECK(arguments->length() == kArgsLength); |
9933 | 9943 |
9934 | 9944 |
9935 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); | 9945 CHECK_ALIVE(VisitForValue(arguments->at(kObjectArg))); |
9936 HValue* obj = Pop(); | 9946 HValue* obj = Pop(); |
9937 | 9947 |
9938 if (arguments->at(kArrayIdArg)->IsLiteral()) { | 9948 if (!arguments->at(kArrayIdArg)->IsLiteral()) { |
9939 // This should never happen in real use, but can happen when fuzzing. | 9949 // This should never happen in real use, but can happen when fuzzing. |
9940 // Just bail out. | 9950 // Just bail out. |
9941 Bailout(kNeedSmiLiteral); | 9951 Bailout(kNeedSmiLiteral); |
9942 return; | 9952 return; |
9943 } | 9953 } |
9944 Handle<Object> value = | 9954 Handle<Object> value = |
9945 static_cast<Literal*>(arguments->at(kArrayIdArg))->value(); | 9955 static_cast<Literal*>(arguments->at(kArrayIdArg))->value(); |
9946 if (!value->IsSmi()) { | 9956 if (!value->IsSmi()) { |
9947 // This should never happen in real use, but can happen when fuzzing. | 9957 // This should never happen in real use, but can happen when fuzzing. |
9948 // Just bail out. | 9958 // Just bail out. |
(...skipping 3188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13137 if (ShouldProduceTraceOutput()) { | 13147 if (ShouldProduceTraceOutput()) { |
13138 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13148 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13139 } | 13149 } |
13140 | 13150 |
13141 #ifdef DEBUG | 13151 #ifdef DEBUG |
13142 graph_->Verify(false); // No full verify. | 13152 graph_->Verify(false); // No full verify. |
13143 #endif | 13153 #endif |
13144 } | 13154 } |
13145 | 13155 |
13146 } } // namespace v8::internal | 13156 } } // namespace v8::internal |
OLD | NEW |