OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/code-stub-assembler.h" | 4 #include "src/code-stub-assembler.h" |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/frames-inl.h" | 6 #include "src/frames-inl.h" |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 break; | 1234 break; |
1235 case FLOAT64_ELEMENTS: | 1235 case FLOAT64_ELEMENTS: |
1236 type = MachineType::Float64(); | 1236 type = MachineType::Float64(); |
1237 break; | 1237 break; |
1238 default: | 1238 default: |
1239 UNREACHABLE(); | 1239 UNREACHABLE(); |
1240 } | 1240 } |
1241 return Load(type, data_pointer, offset); | 1241 return Load(type, data_pointer, offset); |
1242 } | 1242 } |
1243 | 1243 |
| 1244 Node* CodeStubAssembler::LoadFixedTypedArrayElementAsTagged( |
| 1245 Node* data_pointer, Node* index_node, ElementsKind elements_kind, |
| 1246 ParameterMode parameter_mode) { |
| 1247 Node* value = LoadFixedTypedArrayElement(data_pointer, index_node, |
| 1248 elements_kind, parameter_mode); |
| 1249 switch (elements_kind) { |
| 1250 case ElementsKind::INT8_ELEMENTS: |
| 1251 case ElementsKind::UINT8_CLAMPED_ELEMENTS: |
| 1252 case ElementsKind::UINT8_ELEMENTS: |
| 1253 case ElementsKind::INT16_ELEMENTS: |
| 1254 case ElementsKind::UINT16_ELEMENTS: |
| 1255 return SmiFromWord32(value); |
| 1256 case ElementsKind::INT32_ELEMENTS: |
| 1257 return ChangeInt32ToTagged(value); |
| 1258 case ElementsKind::UINT32_ELEMENTS: |
| 1259 return ChangeUint32ToTagged(value); |
| 1260 case ElementsKind::FLOAT32_ELEMENTS: |
| 1261 return AllocateHeapNumberWithValue(ChangeFloat32ToFloat64(value)); |
| 1262 case ElementsKind::FLOAT64_ELEMENTS: |
| 1263 return AllocateHeapNumberWithValue(value); |
| 1264 default: |
| 1265 UNREACHABLE(); |
| 1266 return nullptr; |
| 1267 } |
| 1268 } |
| 1269 |
1244 Node* CodeStubAssembler::LoadAndUntagToWord32FixedArrayElement( | 1270 Node* CodeStubAssembler::LoadAndUntagToWord32FixedArrayElement( |
1245 Node* object, Node* index_node, int additional_offset, | 1271 Node* object, Node* index_node, int additional_offset, |
1246 ParameterMode parameter_mode) { | 1272 ParameterMode parameter_mode) { |
1247 int32_t header_size = | 1273 int32_t header_size = |
1248 FixedArray::kHeaderSize + additional_offset - kHeapObjectTag; | 1274 FixedArray::kHeaderSize + additional_offset - kHeapObjectTag; |
1249 #if V8_TARGET_LITTLE_ENDIAN | 1275 #if V8_TARGET_LITTLE_ENDIAN |
1250 if (Is64()) { | 1276 if (Is64()) { |
1251 header_size += kPointerSize / 2; | 1277 header_size += kPointerSize / 2; |
1252 } | 1278 } |
1253 #endif | 1279 #endif |
(...skipping 7138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8392 formatted.c_str(), TENURED); | 8418 formatted.c_str(), TENURED); |
8393 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8419 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
8394 HeapConstant(string)); | 8420 HeapConstant(string)); |
8395 } | 8421 } |
8396 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8422 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
8397 #endif | 8423 #endif |
8398 } | 8424 } |
8399 | 8425 |
8400 } // namespace internal | 8426 } // namespace internal |
8401 } // namespace v8 | 8427 } // namespace v8 |
OLD | NEW |