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

Side by Side Diff: src/objects.h

Issue 2484003002: [builtins] implement JSBuiltinReducer for ArrayIteratorNext() (Closed)
Patch Set: add (some) test coverage, and fix some bugs found by it 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 7259 matching lines...) Expand 10 before | Expand all | Expand 10 after
7270 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \ 7270 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \
7271 k##name, 7271 k##name,
7272 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) 7272 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID)
7273 ATOMIC_FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) 7273 ATOMIC_FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID)
7274 #undef DECLARE_FUNCTION_ID 7274 #undef DECLARE_FUNCTION_ID
7275 // Fake id for a special case of Math.pow. Note, it continues the 7275 // Fake id for a special case of Math.pow. Note, it continues the
7276 // list of math functions. 7276 // list of math functions.
7277 kMathPowHalf, 7277 kMathPowHalf,
7278 // These are manually assigned to special getters during bootstrapping. 7278 // These are manually assigned to special getters during bootstrapping.
7279 kArrayBufferByteLength, 7279 kArrayBufferByteLength,
7280 kArrayEntries,
7281 kArrayKeys,
7282 kArrayValues,
7283 kArrayIteratorNext,
7280 kDataViewBuffer, 7284 kDataViewBuffer,
7281 kDataViewByteLength, 7285 kDataViewByteLength,
7282 kDataViewByteOffset, 7286 kDataViewByteOffset,
7283 kGlobalDecodeURI, 7287 kGlobalDecodeURI,
7284 kGlobalDecodeURIComponent, 7288 kGlobalDecodeURIComponent,
7285 kGlobalEncodeURI, 7289 kGlobalEncodeURI,
7286 kGlobalEncodeURIComponent, 7290 kGlobalEncodeURIComponent,
7287 kGlobalEscape, 7291 kGlobalEscape,
7288 kGlobalUnescape, 7292 kGlobalUnescape,
7289 kGlobalIsFinite, 7293 kGlobalIsFinite,
7290 kGlobalIsNaN, 7294 kGlobalIsNaN,
7291 kTypedArrayByteLength, 7295 kTypedArrayByteLength,
7292 kTypedArrayByteOffset, 7296 kTypedArrayByteOffset,
7297 kTypedArrayEntries,
7298 kTypedArrayKeys,
7293 kTypedArrayLength, 7299 kTypedArrayLength,
7300 kTypedArrayValues,
7294 kSharedArrayBufferByteLength, 7301 kSharedArrayBufferByteLength,
7295 kStringIterator, 7302 kStringIterator,
7296 kStringIteratorNext, 7303 kStringIteratorNext,
7297 }; 7304 };
7298 7305
7299 7306
7300 // Result of searching in an optimized code map of a SharedFunctionInfo. Note 7307 // Result of searching in an optimized code map of a SharedFunctionInfo. Note
7301 // that both {code} and {literals} can be NULL to pass search result status. 7308 // that both {code} and {literals} can be NULL to pass search result status.
7302 struct CodeAndLiterals { 7309 struct CodeAndLiterals {
7303 Code* code; // Cached optimized code. 7310 Code* code; // Cached optimized code.
(...skipping 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after
10700 // [object]: the [[IteratedObject]] internal field. 10707 // [object]: the [[IteratedObject]] internal field.
10701 DECL_ACCESSORS(object, Object) 10708 DECL_ACCESSORS(object, Object)
10702 10709
10703 // [index]: The [[ArrayIteratorNextIndex]] internal field. 10710 // [index]: The [[ArrayIteratorNextIndex]] internal field.
10704 DECL_ACCESSORS(index, Object) 10711 DECL_ACCESSORS(index, Object)
10705 10712
10706 // [map]: The Map of the [[IteratedObject]] field at the time the iterator is 10713 // [map]: The Map of the [[IteratedObject]] field at the time the iterator is
10707 // allocated. 10714 // allocated.
10708 DECL_ACCESSORS(object_map, Object) 10715 DECL_ACCESSORS(object_map, Object)
10709 10716
10717 // Return the ElementsKind that a JSArrayIterator's [[IteratedObject]] is
10718 // expected to have, based on its instance type.
10719 static ElementsKind ElementsKindForInstanceType(InstanceType instance_type);
10720
10710 static const int kIteratedObjectOffset = JSObject::kHeaderSize; 10721 static const int kIteratedObjectOffset = JSObject::kHeaderSize;
10711 static const int kNextIndexOffset = kIteratedObjectOffset + kPointerSize; 10722 static const int kNextIndexOffset = kIteratedObjectOffset + kPointerSize;
10712 static const int kIteratedObjectMapOffset = kNextIndexOffset + kPointerSize; 10723 static const int kIteratedObjectMapOffset = kNextIndexOffset + kPointerSize;
10713 static const int kSize = kIteratedObjectMapOffset + kPointerSize; 10724 static const int kSize = kIteratedObjectMapOffset + kPointerSize;
10714 10725
10715 private: 10726 private:
10716 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayIterator); 10727 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayIterator);
10717 }; 10728 };
10718 10729
10719 class JSStringIterator : public JSObject { 10730 class JSStringIterator : public JSObject {
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
11821 } 11832 }
11822 return value; 11833 return value;
11823 } 11834 }
11824 }; 11835 };
11825 11836
11826 11837
11827 } // NOLINT, false-positive due to second-order macros. 11838 } // NOLINT, false-positive due to second-order macros.
11828 } // NOLINT, false-positive due to second-order macros. 11839 } // NOLINT, false-positive due to second-order macros.
11829 11840
11830 #endif // V8_OBJECTS_H_ 11841 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/isolate-inl.h ('k') | src/objects.cc » ('j') | test/mjsunit/es6/array-iterator-turbo.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698