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

Unified Diff: src/vm/object.h

Issue 1209033003: Work in progres, please take a look and give early feedback if this is the way we want to structure… (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: address comments Created 5 years, 6 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 | « src/vm/list.h ('k') | src/vm/platform_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/vm/object.h
diff --git a/src/vm/object.h b/src/vm/object.h
index 9fe153b09d07f68f938c7f1a9645059931f43264..575b1afb183165976f1f08845f4df0120c8230a4 100644
--- a/src/vm/object.h
+++ b/src/vm/object.h
@@ -70,7 +70,8 @@ class Object {
inline bool IsStack();
inline bool IsCoroutine();
inline bool IsPort();
- inline bool IsForeign();
+ inline bool IsForeignFunction();
+ inline bool IsForeignMemory();
// - based on marker field in class.
inline bool IsNull();
@@ -155,28 +156,29 @@ class Smi: public Object {
class InstanceFormat {
public:
enum Type {
- CLASS_TYPE = 0,
- INSTANCE_TYPE = 1,
- STRING_TYPE = 2,
- ARRAY_TYPE = 3,
- FUNCTION_TYPE = 4,
- LARGE_INTEGER_TYPE = 5,
- BYTE_ARRAY_TYPE = 6,
- DOUBLE_TYPE = 7,
- BOXED_TYPE = 8,
- STACK_TYPE = 9,
- INITIALIZER_TYPE = 10,
- IMMEDIATE_TYPE = 15 // No instances.
+ CLASS_TYPE = 0,
+ INSTANCE_TYPE = 1,
+ STRING_TYPE = 2,
+ ARRAY_TYPE = 3,
+ FUNCTION_TYPE = 4,
+ LARGE_INTEGER_TYPE = 5,
+ BYTE_ARRAY_TYPE = 6,
+ DOUBLE_TYPE = 7,
+ BOXED_TYPE = 8,
+ STACK_TYPE = 9,
+ INITIALIZER_TYPE = 10,
+ IMMEDIATE_TYPE = 15 // No instances.
};
enum Marker {
- NULL_MARKER = 0,
- TRUE_MARKER = 1,
- FALSE_MARKER = 2,
- COROUTINE_MARKER = 3,
- PORT_MARKER = 4,
- FOREIGN_MARKER = 5,
- NO_MARKER = 7 // Else marker.
+ NULL_MARKER = 0,
+ TRUE_MARKER = 1,
+ FALSE_MARKER = 2,
+ COROUTINE_MARKER = 3,
+ PORT_MARKER = 4,
+ FOREIGN_FUNCTION_MARKER = 5,
+ FOREIGN_MEMORY_MARKER = 6,
+ NO_MARKER = 7 // Else marker.
};
// Factory functions.
@@ -1187,10 +1189,16 @@ bool Object::IsPort() {
return h->format().marker() == InstanceFormat::PORT_MARKER;
}
-bool Object::IsForeign() {
+bool Object::IsForeignFunction() {
if (IsSmi()) return false;
HeapObject* h = HeapObject::cast(this);
- return h->format().marker() == InstanceFormat::FOREIGN_MARKER;
+ return h->format().marker() == InstanceFormat::FOREIGN_FUNCTION_MARKER;
+}
+
+bool Object::IsForeignMemory() {
+ if (IsSmi()) return false;
+ HeapObject* h = HeapObject::cast(this);
+ return h->format().marker() == InstanceFormat::FOREIGN_MEMORY_MARKER;
}
bool Object::IsNull() {
« no previous file with comments | « src/vm/list.h ('k') | src/vm/platform_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698