Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: src/code-stub-assembler.cc

Issue 2775203002: [builtins] Implement %TypedArray%.prototype.{some,every} in the CSA (Closed)
Patch Set: addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stub-assembler.h ('k') | test/mjsunit/es6/typedarray-every.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index d06e0a2313aa3279630ecec75aef04f6d7d2099a..1c1810e818b5fff06c424564869da94b61dcd99a 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -1241,6 +1241,32 @@ Node* CodeStubAssembler::LoadFixedTypedArrayElement(
return Load(type, data_pointer, offset);
}
+Node* CodeStubAssembler::LoadFixedTypedArrayElementAsTagged(
+ Node* data_pointer, Node* index_node, ElementsKind elements_kind,
+ ParameterMode parameter_mode) {
+ Node* value = LoadFixedTypedArrayElement(data_pointer, index_node,
+ elements_kind, parameter_mode);
+ switch (elements_kind) {
+ case ElementsKind::INT8_ELEMENTS:
+ case ElementsKind::UINT8_CLAMPED_ELEMENTS:
+ case ElementsKind::UINT8_ELEMENTS:
+ case ElementsKind::INT16_ELEMENTS:
+ case ElementsKind::UINT16_ELEMENTS:
+ return SmiFromWord32(value);
+ case ElementsKind::INT32_ELEMENTS:
+ return ChangeInt32ToTagged(value);
+ case ElementsKind::UINT32_ELEMENTS:
+ return ChangeUint32ToTagged(value);
+ case ElementsKind::FLOAT32_ELEMENTS:
+ return AllocateHeapNumberWithValue(ChangeFloat32ToFloat64(value));
+ case ElementsKind::FLOAT64_ELEMENTS:
+ return AllocateHeapNumberWithValue(value);
+ default:
+ UNREACHABLE();
+ return nullptr;
+ }
+}
+
Node* CodeStubAssembler::LoadAndUntagToWord32FixedArrayElement(
Node* object, Node* index_node, int additional_offset,
ParameterMode parameter_mode) {
« no previous file with comments | « src/code-stub-assembler.h ('k') | test/mjsunit/es6/typedarray-every.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698