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

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: More efficient code when number of arguments is known 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 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 inline bool HasExternalShortElements(); 1706 inline bool HasExternalShortElements();
1707 inline bool HasExternalUnsignedShortElements(); 1707 inline bool HasExternalUnsignedShortElements();
1708 inline bool HasExternalIntElements(); 1708 inline bool HasExternalIntElements();
1709 inline bool HasExternalUnsignedIntElements(); 1709 inline bool HasExternalUnsignedIntElements();
1710 inline bool HasExternalFloatElements(); 1710 inline bool HasExternalFloatElements();
1711 inline bool HasExternalDoubleElements(); 1711 inline bool HasExternalDoubleElements();
1712 bool HasFastArgumentsElements(); 1712 bool HasFastArgumentsElements();
1713 bool HasDictionaryArgumentsElements(); 1713 bool HasDictionaryArgumentsElements();
1714 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. 1714 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements.
1715 1715
1716 inline bool ShouldTrackAllocationInfo();
1717
1716 inline void set_map_and_elements( 1718 inline void set_map_and_elements(
1717 Map* map, 1719 Map* map,
1718 FixedArrayBase* value, 1720 FixedArrayBase* value,
1719 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 1721 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
1720 1722
1721 // Requires: HasFastElements(). 1723 // Requires: HasFastElements().
1722 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); 1724 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements();
1723 1725
1724 // Collects elements starting at index 0. 1726 // Collects elements starting at index 0.
1725 // Undefined values are placed after non-undefined values. 1727 // Undefined values are placed after non-undefined values.
(...skipping 5457 matching lines...) Expand 10 before | Expand all | Expand 10 after
7183 public: 7185 public:
7184 DECL_ACCESSORS(payload, Object) 7186 DECL_ACCESSORS(payload, Object)
7185 7187
7186 static inline AllocationSiteInfo* cast(Object* obj); 7188 static inline AllocationSiteInfo* cast(Object* obj);
7187 7189
7188 DECLARE_PRINTER(AllocationSiteInfo) 7190 DECLARE_PRINTER(AllocationSiteInfo)
7189 DECLARE_VERIFIER(AllocationSiteInfo) 7191 DECLARE_VERIFIER(AllocationSiteInfo)
7190 7192
7191 // Returns NULL if no AllocationSiteInfo is available for object. 7193 // Returns NULL if no AllocationSiteInfo is available for object.
7192 static AllocationSiteInfo* FindForJSObject(JSObject* object); 7194 static AllocationSiteInfo* FindForJSObject(JSObject* object);
7193 7195 static inline AllocationSiteMode GetMode(
7194 static AllocationSiteMode GetMode(ElementsKind boilerplate_elements_kind); 7196 ElementsKind boilerplate_elements_kind);
7195 static AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); 7197 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to);
7196 7198
7197 static const int kPayloadOffset = HeapObject::kHeaderSize; 7199 static const int kPayloadOffset = HeapObject::kHeaderSize;
7198 static const int kSize = kPayloadOffset + kPointerSize; 7200 static const int kSize = kPayloadOffset + kPointerSize;
7199 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; 7201 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
7200 7202
7201 bool GetElementsKindPayload(ElementsKind* kind); 7203 bool GetElementsKindPayload(ElementsKind* kind);
7202 private: 7204 private:
7203 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); 7205 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo);
7204 }; 7206 };
7205 7207
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
8605 8607
8606 private: 8608 private:
8607 // Expand the fixed array backing of a fast-case JSArray to at least 8609 // Expand the fixed array backing of a fast-case JSArray to at least
8608 // the requested size. 8610 // the requested size.
8609 void Expand(int minimum_size_of_backing_fixed_array); 8611 void Expand(int minimum_size_of_backing_fixed_array);
8610 8612
8611 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); 8613 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray);
8612 }; 8614 };
8613 8615
8614 8616
8617 MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps(
8618 Context* native_context, Map* initial_map);
8619
8620
8615 // JSRegExpResult is just a JSArray with a specific initial map. 8621 // JSRegExpResult is just a JSArray with a specific initial map.
8616 // This initial map adds in-object properties for "index" and "input" 8622 // This initial map adds in-object properties for "index" and "input"
8617 // properties, as assigned by RegExp.prototype.exec, which allows 8623 // properties, as assigned by RegExp.prototype.exec, which allows
8618 // faster creation of RegExp exec results. 8624 // faster creation of RegExp exec results.
8619 // This class just holds constants used when creating the result. 8625 // This class just holds constants used when creating the result.
8620 // After creation the result must be treated as a JSArray in all regards. 8626 // After creation the result must be treated as a JSArray in all regards.
8621 class JSRegExpResult: public JSArray { 8627 class JSRegExpResult: public JSArray {
8622 public: 8628 public:
8623 // Offsets of object fields. 8629 // Offsets of object fields.
8624 static const int kIndexOffset = JSArray::kSize; 8630 static const int kIndexOffset = JSArray::kSize;
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
9318 } else { 9324 } else {
9319 value &= ~(1 << bit_position); 9325 value &= ~(1 << bit_position);
9320 } 9326 }
9321 return value; 9327 return value;
9322 } 9328 }
9323 }; 9329 };
9324 9330
9325 } } // namespace v8::internal 9331 } } // namespace v8::internal
9326 9332
9327 #endif // V8_OBJECTS_H_ 9333 #endif // V8_OBJECTS_H_
OLDNEW
« src/ia32/code-stubs-ia32.cc ('K') | « src/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698