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

Unified Diff: runtime/vm/raw_object.h

Issue 2035453002: Pixels class prototype and test (not to be committed). Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: work in progress Created 4 years, 5 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 | « runtime/vm/parser_test.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 3f5a507d3a67dc74476be205e77057f4a596ccf5..def0232cbd84f79e8730a677991e596ff79367b6 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -61,6 +61,7 @@ namespace dart {
V(Smi) \
V(Mint) \
V(Bigint) \
+ V(Pixels) \
V(Double) \
V(Bool) \
V(GrowableObjectArray) \
@@ -1805,6 +1806,19 @@ class RawBigint : public RawInteger {
};
+class RawPixels : public RawNumber {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(Pixels);
+
+ RawObject** from() {
+ return reinterpret_cast<RawObject**>(&ptr()->value_);
+ }
+ RawSmi* value_;
+ RawObject** to() {
+ return reinterpret_cast<RawObject**>(&ptr()->value_);
+ }
+};
+
+
class RawDouble : public RawNumber {
RAW_HEAP_OBJECT_IMPLEMENTATION(Double);
@@ -2237,7 +2251,8 @@ inline bool RawObject::IsNumberClassId(intptr_t index) {
kSmiCid == kNumberCid + 2 &&
kMintCid == kNumberCid + 3 &&
kBigintCid == kNumberCid + 4 &&
- kDoubleCid == kNumberCid + 5);
+ kPixelsCid == kNumberCid + 5 &&
+ kDoubleCid == kNumberCid + 6);
return (index >= kNumberCid && index < kBoolCid);
}
@@ -2247,8 +2262,8 @@ inline bool RawObject::IsIntegerClassId(intptr_t index) {
COMPILE_ASSERT(kSmiCid == kIntegerCid + 1 &&
kMintCid == kIntegerCid + 2 &&
kBigintCid == kIntegerCid + 3 &&
- kDoubleCid == kIntegerCid + 4);
- return (index >= kIntegerCid && index < kDoubleCid);
+ kPixelsCid == kIntegerCid + 4);
+ return (index >= kIntegerCid && index < kPixelsCid);
}
@@ -2416,7 +2431,7 @@ inline bool RawObject::IsVariableSizeClassId(intptr_t index) {
// is defined by the VM but are used in the VM code by computing the
// implicit field offsets of the various fields in the dart object.
inline bool RawObject::IsImplicitFieldClassId(intptr_t index) {
- return (IsTypedDataViewClassId(index) || index == kByteBufferCid);
+ return (IsTypedDataViewClassId(index) || (index == kByteBufferCid));
}
« no previous file with comments | « runtime/vm/parser_test.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698