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

Unified Diff: src/objects.h

Issue 1427483002: [es6] Better support for built-ins subclassing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Test cleanup Created 5 years, 2 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/mips64/builtins-mips64.cc ('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 8466eed21f85ceb786e9549629dc806d9d383f82..f390b2ca5abd1ec199727cbdd5d39a48efb1dedb 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2264,8 +2264,10 @@ class JSObject: public JSReceiver {
// Get the header size for a JSObject. Used to compute the index of
// internal fields as well as the number of internal fields.
+ static inline int GetHeaderSize(InstanceType instance_type);
inline int GetHeaderSize();
+ static inline int GetInternalFieldCount(Map* map);
inline int GetInternalFieldCount();
inline int GetInternalFieldOffset(int index);
inline Object* GetInternalField(int index);
@@ -5806,6 +5808,10 @@ class Map: public HeapObject {
// gathering type feedback. Use TryUpdate in those cases instead.
static Handle<Map> Update(Handle<Map> map);
+ static inline Handle<Map> CopyInitialMap(Handle<Map> map);
+ static Handle<Map> CopyInitialMap(Handle<Map> map, int instance_size,
+ int in_object_properties,
+ int unused_property_fields);
static Handle<Map> CopyDropDescriptors(Handle<Map> map);
static Handle<Map> CopyInsertDescriptor(Handle<Map> map,
Descriptor* descriptor,
@@ -6837,12 +6843,6 @@ class SharedFunctionInfo: public HeapObject {
// Source size of this function.
int SourceSize();
- // Calculate the instance size.
- int CalculateInstanceSize();
-
- // Calculate the number of in-object properties.
- int CalculateInObjectProperties();
-
inline bool has_simple_parameters();
// Initialize a SharedFunctionInfo from a parsed function literal.
@@ -7336,6 +7336,11 @@ class JSFunction: public JSObject {
Handle<Object> prototype);
inline bool has_initial_map();
static void EnsureHasInitialMap(Handle<JSFunction> function);
+ // Ensures that the |original_constructor| has correct initial map and
+ // returns it. If the |original_constructor| is not a subclass constructor
+ // its initial map is left unmodified.
+ static Handle<Map> EnsureDerivedHasInitialMap(
+ Handle<JSFunction> original_constructor, Handle<JSFunction> constructor);
// Get and set the prototype property on a JSFunction. If the
// function has an initial map the prototype is set on the initial
@@ -7384,6 +7389,15 @@ class JSFunction: public JSObject {
DECLARE_CAST(JSFunction)
+ // Calculate the instance size and in-object properties count.
+ void CalculateInstanceSize(InstanceType instance_type,
+ int requested_internal_fields, int* instance_size,
+ int* in_object_properties);
+ void CalculateInstanceSizeForDerivedClass(InstanceType instance_type,
+ int requested_internal_fields,
+ int* instance_size,
+ int* in_object_properties);
+
// Iterates the objects, including code objects indirectly referenced
// through pointers to the first instruction in the code object.
void JSFunctionIterateBody(int object_size, ObjectVisitor* v);
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698