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: With all ports done 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
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 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 inline bool HasExternalShortElements(); 1710 inline bool HasExternalShortElements();
1711 inline bool HasExternalUnsignedShortElements(); 1711 inline bool HasExternalUnsignedShortElements();
1712 inline bool HasExternalIntElements(); 1712 inline bool HasExternalIntElements();
1713 inline bool HasExternalUnsignedIntElements(); 1713 inline bool HasExternalUnsignedIntElements();
1714 inline bool HasExternalFloatElements(); 1714 inline bool HasExternalFloatElements();
1715 inline bool HasExternalDoubleElements(); 1715 inline bool HasExternalDoubleElements();
1716 bool HasFastArgumentsElements(); 1716 bool HasFastArgumentsElements();
1717 bool HasDictionaryArgumentsElements(); 1717 bool HasDictionaryArgumentsElements();
1718 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. 1718 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements.
1719 1719
1720 inline bool ShouldTrackAllocationInfo();
1721
1720 inline void set_map_and_elements( 1722 inline void set_map_and_elements(
1721 Map* map, 1723 Map* map,
1722 FixedArrayBase* value, 1724 FixedArrayBase* value,
1723 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 1725 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
1724 1726
1725 // Requires: HasFastElements(). 1727 // Requires: HasFastElements().
1726 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); 1728 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements();
1727 1729
1728 // Collects elements starting at index 0. 1730 // Collects elements starting at index 0.
1729 // Undefined values are placed after non-undefined values. 1731 // Undefined values are placed after non-undefined values.
(...skipping 5491 matching lines...) Expand 10 before | Expand all | Expand 10 after
7221 public: 7223 public:
7222 DECL_ACCESSORS(payload, Object) 7224 DECL_ACCESSORS(payload, Object)
7223 7225
7224 static inline AllocationSiteInfo* cast(Object* obj); 7226 static inline AllocationSiteInfo* cast(Object* obj);
7225 7227
7226 DECLARE_PRINTER(AllocationSiteInfo) 7228 DECLARE_PRINTER(AllocationSiteInfo)
7227 DECLARE_VERIFIER(AllocationSiteInfo) 7229 DECLARE_VERIFIER(AllocationSiteInfo)
7228 7230
7229 // Returns NULL if no AllocationSiteInfo is available for object. 7231 // Returns NULL if no AllocationSiteInfo is available for object.
7230 static AllocationSiteInfo* FindForJSObject(JSObject* object); 7232 static AllocationSiteInfo* FindForJSObject(JSObject* object);
7231 7233 static inline AllocationSiteMode GetMode(
7232 static AllocationSiteMode GetMode(ElementsKind boilerplate_elements_kind); 7234 ElementsKind boilerplate_elements_kind);
7233 static AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); 7235 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to);
7234 7236
7235 static const int kPayloadOffset = HeapObject::kHeaderSize; 7237 static const int kPayloadOffset = HeapObject::kHeaderSize;
7236 static const int kSize = kPayloadOffset + kPointerSize; 7238 static const int kSize = kPayloadOffset + kPointerSize;
7237 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; 7239 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
7238 7240
7239 bool GetElementsKindPayload(ElementsKind* kind); 7241 bool GetElementsKindPayload(ElementsKind* kind);
7240 private: 7242 private:
7241 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); 7243 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo);
7242 }; 7244 };
7243 7245
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
8643 8645
8644 private: 8646 private:
8645 // Expand the fixed array backing of a fast-case JSArray to at least 8647 // Expand the fixed array backing of a fast-case JSArray to at least
8646 // the requested size. 8648 // the requested size.
8647 void Expand(int minimum_size_of_backing_fixed_array); 8649 void Expand(int minimum_size_of_backing_fixed_array);
8648 8650
8649 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); 8651 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray);
8650 }; 8652 };
8651 8653
8652 8654
8655 MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
8656 Context* native_context, Map* initial_map);
8657
8658
8653 // JSRegExpResult is just a JSArray with a specific initial map. 8659 // JSRegExpResult is just a JSArray with a specific initial map.
8654 // This initial map adds in-object properties for "index" and "input" 8660 // This initial map adds in-object properties for "index" and "input"
8655 // properties, as assigned by RegExp.prototype.exec, which allows 8661 // properties, as assigned by RegExp.prototype.exec, which allows
8656 // faster creation of RegExp exec results. 8662 // faster creation of RegExp exec results.
8657 // This class just holds constants used when creating the result. 8663 // This class just holds constants used when creating the result.
8658 // After creation the result must be treated as a JSArray in all regards. 8664 // After creation the result must be treated as a JSArray in all regards.
8659 class JSRegExpResult: public JSArray { 8665 class JSRegExpResult: public JSArray {
8660 public: 8666 public:
8661 // Offsets of object fields. 8667 // Offsets of object fields.
8662 static const int kIndexOffset = JSArray::kSize; 8668 static const int kIndexOffset = JSArray::kSize;
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
9356 } else { 9362 } else {
9357 value &= ~(1 << bit_position); 9363 value &= ~(1 << bit_position);
9358 } 9364 }
9359 return value; 9365 return value;
9360 } 9366 }
9361 }; 9367 };
9362 9368
9363 } } // namespace v8::internal 9369 } } // namespace v8::internal
9364 9370
9365 #endif // V8_OBJECTS_H_ 9371 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698