Index: src/types.h |
diff --git a/src/types.h b/src/types.h |
index 16d80b8f8d44a314da3cae77d276b3f6545b38dc..6824575ebc37b1cd3c452faa43c185e9c6c2fbe2 100644 |
--- a/src/types.h |
+++ b/src/types.h |
@@ -10,6 +10,8 @@ |
namespace v8 { |
namespace internal { |
+// SUMMARY |
+// |
// A simple type system for compiler-internal use. It is based entirely on |
// union types, and all subtyping hence amounts to set inclusion. Besides the |
// obvious primitive types and some predefined unions, the type language also |
@@ -19,6 +21,8 @@ namespace internal { |
// Types consist of two dimensions: semantic (value range) and representation. |
// Both are related through subtyping. |
// |
+// SEMANTIC DIMENSION |
+// |
// The following equations and inequations hold for the semantic axis: |
// |
// None <= T |
@@ -45,6 +49,8 @@ namespace internal { |
// TODO(rossberg): the latter is not currently true for proxies, because of fix, |
// but will hold once we implement direct proxies. |
// |
+// REPRESENTATIONAL DIMENSION |
+// |
// For the representation axis, the following holds: |
// |
// None <= R |
@@ -69,6 +75,8 @@ namespace internal { |
// SignedSmall /\ TaggedInt (a 'smi') |
// Number /\ TaggedPtr (a heap number) |
// |
+// PREDICATES |
+// |
// There are two main functions for testing types: |
// |
// T1->Is(T2) -- tests whether T1 is included in T2 (i.e., T1 <= T2) |
@@ -84,6 +92,18 @@ namespace internal { |
// existing assumptions or tests. |
// Consequently, do not use pointer equality for type tests, always use Is! |
// |
+// PROPERTIES |
+// |
+// Various formal properties hold for constructors, operators, and predicates |
+// over types. For example, constructors are injective, subtyping is a partial |
+// order, and union and intersection satisfy the usual algebraic properties. |
+// |
+// See test/cctest/test-typing.cc for a comprehensive executable specification, |
Benedikt Meurer
2014/04/10 10:54:50
Nit: test-types.cc
|
+// especially with respect to the more exotic temporal constructors and |
+// predicates (prefixed 'Now'). |
+// |
+// IMPLEMENTATION |
+// |
// Internally, all 'primitive' types, and their unions, are represented as |
// bitsets. Class is a heap pointer to the respective map. Only Constant's, or |
// unions containing Class'es or Constant's, currently require allocation. |