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

Unified Diff: src/objects.h

Issue 23604020: Initial prototype of object layout generation. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index f159b662ca613f35283e00b07e7eea9226ebabcf..f9c7c149334c6b04f88dfaad5c95caa501daea83 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6033,26 +6033,6 @@ class Struct: public HeapObject {
};
-// A simple one-element struct, useful where smis need to be boxed.
-class Box : public Struct {
- public:
- // [value]: the boxed contents.
- DECL_ACCESSORS(value, Object)
-
- static inline Box* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(Box)
- DECLARE_VERIFIER(Box)
-
- static const int kValueOffset = HeapObject::kHeaderSize;
- static const int kSize = kValueOffset + kPointerSize;
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(Box);
-};
-
-
// Script describes a script which has been added to the VM.
class Script: public Struct {
public:
@@ -7912,33 +7892,6 @@ class AllocationMemento: public Struct {
};
-// Representation of a slow alias as part of a non-strict arguments objects.
-// For fast aliases (if HasNonStrictArgumentsElements()):
-// - the parameter map contains an index into the context
-// - all attributes of the element have default values
-// For slow aliases (if HasDictionaryArgumentsElements()):
-// - the parameter map contains no fast alias mapping (i.e. the hole)
-// - this struct (in the slow backing store) contains an index into the context
-// - all attributes are available as part if the property details
-class AliasedArgumentsEntry: public Struct {
- public:
- inline int aliased_context_slot();
- inline void set_aliased_context_slot(int count);
-
- static inline AliasedArgumentsEntry* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(AliasedArgumentsEntry)
- DECLARE_VERIFIER(AliasedArgumentsEntry)
-
- static const int kAliasedContextSlot = HeapObject::kHeaderSize;
- static const int kSize = kAliasedContextSlot + kPointerSize;
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(AliasedArgumentsEntry);
-};
-
-
enum AllowNullsFlag {ALLOW_NULLS, DISALLOW_NULLS};
enum RobustnessFlag {ROBUST_STRING_TRAVERSAL, FAST_STRING_TRAVERSAL};
@@ -9665,55 +9618,6 @@ class DeclaredAccessorDescriptor: public Struct {
};
-class DeclaredAccessorInfo: public AccessorInfo {
- public:
- DECL_ACCESSORS(descriptor, DeclaredAccessorDescriptor)
-
- static inline DeclaredAccessorInfo* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(DeclaredAccessorInfo)
- DECLARE_VERIFIER(DeclaredAccessorInfo)
-
- static const int kDescriptorOffset = AccessorInfo::kSize;
- static const int kSize = kDescriptorOffset + kPointerSize;
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorInfo);
-};
-
-
-// An accessor must have a getter, but can have no setter.
-//
-// When setting a property, V8 searches accessors in prototypes.
-// If an accessor was found and it does not have a setter,
-// the request is ignored.
-//
-// If the accessor in the prototype has the READ_ONLY property attribute, then
-// a new value is added to the local object when the property is set.
-// This shadows the accessor in the prototype.
-class ExecutableAccessorInfo: public AccessorInfo {
- public:
- DECL_ACCESSORS(getter, Object)
- DECL_ACCESSORS(setter, Object)
- DECL_ACCESSORS(data, Object)
-
- static inline ExecutableAccessorInfo* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(ExecutableAccessorInfo)
- DECLARE_VERIFIER(ExecutableAccessorInfo)
-
- static const int kGetterOffset = AccessorInfo::kSize;
- static const int kSetterOffset = kGetterOffset + kPointerSize;
- static const int kDataOffset = kSetterOffset + kPointerSize;
- static const int kSize = kDataOffset + kPointerSize;
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(ExecutableAccessorInfo);
-};
-
-
// Support for JavaScript accessors: A pair of a getter and a setter. Each
// accessor can either be
// * a pointer to a JavaScript function or proxy: a real accessor
@@ -9875,127 +9779,6 @@ class TemplateInfo: public Struct {
};
-class FunctionTemplateInfo: public TemplateInfo {
- public:
- DECL_ACCESSORS(serial_number, Object)
- DECL_ACCESSORS(call_code, Object)
- DECL_ACCESSORS(property_accessors, Object)
- DECL_ACCESSORS(prototype_template, Object)
- DECL_ACCESSORS(parent_template, Object)
- DECL_ACCESSORS(named_property_handler, Object)
- DECL_ACCESSORS(indexed_property_handler, Object)
- DECL_ACCESSORS(instance_template, Object)
- DECL_ACCESSORS(class_name, Object)
- DECL_ACCESSORS(signature, Object)
- DECL_ACCESSORS(instance_call_handler, Object)
- DECL_ACCESSORS(access_check_info, Object)
- DECL_ACCESSORS(flag, Smi)
-
- inline int length();
- inline void set_length(int value);
-
- // Following properties use flag bits.
- DECL_BOOLEAN_ACCESSORS(hidden_prototype)
- DECL_BOOLEAN_ACCESSORS(undetectable)
- // If the bit is set, object instances created by this function
- // requires access check.
- DECL_BOOLEAN_ACCESSORS(needs_access_check)
- DECL_BOOLEAN_ACCESSORS(read_only_prototype)
- DECL_BOOLEAN_ACCESSORS(remove_prototype)
-
- static inline FunctionTemplateInfo* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(FunctionTemplateInfo)
- DECLARE_VERIFIER(FunctionTemplateInfo)
-
- static const int kSerialNumberOffset = TemplateInfo::kHeaderSize;
- static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize;
- static const int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize;
- static const int kPrototypeTemplateOffset =
- kPropertyAccessorsOffset + kPointerSize;
- static const int kParentTemplateOffset =
- kPrototypeTemplateOffset + kPointerSize;
- static const int kNamedPropertyHandlerOffset =
- kParentTemplateOffset + kPointerSize;
- static const int kIndexedPropertyHandlerOffset =
- kNamedPropertyHandlerOffset + kPointerSize;
- static const int kInstanceTemplateOffset =
- kIndexedPropertyHandlerOffset + kPointerSize;
- static const int kClassNameOffset = kInstanceTemplateOffset + kPointerSize;
- static const int kSignatureOffset = kClassNameOffset + kPointerSize;
- static const int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize;
- static const int kAccessCheckInfoOffset =
- kInstanceCallHandlerOffset + kPointerSize;
- static const int kFlagOffset = kAccessCheckInfoOffset + kPointerSize;
- static const int kLengthOffset = kFlagOffset + kPointerSize;
- static const int kSize = kLengthOffset + kPointerSize;
-
- private:
- // Bit position in the flag, from least significant bit position.
- static const int kHiddenPrototypeBit = 0;
- static const int kUndetectableBit = 1;
- static const int kNeedsAccessCheckBit = 2;
- static const int kReadOnlyPrototypeBit = 3;
- static const int kRemovePrototypeBit = 4;
-
- DISALLOW_IMPLICIT_CONSTRUCTORS(FunctionTemplateInfo);
-};
-
-
-class ObjectTemplateInfo: public TemplateInfo {
- public:
- DECL_ACCESSORS(constructor, Object)
- DECL_ACCESSORS(internal_field_count, Object)
-
- static inline ObjectTemplateInfo* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(ObjectTemplateInfo)
- DECLARE_VERIFIER(ObjectTemplateInfo)
-
- static const int kConstructorOffset = TemplateInfo::kHeaderSize;
- static const int kInternalFieldCountOffset =
- kConstructorOffset + kPointerSize;
- static const int kSize = kInternalFieldCountOffset + kPointerSize;
-};
-
-
-class SignatureInfo: public Struct {
- public:
- DECL_ACCESSORS(receiver, Object)
- DECL_ACCESSORS(args, Object)
-
- static inline SignatureInfo* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(SignatureInfo)
- DECLARE_VERIFIER(SignatureInfo)
-
- static const int kReceiverOffset = Struct::kHeaderSize;
- static const int kArgsOffset = kReceiverOffset + kPointerSize;
- static const int kSize = kArgsOffset + kPointerSize;
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(SignatureInfo);
-};
-
-
-class TypeSwitchInfo: public Struct {
- public:
- DECL_ACCESSORS(types, Object)
-
- static inline TypeSwitchInfo* cast(Object* obj);
-
- // Dispatched behavior.
- DECLARE_PRINTER(TypeSwitchInfo)
- DECLARE_VERIFIER(TypeSwitchInfo)
-
- static const int kTypesOffset = Struct::kHeaderSize;
- static const int kSize = kTypesOffset + kPointerSize;
-};
-
-
#ifdef ENABLE_DEBUGGER_SUPPORT
// The DebugInfo class holds additional information for a function being
// debugged.
@@ -10103,6 +9886,11 @@ class BreakPointInfo: public Struct {
#endif // ENABLE_DEBUGGER_SUPPORT
+// Include automatically generated object descriptions here, after all
+// necessary base classes and helper macros have been declared.
+#include "objects-gen.h"
+
+
#undef DECL_BOOLEAN_ACCESSORS
#undef DECL_ACCESSORS
#undef DECLARE_VERIFIER

Powered by Google App Engine
This is Rietveld 408576698