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

Side by Side Diff: src/objects.h

Issue 23578030: Reland Handle non-JSObject heap objects using slow-path IC stub guarded by the map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 3 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/ic.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 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 // Useful when the map pointer field is used for other purposes. 1749 // Useful when the map pointer field is used for other purposes.
1750 // GC internal. 1750 // GC internal.
1751 inline int SizeFromMap(Map* map); 1751 inline int SizeFromMap(Map* map);
1752 1752
1753 // Returns the field at offset in obj, as a read/write Object* reference. 1753 // Returns the field at offset in obj, as a read/write Object* reference.
1754 // Does no checking, and is safe to use during GC, while maps are invalid. 1754 // Does no checking, and is safe to use during GC, while maps are invalid.
1755 // Does not invoke write barrier, so should only be assigned to 1755 // Does not invoke write barrier, so should only be assigned to
1756 // during marking GC. 1756 // during marking GC.
1757 static inline Object** RawField(HeapObject* obj, int offset); 1757 static inline Object** RawField(HeapObject* obj, int offset);
1758 1758
1759 // Adds the |code| object related to |name| to the code cache of this map. If
1760 // this map is a dictionary map that is shared, the map copied and installed
1761 // onto the object.
1762 static void UpdateMapCodeCache(Handle<HeapObject> object,
1763 Handle<Name> name,
1764 Handle<Code> code);
1765
1759 // Casting. 1766 // Casting.
1760 static inline HeapObject* cast(Object* obj); 1767 static inline HeapObject* cast(Object* obj);
1761 1768
1762 // Return the write barrier mode for this. Callers of this function 1769 // Return the write barrier mode for this. Callers of this function
1763 // must be able to present a reference to an DisallowHeapAllocation 1770 // must be able to present a reference to an DisallowHeapAllocation
1764 // object as a sign that they are not going to use this function 1771 // object as a sign that they are not going to use this function
1765 // from code that allocates and thus invalidates the returned write 1772 // from code that allocates and thus invalidates the returned write
1766 // barrier mode. 1773 // barrier mode.
1767 inline WriteBarrierMode GetWriteBarrierMode( 1774 inline WriteBarrierMode GetWriteBarrierMode(
1768 const DisallowHeapAllocation& promise); 1775 const DisallowHeapAllocation& promise);
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 PropertyNormalizationMode mode, 2567 PropertyNormalizationMode mode,
2561 int expected_additional_properties); 2568 int expected_additional_properties);
2562 2569
2563 // Convert and update the elements backing store to be a 2570 // Convert and update the elements backing store to be a
2564 // SeededNumberDictionary dictionary. Returns the backing after conversion. 2571 // SeededNumberDictionary dictionary. Returns the backing after conversion.
2565 static Handle<SeededNumberDictionary> NormalizeElements( 2572 static Handle<SeededNumberDictionary> NormalizeElements(
2566 Handle<JSObject> object); 2573 Handle<JSObject> object);
2567 2574
2568 MUST_USE_RESULT MaybeObject* NormalizeElements(); 2575 MUST_USE_RESULT MaybeObject* NormalizeElements();
2569 2576
2570 static void UpdateMapCodeCache(Handle<JSObject> object,
2571 Handle<Name> name,
2572 Handle<Code> code);
2573
2574 // Transform slow named properties to fast variants. 2577 // Transform slow named properties to fast variants.
2575 // Returns failure if allocation failed. 2578 // Returns failure if allocation failed.
2576 static void TransformToFastProperties(Handle<JSObject> object, 2579 static void TransformToFastProperties(Handle<JSObject> object,
2577 int unused_property_fields); 2580 int unused_property_fields);
2578 2581
2579 MUST_USE_RESULT MaybeObject* TransformToFastProperties( 2582 MUST_USE_RESULT MaybeObject* TransformToFastProperties(
2580 int unused_property_fields); 2583 int unused_property_fields);
2581 2584
2582 // Access fast-case object properties at index. 2585 // Access fast-case object properties at index.
2583 MUST_USE_RESULT inline MaybeObject* FastPropertyAt( 2586 MUST_USE_RESULT inline MaybeObject* FastPropertyAt(
(...skipping 3330 matching lines...) Expand 10 before | Expand all | Expand 10 after
5914 // heap verification is turned on. 5917 // heap verification is turned on.
5915 void ZapPrototypeTransitions(); 5918 void ZapPrototypeTransitions();
5916 void ZapTransitions(); 5919 void ZapTransitions();
5917 5920
5918 bool CanTransition() { 5921 bool CanTransition() {
5919 // Only JSObject and subtypes have map transitions and back pointers. 5922 // Only JSObject and subtypes have map transitions and back pointers.
5920 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); 5923 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE);
5921 return instance_type() >= FIRST_JS_OBJECT_TYPE; 5924 return instance_type() >= FIRST_JS_OBJECT_TYPE;
5922 } 5925 }
5923 5926
5927 bool IsJSObjectMap() {
5928 return instance_type() >= FIRST_JS_OBJECT_TYPE;
5929 }
5930
5924 // Fires when the layout of an object with a leaf map changes. 5931 // Fires when the layout of an object with a leaf map changes.
5925 // This includes adding transitions to the leaf map or changing 5932 // This includes adding transitions to the leaf map or changing
5926 // the descriptor array. 5933 // the descriptor array.
5927 inline void NotifyLeafMapLayoutChange(); 5934 inline void NotifyLeafMapLayoutChange();
5928 5935
5929 inline bool CanOmitMapChecks(); 5936 inline bool CanOmitMapChecks();
5930 5937
5931 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, 5938 void AddDependentCompilationInfo(DependentCode::DependencyGroup group,
5932 CompilationInfo* info); 5939 CompilationInfo* info);
5933 5940
(...skipping 4300 matching lines...) Expand 10 before | Expand all | Expand 10 after
10234 } else { 10241 } else {
10235 value &= ~(1 << bit_position); 10242 value &= ~(1 << bit_position);
10236 } 10243 }
10237 return value; 10244 return value;
10238 } 10245 }
10239 }; 10246 };
10240 10247
10241 } } // namespace v8::internal 10248 } } // namespace v8::internal
10242 10249
10243 #endif // V8_OBJECTS_H_ 10250 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698