Skip to content

Commit

Permalink
Moved oop.[ch]pp to memory/header.[ch]pp.
Browse files Browse the repository at this point in the history
First, OOP is obscure to newcomers wouldn't have any basis to know what an
object-oriented pointer (really a "tagged pointer") is. Second, with the
addition of non-OO managed memory objects, the name is no longer accurate.
MemoryHeader is both descriptive and accurate.
brixen committed Jul 26, 2016
1 parent 8a6c33a commit 87128db
Showing 14 changed files with 29 additions and 21 deletions.
3 changes: 2 additions & 1 deletion machine/builtin/object.hpp
Original file line number Diff line number Diff line change
@@ -4,9 +4,10 @@
#include <vector>

#include "defines.hpp"
#include "memory/header.hpp"

#include "vm.hpp"
#include "state.hpp"
#include "oop.hpp"
#include "type_info.hpp"
#include "executor.hpp"

2 changes: 1 addition & 1 deletion machine/builtin/string.hpp
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
#include "configuration.hpp"
#include "object_utils.hpp"
#include "memory.hpp"
#include "oop.hpp"
#include "memory/header.hpp"

#include <ctype.h> // For isdigit and friends
#include <errno.h> // For ERANGE
17 changes: 8 additions & 9 deletions machine/defines.hpp
Original file line number Diff line number Diff line change
@@ -4,16 +4,15 @@
/**
* @file defines.hpp
*
* Notably here, Symbols, Fixnums and true/false/nil are actually
* stored directly in the pointer value (and distinguished by the
* tag, see oop.hpp) but provided we do not attempt to dereference
* it, we can ALSO define a class and treat the pointer values as
* if they were real pointers to real objects of that class where
* typing is concerned. In the "instance methods", the this pointer
* is still the correct pointer value and can thus be used for the
* calculations needed.
* Notably here, Symbols, Fixnums and true/false/nil are actually stored
* directly in the pointer value (and distinguished by the tag, see
* memory/header.hpp) but provided we do not attempt to dereference it, we
* can ALSO define a class and treat the pointer values as if they were real
* pointers to real objects of that class where typing is concerned. In the
* "instance methods", the this pointer is still the correct pointer value
* and can thus be used for the calculations needed.
*
* @see oop.hpp
* @see memory/header.hpp
*/

#include <stdint.h>
3 changes: 2 additions & 1 deletion machine/drivers/cli.cpp
Original file line number Diff line number Diff line change
@@ -6,10 +6,11 @@
#include <llvm/Support/ManagedStatic.h>

#include "environment.hpp"
#include "oop.hpp"
#include "type_info.hpp"
#include "exception.hpp"

#include "memory/header.hpp"

#include "config.h"
#include "paths.h"

3 changes: 2 additions & 1 deletion machine/global_cache.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef RBX_VM_GLOBAL_CACHE_HPP
#define RBX_VM_GLOBAL_CACHE_HPP

#include "oop.hpp"
#include "memory/header.hpp"

#include "object_utils.hpp"
#include "builtin/compiled_code.hpp"
#include "builtin/symbol.hpp"
2 changes: 1 addition & 1 deletion machine/include/capi/capi_oop.h
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@
* value. Passing Fixnums through means that all the Fixnum conversions
* do not have to be reimplemented for the C-API.
*
* The tags break down as follows (@see machine/oop.hpp for more details):
* The tags break down as follows (@see machine/memory/header.hpp for more details):
*
* 00 0 0000 Qfalse
* xx x xxx1 Fixnum
3 changes: 2 additions & 1 deletion machine/memory.hpp
Original file line number Diff line number Diff line change
@@ -2,9 +2,10 @@
#define RBX_OBJECTMEMORY_H

#include "defines.hpp"
#include "memory/header.hpp"

#include "type_info.hpp"
#include "object_position.hpp"
#include "oop.hpp"
#include "metrics.hpp"
#include "configuration.hpp"

3 changes: 2 additions & 1 deletion machine/memory/gc.hpp
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@

#include <list>

#include "oop.hpp"
#include "memory/header.hpp"

#include "shared_state.hpp"

#include "builtin/object.hpp"
3 changes: 2 additions & 1 deletion machine/oop.cpp → machine/memory/header.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "util/atomic.hpp"

#include "memory/header.hpp"

#include "bug.hpp"
#include "configuration.hpp"
#include "memory.hpp"
#include "on_stack.hpp"
#include "oop.hpp"
#include "thread_phase.hpp"

#include "builtin/object.hpp"
File renamed without changes.
3 changes: 2 additions & 1 deletion machine/memory/inflated_headers.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "oop.hpp"
#include "memory/header.hpp"

#include "vm.hpp"
#include "state.hpp"
#include "memory.hpp"
3 changes: 2 additions & 1 deletion machine/memory/root.hpp
Original file line number Diff line number Diff line change
@@ -4,8 +4,9 @@

#include <stdexcept>

#include "memory/header.hpp"

#include "linkedlist.hpp"
#include "oop.hpp"
#include "defines.hpp"

#include "util/thread.hpp"
3 changes: 2 additions & 1 deletion machine/symbol_table.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef RBX_SYMBOLTABLE_HPP
#define RBX_SYMBOLTABLE_HPP

#include "oop.hpp"
#include "memory/header.hpp"

#include "defines.hpp"
#include "diagnostics.hpp"

2 changes: 1 addition & 1 deletion machine/test/test_memory_header.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "machine/test/test.hpp"

#include "oop.hpp"
#include "memory/header.hpp"

#include <cxxtest/TestSuite.h>

0 comments on commit 87128db

Please sign in to comment.