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

Unified Diff: src/compiler/access-builder.cc

Issue 2484003002: [builtins] implement JSBuiltinReducer for ArrayIteratorNext() (Closed)
Patch Set: fix tests when ignition is used Created 4 years, 1 month 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/compiler/access-builder.h ('k') | src/compiler/js-builtin-reducer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/access-builder.cc
diff --git a/src/compiler/access-builder.cc b/src/compiler/access-builder.cc
index 982043bac234cbc7f83a81419d3f7cb1903ec8f1..540eb375b733f21540adc710f273d2c46d3741e3 100644
--- a/src/compiler/access-builder.cc
+++ b/src/compiler/access-builder.cc
@@ -571,6 +571,59 @@ FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() {
}
// static
+FieldAccess AccessBuilder::ForJSArrayIteratorObject() {
+ FieldAccess access = {kTaggedBase,
+ JSArrayIterator::kIteratedObjectOffset,
+ Handle<Name>(),
+ Type::ReceiverOrUndefined(),
+ MachineType::TaggedPointer(),
+ kPointerWriteBarrier};
+ return access;
+}
+
+// static
+FieldAccess AccessBuilder::ForJSArrayIteratorIndex(InstanceType instance_type,
+ ElementsKind elements_kind) {
+ // In generic case, cap to 2^53-1 (per ToLength() in spec) via
+ // kPositiveSafeInteger
+ FieldAccess access = {kTaggedBase,
+ JSArrayIterator::kNextIndexOffset,
+ Handle<Name>(),
+ TypeCache::Get().kPositiveSafeInteger,
+ MachineType::AnyTagged(),
+ kFullWriteBarrier};
+ if (instance_type == JS_ARRAY_TYPE) {
+ if (IsFastDoubleElementsKind(elements_kind)) {
+ access.type = TypeCache::Get().kFixedDoubleArrayLengthType;
+ access.machine_type = MachineType::TaggedSigned();
+ access.write_barrier_kind = kNoWriteBarrier;
+ } else if (IsFastElementsKind(elements_kind)) {
+ access.type = TypeCache::Get().kFixedArrayLengthType;
+ access.machine_type = MachineType::TaggedSigned();
+ access.write_barrier_kind = kNoWriteBarrier;
+ } else {
+ access.type = TypeCache::Get().kJSArrayLengthType;
+ }
+ } else if (instance_type == JS_TYPED_ARRAY_TYPE) {
+ access.type = TypeCache::Get().kJSTypedArrayLengthType;
+ access.machine_type = MachineType::TaggedSigned();
+ access.write_barrier_kind = kNoWriteBarrier;
+ }
+ return access;
+}
+
+// static
+FieldAccess AccessBuilder::ForJSArrayIteratorObjectMap() {
+ FieldAccess access = {kTaggedBase,
+ JSArrayIterator::kIteratedObjectMapOffset,
+ Handle<Name>(),
+ Type::OtherInternal(),
+ MachineType::TaggedPointer(),
+ kPointerWriteBarrier};
+ return access;
+}
+
+// static
FieldAccess AccessBuilder::ForJSStringIteratorString() {
FieldAccess access = {
kTaggedBase, JSStringIterator::kStringOffset, Handle<Name>(),
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/js-builtin-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698