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

Unified Diff: src/objects.h

Issue 711313002: Reland "In-object double fields unboxing (for 64-bit only)." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The fix Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/layout-descriptor-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index d025b2482339da3cef73acefe2b4d2507be05a5e..aba2cc923f5b82fa2cb00bb56c580d66a9c3ff56 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -858,8 +858,9 @@ class DictionaryElementsAccessor;
class ElementsAccessor;
class FixedArrayBase;
class GlobalObject;
-class ObjectVisitor;
+class LayoutDescriptor;
class LookupIterator;
+class ObjectVisitor;
class StringStream;
class TypeFeedbackVector;
class WeakCell;
@@ -934,6 +935,7 @@ template <class C> inline bool Is(Object* obj);
V(JSContextExtensionObject) \
V(JSGeneratorObject) \
V(JSModule) \
+ V(LayoutDescriptor) \
V(Map) \
V(DescriptorArray) \
V(TransitionArray) \
@@ -2063,12 +2065,18 @@ class JSObject: public JSReceiver {
static void MigrateSlowToFast(Handle<JSObject> object,
int unused_property_fields, const char* reason);
+ inline bool IsUnboxedDoubleField(FieldIndex index);
+
// Access fast-case object properties at index.
static Handle<Object> FastPropertyAt(Handle<JSObject> object,
Representation representation,
FieldIndex index);
inline Object* RawFastPropertyAt(FieldIndex index);
+ inline double RawFastDoublePropertyAt(FieldIndex index);
+
inline void FastPropertyAtPut(FieldIndex index, Object* value);
+ inline void RawFastPropertyAtPut(FieldIndex index, Object* value);
+ inline void RawFastDoublePropertyAtPut(FieldIndex index, double value);
void WriteToField(int descriptor, Object* value);
// Access to in object properties.
@@ -3132,9 +3140,7 @@ class DescriptorArray: public FixedArray {
// Transfer a complete descriptor from the src descriptor array to this
// descriptor array.
- void CopyFrom(int index,
- DescriptorArray* src,
- const WhitenessWitness&);
+ void CopyFrom(int index, DescriptorArray* src, const WhitenessWitness&);
inline void Set(int descriptor_number,
Descriptor* desc,
@@ -4776,6 +4782,7 @@ TYPED_ARRAYS(FIXED_TYPED_ARRAY_TRAITS)
#undef FIXED_TYPED_ARRAY_TRAITS
+
// DeoptimizationInputData is a fixed array used to hold the deoptimization
// data for code generated by the Hydrogen/Lithium compiler. It also
// contains information about functions that were inlined. If N different
@@ -5873,7 +5880,21 @@ class Map: public HeapObject {
// [instance descriptors]: describes the object.
DECL_ACCESSORS(instance_descriptors, DescriptorArray)
- inline void InitializeDescriptors(DescriptorArray* descriptors);
+
+ // [layout descriptor]: describes the object layout.
+ DECL_ACCESSORS(layout_descriptor, LayoutDescriptor)
+ // |layout descriptor| accessor which can be used from GC.
+ inline LayoutDescriptor* layout_descriptor_gc_safe();
+
+ // |layout descriptor| accessor that is safe to call even when
+ // FLAG_unbox_double_fields is disabled (in this case Map does not contain
+ // |layout_descriptor| field at all).
+ inline LayoutDescriptor* GetLayoutDescriptor();
+
+ inline void UpdateDescriptors(DescriptorArray* descriptors,
+ LayoutDescriptor* layout_descriptor);
+ inline void InitializeDescriptors(DescriptorArray* descriptors,
+ LayoutDescriptor* layout_descriptor);
// [stub cache]: contains stubs compiled for this map.
DECL_ACCESSORS(code_cache, Object)
@@ -6203,7 +6224,13 @@ class Map: public HeapObject {
kConstructorOffset + kPointerSize;
static const int kDescriptorsOffset =
kTransitionsOrBackPointerOffset + kPointerSize;
+#if V8_DOUBLE_FIELDS_UNBOXING
+ static const int kLayoutDecriptorOffset = kDescriptorsOffset + kPointerSize;
+ static const int kCodeCacheOffset = kLayoutDecriptorOffset + kPointerSize;
+#else
+ static const int kLayoutDecriptorOffset = 1; // Must not be ever accessed.
static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize;
+#endif
static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize;
static const int kSize = kDependentCodeOffset + kPointerSize;
@@ -6281,11 +6308,18 @@ class Map: public HeapObject {
// The "shared" flags of both this map and |other| are ignored.
bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode);
+ // Returns true if given field is unboxed double.
+ inline bool IsUnboxedDoubleField(FieldIndex index);
+
#if TRACE_MAPS
static void TraceTransition(const char* what, Map* from, Map* to, Name* name);
static void TraceAllTransitions(Map* map);
#endif
+ static inline Handle<Map> CopyInstallDescriptorsForTesting(
+ Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors,
+ Handle<LayoutDescriptor> layout_descriptor);
+
private:
static void ConnectElementsTransition(Handle<Map> parent, Handle<Map> child);
static void ConnectTransition(Handle<Map> parent, Handle<Map> child,
@@ -6297,18 +6331,17 @@ class Map: public HeapObject {
Handle<DescriptorArray> descriptors,
Descriptor* descriptor);
static Handle<Map> CopyInstallDescriptors(
- Handle<Map> map,
- int new_descriptor,
- Handle<DescriptorArray> descriptors);
+ Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors,
+ Handle<LayoutDescriptor> layout_descriptor);
static Handle<Map> CopyAddDescriptor(Handle<Map> map,
Descriptor* descriptor,
TransitionFlag flag);
- static Handle<Map> CopyReplaceDescriptors(Handle<Map> map,
- Handle<DescriptorArray> descriptors,
- TransitionFlag flag,
- MaybeHandle<Name> maybe_name,
- const char* reason,
- SimpleTransitionFlag simple_flag);
+ static Handle<Map> CopyReplaceDescriptors(
+ Handle<Map> map, Handle<DescriptorArray> descriptors,
+ Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag,
+ MaybeHandle<Name> maybe_name, const char* reason,
+ SimpleTransitionFlag simple_flag);
+
static Handle<Map> CopyReplaceDescriptor(Handle<Map> map,
Handle<DescriptorArray> descriptors,
Descriptor* descriptor,
@@ -6338,7 +6371,8 @@ class Map: public HeapObject {
void DeprecateTransitionTree();
void DeprecateTarget(PropertyType type, Name* key,
PropertyAttributes attributes,
- DescriptorArray* new_descriptors);
+ DescriptorArray* new_descriptors,
+ LayoutDescriptor* new_layout_descriptor);
Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors);
« no previous file with comments | « src/layout-descriptor-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698