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

Side by Side Diff: src/objects.h

Issue 12385014: Hydrogen stubs for array constructors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: We still generated the arrays with feature flag off. Fixed. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 inline bool HasExternalShortElements(); 1731 inline bool HasExternalShortElements();
1732 inline bool HasExternalUnsignedShortElements(); 1732 inline bool HasExternalUnsignedShortElements();
1733 inline bool HasExternalIntElements(); 1733 inline bool HasExternalIntElements();
1734 inline bool HasExternalUnsignedIntElements(); 1734 inline bool HasExternalUnsignedIntElements();
1735 inline bool HasExternalFloatElements(); 1735 inline bool HasExternalFloatElements();
1736 inline bool HasExternalDoubleElements(); 1736 inline bool HasExternalDoubleElements();
1737 bool HasFastArgumentsElements(); 1737 bool HasFastArgumentsElements();
1738 bool HasDictionaryArgumentsElements(); 1738 bool HasDictionaryArgumentsElements();
1739 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. 1739 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements.
1740 1740
1741 inline bool ShouldTrackAllocationInfo();
1742
1741 inline void set_map_and_elements( 1743 inline void set_map_and_elements(
1742 Map* map, 1744 Map* map,
1743 FixedArrayBase* value, 1745 FixedArrayBase* value,
1744 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 1746 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
1745 1747
1746 // Requires: HasFastElements(). 1748 // Requires: HasFastElements().
1747 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); 1749 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements();
1748 1750
1749 // Collects elements starting at index 0. 1751 // Collects elements starting at index 0.
1750 // Undefined values are placed after non-undefined values. 1752 // Undefined values are placed after non-undefined values.
(...skipping 5512 matching lines...) Expand 10 before | Expand all | Expand 10 after
7263 public: 7265 public:
7264 DECL_ACCESSORS(payload, Object) 7266 DECL_ACCESSORS(payload, Object)
7265 7267
7266 static inline AllocationSiteInfo* cast(Object* obj); 7268 static inline AllocationSiteInfo* cast(Object* obj);
7267 7269
7268 DECLARE_PRINTER(AllocationSiteInfo) 7270 DECLARE_PRINTER(AllocationSiteInfo)
7269 DECLARE_VERIFIER(AllocationSiteInfo) 7271 DECLARE_VERIFIER(AllocationSiteInfo)
7270 7272
7271 // Returns NULL if no AllocationSiteInfo is available for object. 7273 // Returns NULL if no AllocationSiteInfo is available for object.
7272 static AllocationSiteInfo* FindForJSObject(JSObject* object); 7274 static AllocationSiteInfo* FindForJSObject(JSObject* object);
7273 7275 static inline AllocationSiteMode GetMode(
7274 static AllocationSiteMode GetMode(ElementsKind boilerplate_elements_kind); 7276 ElementsKind boilerplate_elements_kind);
7275 static AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); 7277 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to);
7276 7278
7277 static const int kPayloadOffset = HeapObject::kHeaderSize; 7279 static const int kPayloadOffset = HeapObject::kHeaderSize;
7278 static const int kSize = kPayloadOffset + kPointerSize; 7280 static const int kSize = kPayloadOffset + kPointerSize;
7279 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; 7281 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
7280 7282
7281 bool GetElementsKindPayload(ElementsKind* kind); 7283 bool GetElementsKindPayload(ElementsKind* kind);
7282 private: 7284 private:
7283 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); 7285 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo);
7284 }; 7286 };
7285 7287
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
8717 8719
8718 private: 8720 private:
8719 // Expand the fixed array backing of a fast-case JSArray to at least 8721 // Expand the fixed array backing of a fast-case JSArray to at least
8720 // the requested size. 8722 // the requested size.
8721 void Expand(int minimum_size_of_backing_fixed_array); 8723 void Expand(int minimum_size_of_backing_fixed_array);
8722 8724
8723 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); 8725 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray);
8724 }; 8726 };
8725 8727
8726 8728
8729 MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
8730 Context* native_context, Map* initial_map);
8731
8732
8727 // JSRegExpResult is just a JSArray with a specific initial map. 8733 // JSRegExpResult is just a JSArray with a specific initial map.
8728 // This initial map adds in-object properties for "index" and "input" 8734 // This initial map adds in-object properties for "index" and "input"
8729 // properties, as assigned by RegExp.prototype.exec, which allows 8735 // properties, as assigned by RegExp.prototype.exec, which allows
8730 // faster creation of RegExp exec results. 8736 // faster creation of RegExp exec results.
8731 // This class just holds constants used when creating the result. 8737 // This class just holds constants used when creating the result.
8732 // After creation the result must be treated as a JSArray in all regards. 8738 // After creation the result must be treated as a JSArray in all regards.
8733 class JSRegExpResult: public JSArray { 8739 class JSRegExpResult: public JSArray {
8734 public: 8740 public:
8735 // Offsets of object fields. 8741 // Offsets of object fields.
8736 static const int kIndexOffset = JSArray::kSize; 8742 static const int kIndexOffset = JSArray::kSize;
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
9430 } else { 9436 } else {
9431 value &= ~(1 << bit_position); 9437 value &= ~(1 << bit_position);
9432 } 9438 }
9433 return value; 9439 return value;
9434 } 9440 }
9435 }; 9441 };
9436 9442
9437 } } // namespace v8::internal 9443 } } // namespace v8::internal
9438 9444
9439 #endif // V8_OBJECTS_H_ 9445 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698