| 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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 static bool SkipCode(RawFunction* raw_fun); | 609 static bool SkipCode(RawFunction* raw_fun); |
| 610 | 610 |
| 611 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 611 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
| 612 RawString* name_; | 612 RawString* name_; |
| 613 RawObject* owner_; // Class or patch class or mixin class | 613 RawObject* owner_; // Class or patch class or mixin class |
| 614 // where this function is defined. | 614 // where this function is defined. |
| 615 RawAbstractType* result_type_; | 615 RawAbstractType* result_type_; |
| 616 RawArray* parameter_types_; | 616 RawArray* parameter_types_; |
| 617 RawArray* parameter_names_; | 617 RawArray* parameter_names_; |
| 618 RawObject* data_; // Additional data specific to the function kind. | 618 RawObject* data_; // Additional data specific to the function kind. |
| 619 RawObject** to_snapshot() { |
| 620 return reinterpret_cast<RawObject**>(&ptr()->data_); |
| 621 } |
| 622 // Fields below are not part of the snapshot. |
| 623 RawArray* ic_data_array_; // ICData of unoptimized code. |
| 624 RawObject** to_no_code() { |
| 625 return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_); |
| 626 } |
| 619 RawInstructions* instructions_; // Instructions of currently active code. | 627 RawInstructions* instructions_; // Instructions of currently active code. |
| 620 RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization. | 628 RawCode* unoptimized_code_; // Unoptimized code, keep it after optimization. |
| 621 RawObject** to() { | 629 RawObject** to() { |
| 622 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); | 630 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); |
| 623 } | 631 } |
| 624 RawObject** to_no_code() { | |
| 625 return reinterpret_cast<RawObject**>(&ptr()->data_); | |
| 626 } | |
| 627 RawObject** to_snapshot() { | |
| 628 return reinterpret_cast<RawObject**>(&ptr()->data_); | |
| 629 } | |
| 630 | 632 |
| 631 int32_t token_pos_; | 633 int32_t token_pos_; |
| 632 int32_t end_token_pos_; | 634 int32_t end_token_pos_; |
| 633 int32_t usage_counter_; // Incremented while function is running. | 635 int32_t usage_counter_; // Incremented while function is running. |
| 634 int16_t num_fixed_parameters_; | 636 int16_t num_fixed_parameters_; |
| 635 int16_t num_optional_parameters_; // > 0: positional; < 0: named. | 637 int16_t num_optional_parameters_; // > 0: positional; < 0: named. |
| 636 int16_t deoptimization_counter_; | 638 int16_t deoptimization_counter_; |
| 637 uint16_t kind_tag_; // See Function::KindTagBits. | 639 uint16_t kind_tag_; // See Function::KindTagBits. |
| 638 uint16_t optimized_instruction_count_; | 640 uint16_t optimized_instruction_count_; |
| 639 uint16_t optimized_call_site_count_; | 641 uint16_t optimized_call_site_count_; |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); | 1867 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); |
| 1866 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 1868 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 1867 kTypedDataInt8ArrayViewCid + 15); | 1869 kTypedDataInt8ArrayViewCid + 15); |
| 1868 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); | 1870 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); |
| 1869 return (kNullCid - kTypedDataInt8ArrayCid); | 1871 return (kNullCid - kTypedDataInt8ArrayCid); |
| 1870 } | 1872 } |
| 1871 | 1873 |
| 1872 } // namespace dart | 1874 } // namespace dart |
| 1873 | 1875 |
| 1874 #endif // VM_RAW_OBJECT_H_ | 1876 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |