| OLD | NEW |
| 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 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 | 1466 |
| 1467 | 1467 |
| 1468 // VM type for capturing stacktraces when exceptions are thrown, | 1468 // VM type for capturing stacktraces when exceptions are thrown, |
| 1469 // Currently we don't have any interface that this object is supposed | 1469 // Currently we don't have any interface that this object is supposed |
| 1470 // to implement so we just support the 'toString' method which | 1470 // to implement so we just support the 'toString' method which |
| 1471 // converts the stack trace into a string. | 1471 // converts the stack trace into a string. |
| 1472 class RawStacktrace : public RawInstance { | 1472 class RawStacktrace : public RawInstance { |
| 1473 RAW_HEAP_OBJECT_IMPLEMENTATION(Stacktrace); | 1473 RAW_HEAP_OBJECT_IMPLEMENTATION(Stacktrace); |
| 1474 | 1474 |
| 1475 RawObject** from() { | 1475 RawObject** from() { |
| 1476 return reinterpret_cast<RawObject**>(&ptr()->function_array_); | 1476 return reinterpret_cast<RawObject**>(&ptr()->code_array_); |
| 1477 } | 1477 } |
| 1478 RawArray* function_array_; // Function for each frame in the stack trace. | |
| 1479 RawArray* code_array_; // Code object for each frame in the stack trace. | 1478 RawArray* code_array_; // Code object for each frame in the stack trace. |
| 1480 RawArray* pc_offset_array_; // Offset of PC for each frame. | 1479 RawArray* pc_offset_array_; // Offset of PC for each frame. |
| 1481 RawArray* catch_func_array_; // Func for each frame in catch stack trace. | |
| 1482 RawArray* catch_code_array_; // Code for each frame in catch stack trace. | 1480 RawArray* catch_code_array_; // Code for each frame in catch stack trace. |
| 1483 RawArray* catch_pc_offset_array_; // Offset of PC for each catch stack frame. | 1481 RawArray* catch_pc_offset_array_; // Offset of PC for each catch stack frame. |
| 1484 RawObject** to() { | 1482 RawObject** to() { |
| 1485 return reinterpret_cast<RawObject**>(&ptr()->catch_pc_offset_array_); | 1483 return reinterpret_cast<RawObject**>(&ptr()->catch_pc_offset_array_); |
| 1486 } | 1484 } |
| 1485 // False for pre-allocated stack trace (used in OOM and Stack overflow). |
| 1486 bool expand_inlined_; |
| 1487 }; | 1487 }; |
| 1488 | 1488 |
| 1489 | 1489 |
| 1490 // VM type for capturing JS regular expressions. | 1490 // VM type for capturing JS regular expressions. |
| 1491 class RawJSRegExp : public RawInstance { | 1491 class RawJSRegExp : public RawInstance { |
| 1492 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); | 1492 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); |
| 1493 | 1493 |
| 1494 RawObject** from() { | 1494 RawObject** from() { |
| 1495 return reinterpret_cast<RawObject**>(&ptr()->data_length_); | 1495 return reinterpret_cast<RawObject**>(&ptr()->data_length_); |
| 1496 } | 1496 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 // Make sure this is updated when new TypedData types are added. | 1712 // Make sure this is updated when new TypedData types are added. |
| 1713 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); | 1713 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); |
| 1714 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); | 1714 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); |
| 1715 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); | 1715 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); |
| 1716 return (kNullCid - kTypedDataInt8ArrayCid); | 1716 return (kNullCid - kTypedDataInt8ArrayCid); |
| 1717 } | 1717 } |
| 1718 | 1718 |
| 1719 } // namespace dart | 1719 } // namespace dart |
| 1720 | 1720 |
| 1721 #endif // VM_RAW_OBJECT_H_ | 1721 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |