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

Unified Diff: src/types.h

Issue 232843002: Yet more type system tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Doc Created 6 years, 8 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 | « no previous file | src/types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698