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

Unified Diff: src/objects.h

Issue 1198343004: Merge AddFastElement and AddFastDoubleElement (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/lookup-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 29e913328d33544d7743d57330c5df7e696276d9..083bce8b54aac80d26aade82102e255cf61ea6a1 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1114,6 +1114,12 @@ class Object {
}
}
+ inline ElementsKind OptimalElementsKind() {
+ if (IsSmi()) return FAST_SMI_ELEMENTS;
+ if (IsNumber()) return FAST_DOUBLE_ELEMENTS;
+ return FAST_ELEMENTS;
+ }
+
inline bool FitsRepresentation(Representation representation) {
if (FLAG_track_fields && representation.IsNone()) {
return false;
@@ -1777,7 +1783,7 @@ class JSObject: public JSReceiver {
Handle<Map> map,
Handle<FixedArrayBase> elements);
inline ElementsKind GetElementsKind();
- inline ElementsAccessor* GetElementsAccessor();
+ ElementsAccessor* GetElementsAccessor();
// Returns true if an object has elements of FAST_SMI_ELEMENTS ElementsKind.
inline bool HasFastSmiElements();
// Returns true if an object has elements of FAST_ELEMENTS ElementsKind.
@@ -1900,9 +1906,6 @@ class JSObject: public JSReceiver {
static void AddDictionaryElement(Handle<JSObject> object, uint32_t index,
Handle<Object> value,
PropertyAttributes attributes);
- static void AddSloppyArgumentsElement(Handle<JSObject> object, uint32_t index,
- Handle<Object> value,
- PropertyAttributes attributes);
static void SetDictionaryElement(Handle<JSObject> object, uint32_t index,
Handle<Object> value,
PropertyAttributes attributes);
@@ -1911,11 +1914,6 @@ class JSObject: public JSReceiver {
Handle<Object> value,
PropertyAttributes attributes);
- static void AddFastElement(Handle<JSObject> object, uint32_t index,
- Handle<Object> value);
- static void AddFastDoubleElement(Handle<JSObject> object, uint32_t index,
- Handle<Object> value);
-
static void OptimizeAsPrototype(Handle<JSObject> object,
PrototypeOptimizationMode mode);
static void ReoptimizeIfPrototype(Handle<JSObject> object);
@@ -1990,7 +1988,7 @@ class JSObject: public JSReceiver {
static void SetIdentityHash(Handle<JSObject> object, Handle<Smi> hash);
- static inline void ValidateElements(Handle<JSObject> object);
+ static void ValidateElements(Handle<JSObject> object);
// Makes sure that this object can contain HeapObject as elements.
static inline void EnsureCanContainHeapObjectElements(Handle<JSObject> obj);
« no previous file with comments | « src/lookup-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698