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

Unified Diff: runtime/vm/raw_object.h

Issue 243973002: - Add a minimal implementation of Capability. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
Index: runtime/vm/raw_object.h
===================================================================
--- runtime/vm/raw_object.h (revision 35191)
+++ runtime/vm/raw_object.h (working copy)
@@ -60,15 +60,18 @@
V(Double) \
V(Bool) \
V(GrowableObjectArray) \
+ V(Float32x4) \
+ V(Int32x4) \
+ V(Float64x2) \
V(TypedData) \
V(ExternalTypedData) \
+ V(Capability) \
+ V(ReceivePort) \
+ V(SendPort) \
V(Stacktrace) \
V(JSRegExp) \
V(WeakProperty) \
V(MirrorReference) \
- V(Float32x4) \
- V(Int32x4) \
- V(Float64x2) \
V(UserTag) \
#define CLASS_LIST_ARRAYS(V) \
@@ -1504,7 +1507,35 @@
friend class RawTokenStream;
};
+// VM implementations of the basic types in the isolate.
+class RawCapability : public RawInstance {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(Capability);
+ uint64_t id_;
+};
+
+class RawSendPort : public RawInstance {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(SendPort);
+ Dart_Port id_;
+
+ friend class ReceivePort;
+};
+
+
+class RawReceivePort : public RawInstance {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(ReceivePort);
+
+ RawObject** from() {
+ return reinterpret_cast<RawObject**>(&ptr()->send_port_);
+ }
+ RawSendPort* send_port_;
+ RawInstance* handler_;
+ RawObject** to() {
+ return reinterpret_cast<RawObject**>(&ptr()->handler_);
+ }
+};
+
+
// VM type for capturing stacktraces when exceptions are thrown,
// Currently we don't have any interface that this object is supposed
// to implement so we just support the 'toString' method which
@@ -1685,10 +1716,9 @@
inline bool RawObject::IsBuiltinListClassId(intptr_t index) {
// Make sure this function is updated when new builtin List types are added.
- ASSERT(kImmutableArrayCid == kArrayCid + 1 &&
- kTypedDataCid == kGrowableObjectArrayCid + 1);
+ ASSERT(kImmutableArrayCid == kArrayCid + 1);
return ((index >= kArrayCid && index <= kImmutableArrayCid) ||
- (index >= kGrowableObjectArrayCid && index < kTypedDataCid) ||
+ (index == kGrowableObjectArrayCid) ||
IsTypedDataClassId(index) ||
IsTypedDataViewClassId(index) ||
IsExternalTypedDataClassId(index));

Powered by Google App Engine
This is Rietveld 408576698