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

Side by Side Diff: runtime/vm/raw_object.h

Issue 683433003: Integrate the Irregexp Regular Expression Engine. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: formatting and removed binds-in-args Created 6 years, 1 month 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
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/atomic.h" 9 #include "vm/atomic.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 kGetterFunction, // represents getter functions e.g: get foo() { .. }. 665 kGetterFunction, // represents getter functions e.g: get foo() { .. }.
666 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. 666 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
667 kConstructor, 667 kConstructor,
668 kImplicitGetter, // represents an implicit getter for fields. 668 kImplicitGetter, // represents an implicit getter for fields.
669 kImplicitSetter, // represents an implicit setter for fields. 669 kImplicitSetter, // represents an implicit setter for fields.
670 kImplicitStaticFinalGetter, // represents an implicit getter for static 670 kImplicitStaticFinalGetter, // represents an implicit getter for static
671 // final fields (incl. static const fields). 671 // final fields (incl. static const fields).
672 kMethodExtractor, // converts method into implicit closure on the receiver. 672 kMethodExtractor, // converts method into implicit closure on the receiver.
673 kNoSuchMethodDispatcher, // invokes noSuchMethod. 673 kNoSuchMethodDispatcher, // invokes noSuchMethod.
674 kInvokeFieldDispatcher, // invokes a field as a closure. 674 kInvokeFieldDispatcher, // invokes a field as a closure.
675 kIrregexpFunction, // represents a generated irregexp matcher function.
675 }; 676 };
676 677
677 enum AsyncModifier { 678 enum AsyncModifier {
678 kNoModifier, 679 kNoModifier,
679 kAsync, 680 kAsync,
680 }; 681 };
681 682
682 private: 683 private:
683 // So that the MarkingVisitor::DetachCode can null out the code fields. 684 // So that the MarkingVisitor::DetachCode can null out the code fields.
684 friend class MarkingVisitor; 685 friend class MarkingVisitor;
(...skipping 22 matching lines...) Expand all
707 RawObject** to() { 708 RawObject** to() {
708 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); 709 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_);
709 } 710 }
710 711
711 int32_t token_pos_; 712 int32_t token_pos_;
712 int32_t end_token_pos_; 713 int32_t end_token_pos_;
713 int32_t usage_counter_; // Incremented while function is running. 714 int32_t usage_counter_; // Incremented while function is running.
714 int16_t num_fixed_parameters_; 715 int16_t num_fixed_parameters_;
715 int16_t num_optional_parameters_; // > 0: positional; < 0: named. 716 int16_t num_optional_parameters_; // > 0: positional; < 0: named.
716 int16_t deoptimization_counter_; 717 int16_t deoptimization_counter_;
718 int16_t regexp_cid_;
717 uint32_t kind_tag_; // See Function::KindTagBits. 719 uint32_t kind_tag_; // See Function::KindTagBits.
718 uint16_t optimized_instruction_count_; 720 uint16_t optimized_instruction_count_;
719 uint16_t optimized_call_site_count_; 721 uint16_t optimized_call_site_count_;
720 }; 722 };
721 723
722 724
723 class RawClosureData : public RawObject { 725 class RawClosureData : public RawObject {
724 private: 726 private:
725 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); 727 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData);
726 728
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 // VM type for capturing JS regular expressions. 1824 // VM type for capturing JS regular expressions.
1823 class RawJSRegExp : public RawInstance { 1825 class RawJSRegExp : public RawInstance {
1824 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); 1826 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp);
1825 1827
1826 RawObject** from() { 1828 RawObject** from() {
1827 return reinterpret_cast<RawObject**>(&ptr()->data_length_); 1829 return reinterpret_cast<RawObject**>(&ptr()->data_length_);
1828 } 1830 }
1829 RawSmi* data_length_; 1831 RawSmi* data_length_;
1830 RawSmi* num_bracket_expressions_; 1832 RawSmi* num_bracket_expressions_;
1831 RawString* pattern_; // Pattern to be used for matching. 1833 RawString* pattern_; // Pattern to be used for matching.
1834 RawFunction* one_byte_function_;
1835 RawFunction* two_byte_function_;
1836 RawFunction* external_one_byte_function_;
1837 RawFunction* external_two_byte_function_;
1832 RawObject** to() { 1838 RawObject** to() {
1833 return reinterpret_cast<RawObject**>(&ptr()->pattern_); 1839 return reinterpret_cast<RawObject**>(&ptr()->external_two_byte_function_);
1834 } 1840 }
1835 1841
1836 // A bitfield with two fields: 1842 // A bitfield with two fields:
1837 // type: Uninitialized, simple or complex. 1843 // type: Uninitialized, simple or complex.
1838 // flags: Represents global/local, case insensitive, multiline. 1844 // flags: Represents global/local, case insensitive, multiline.
1839 int8_t type_flags_; 1845 int8_t type_flags_;
1840 1846
1841 // Variable length data follows here. 1847 // Variable length data follows here.
1842 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } 1848 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); }
1843 }; 1849 };
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2116 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2111 kTypedDataInt8ArrayViewCid + 15); 2117 kTypedDataInt8ArrayViewCid + 15);
2112 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2118 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2113 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2119 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2114 return (kNullCid - kTypedDataInt8ArrayCid); 2120 return (kNullCid - kTypedDataInt8ArrayCid);
2115 } 2121 }
2116 2122
2117 } // namespace dart 2123 } // namespace dart
2118 2124
2119 #endif // VM_RAW_OBJECT_H_ 2125 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698