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

Side by Side Diff: vm/raw_object.h

Issue 11087070: - Get rid of RawClosure class and use RawInstance for closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/object_test.cc ('k') | vm/raw_object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_RAW_OBJECT_H_ 5 #ifndef VM_RAW_OBJECT_H_
6 #define VM_RAW_OBJECT_H_ 6 #define VM_RAW_OBJECT_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 V(ExternalInt32Array) \ 85 V(ExternalInt32Array) \
86 V(ExternalUint32Array) \ 86 V(ExternalUint32Array) \
87 V(ExternalInt64Array) \ 87 V(ExternalInt64Array) \
88 V(ExternalUint64Array) \ 88 V(ExternalUint64Array) \
89 V(ExternalFloat32Array) \ 89 V(ExternalFloat32Array) \
90 V(ExternalFloat64Array) \ 90 V(ExternalFloat64Array) \
91 V(Stacktrace) \ 91 V(Stacktrace) \
92 V(JSRegExp) \ 92 V(JSRegExp) \
93 V(WeakProperty) \ 93 V(WeakProperty) \
94 V(DartFunction) \ 94 V(DartFunction) \
95 V(Closure) \
96 95
97 #define CLASS_LIST(V) \ 96 #define CLASS_LIST(V) \
98 V(Object) \ 97 V(Object) \
99 CLASS_LIST_NO_OBJECT(V) 98 CLASS_LIST_NO_OBJECT(V)
100 99
101 100
102 // Forward declarations. 101 // Forward declarations.
103 class Isolate; 102 class Isolate;
104 #define DEFINE_FORWARD_DECLARATION(clazz) \ 103 #define DEFINE_FORWARD_DECLARATION(clazz) \
105 class Raw##clazz; 104 class Raw##clazz;
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 1425
1427 ExternalByteArrayData<double>* external_data_; 1426 ExternalByteArrayData<double>* external_data_;
1428 }; 1427 };
1429 1428
1430 1429
1431 class RawDartFunction : public RawInstance { 1430 class RawDartFunction : public RawInstance {
1432 RAW_HEAP_OBJECT_IMPLEMENTATION(DartFunction); 1431 RAW_HEAP_OBJECT_IMPLEMENTATION(DartFunction);
1433 }; 1432 };
1434 1433
1435 1434
1436 class RawClosure : public RawInstance {
1437 RAW_HEAP_OBJECT_IMPLEMENTATION(Closure);
1438
1439 RawObject** from() {
1440 return reinterpret_cast<RawObject**>(&ptr()->type_arguments_);
1441 }
1442 RawAbstractTypeArguments* type_arguments_;
1443 RawFunction* function_;
1444 RawContext* context_;
1445 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->context_); }
1446 };
1447
1448
1449 // VM type for capturing stacktraces when exceptions are thrown, 1435 // VM type for capturing stacktraces when exceptions are thrown,
1450 // Currently we don't have any interface that this object is supposed 1436 // Currently we don't have any interface that this object is supposed
1451 // to implement so we just support the 'toString' method which 1437 // to implement so we just support the 'toString' method which
1452 // converts the stack trace into a string. 1438 // converts the stack trace into a string.
1453 class RawStacktrace : public RawInstance { 1439 class RawStacktrace : public RawInstance {
1454 RAW_HEAP_OBJECT_IMPLEMENTATION(Stacktrace); 1440 RAW_HEAP_OBJECT_IMPLEMENTATION(Stacktrace);
1455 1441
1456 RawObject** from() { 1442 RawObject** from() {
1457 return reinterpret_cast<RawObject**>(&ptr()->function_array_); 1443 return reinterpret_cast<RawObject**>(&ptr()->function_array_);
1458 } 1444 }
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 kExternalUint64ArrayCid == kByteArrayCid + 18 && 1606 kExternalUint64ArrayCid == kByteArrayCid + 18 &&
1621 kExternalFloat32ArrayCid == kByteArrayCid + 19 && 1607 kExternalFloat32ArrayCid == kByteArrayCid + 19 &&
1622 kExternalFloat64ArrayCid == kByteArrayCid + 20 && 1608 kExternalFloat64ArrayCid == kByteArrayCid + 20 &&
1623 kStacktraceCid == kByteArrayCid + 21); 1609 kStacktraceCid == kByteArrayCid + 21);
1624 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid); 1610 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid);
1625 } 1611 }
1626 1612
1627 } // namespace dart 1613 } // namespace dart
1628 1614
1629 #endif // VM_RAW_OBJECT_H_ 1615 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « vm/object_test.cc ('k') | vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698