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

Unified Diff: src/objects.layout

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
« Makefile ('K') | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.layout
diff --git a/src/objects.layout b/src/objects.layout
new file mode 100755
index 0000000000000000000000000000000000000000..04b954e8153752217d3ec38f6e5072a04ed86013
--- /dev/null
+++ b/src/objects.layout
@@ -0,0 +1,153 @@
+# Copyright 2013 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# This file contains the description for V8's heap object layouts in a
+# JSON-esque domain-specific language. Modify this file and re-run the
+# generator script to change the generated files.
+
+{ types: [ # Begin main types dictionary here.
+
+###
+#
+# Each 'type' can have the following properties:
+# - 'name' (mandatory): The name in Pascal-case.
+# - 'base' (mandatory): The parent type in Pascal-case.
+# - 'fields' (mandatory): A list of all contained fields.
+# - 'comment': A comment to be displayed for the class.
+#
+# Each 'field' can have the following properties:
+# - 'name' (mandatory): The name in lower-case.
+# - 'type': The type of the field, defaults to 'Object'.
+# - 'comment': A comment to be displayed for the accessor.
+# - 'bitfield': A list of fields encoded within this field.
+#
+# Known primitive types to be used: tBool, tSmi
+#
+###
+
+{ name: "Box",
+ base: "Struct",
+ comment: "A simple one-element struct, useful where SMIs need to be boxed.",
+ fields: [
+ { name: "value", comment: "the boxed contents." },
titzer 2013/09/02 08:32:10 I guess a field without a type is just assumed to
+ ],
+},
+
+{ name: "AliasedArgumentsEntry",
+ base: "Struct",
+ comment: [
+ "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",
+ ],
+ fields: [
+ { name: "aliased_context_slot", type: tSmi },
+ ],
+},
+
+{ name: "DeclaredAccessorInfo",
+ base: "AccessorInfo",
+ fields: [
+ { name: "descriptor", type: "DeclaredAccessorDescriptor" },
+ ],
+},
+
+{ name: "ExecutableAccessorInfo",
+ base: "AccessorInfo",
+ comment: [
+ "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.",
+ ],
+ fields: [
+ { name: "getter" },
+ { name: "setter" },
+ { name: "data" },
+ ],
+},
+
+{ name: "FunctionTemplateInfo",
+ base: "TemplateInfo",
+ fields: [
+ { name: "serial_number" },
+ { name: "call_code" },
+ { name: "property_accessors" },
+ { name: "prototype_template" },
+ { name: "parent_template" },
+ { name: "named_property_handler" },
+ { name: "indexed_property_handler" },
+ { name: "instance_template" },
+ { name: "class_name" },
+ { name: "signature" },
+ { name: "instance_call_handler" },
+ { name: "access_check_info" },
+ { name: "flag", type: tSmi, bitfield: [
titzer 2013/09/02 08:32:10 Should we by default pack bools into a bitfield? A
+ { name: "hidden_prototype", type: tBool },
+ { name: "undetectable", type: tBool },
+ { name: "needs_access_check", type: tBool },
+ { name: "read_only_prototype", type: tBool },
+ { name: "remove_prototype", type: tBool },
+ ]},
+ { name: "length", type: tSmi },
+ ],
+},
+
+{ name: "ObjectTemplateInfo",
+ base: "TemplateInfo",
+ fields: [
+ { name: "constructor" },
+ { name: "internal_field_count" },
+ ],
+},
+
+{ name: "SignatureInfo",
+ base: "Struct",
+ fields: [
+ { name: "receiver" },
+ { name: "args" },
+ ],
+},
+
+{ name: "TypeSwitchInfo",
+ base: "Struct",
+ fields: [
+ { name: "types" },
+ ],
+},
+
+]} # End main types dictionary here.
« Makefile ('K') | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698