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

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: rebase 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 kGetterFunction, // represents getter functions e.g: get foo() { .. }. 629 kGetterFunction, // represents getter functions e.g: get foo() { .. }.
630 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. 630 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
631 kConstructor, 631 kConstructor,
632 kImplicitGetter, // represents an implicit getter for fields. 632 kImplicitGetter, // represents an implicit getter for fields.
633 kImplicitSetter, // represents an implicit setter for fields. 633 kImplicitSetter, // represents an implicit setter for fields.
634 kImplicitStaticFinalGetter, // represents an implicit getter for static 634 kImplicitStaticFinalGetter, // represents an implicit getter for static
635 // final fields (incl. static const fields). 635 // final fields (incl. static const fields).
636 kMethodExtractor, // converts method into implicit closure on the receiver. 636 kMethodExtractor, // converts method into implicit closure on the receiver.
637 kNoSuchMethodDispatcher, // invokes noSuchMethod. 637 kNoSuchMethodDispatcher, // invokes noSuchMethod.
638 kInvokeFieldDispatcher, // invokes a field as a closure. 638 kInvokeFieldDispatcher, // invokes a field as a closure.
639 kIrregexpFunction, // represents a generated irregexp matcher function.
639 }; 640 };
640 641
641 enum AsyncModifier { 642 enum AsyncModifier {
642 kNoModifier, 643 kNoModifier,
643 kAsync, 644 kAsync,
644 }; 645 };
645 646
646 private: 647 private:
647 // So that the MarkingVisitor::DetachCode can null out the code fields. 648 // So that the MarkingVisitor::DetachCode can null out the code fields.
648 friend class MarkingVisitor; 649 friend class MarkingVisitor;
(...skipping 22 matching lines...) Expand all
671 RawObject** to() { 672 RawObject** to() {
672 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); 673 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_);
673 } 674 }
674 675
675 int32_t token_pos_; 676 int32_t token_pos_;
676 int32_t end_token_pos_; 677 int32_t end_token_pos_;
677 int32_t usage_counter_; // Incremented while function is running. 678 int32_t usage_counter_; // Incremented while function is running.
678 int16_t num_fixed_parameters_; 679 int16_t num_fixed_parameters_;
679 int16_t num_optional_parameters_; // > 0: positional; < 0: named. 680 int16_t num_optional_parameters_; // > 0: positional; < 0: named.
680 int16_t deoptimization_counter_; 681 int16_t deoptimization_counter_;
682 int16_t regexp_cid_;
681 uint32_t kind_tag_; // See Function::KindTagBits. 683 uint32_t kind_tag_; // See Function::KindTagBits.
682 uint16_t optimized_instruction_count_; 684 uint16_t optimized_instruction_count_;
683 uint16_t optimized_call_site_count_; 685 uint16_t optimized_call_site_count_;
684 }; 686 };
685 687
686 688
687 class RawClosureData : public RawObject { 689 class RawClosureData : public RawObject {
688 private: 690 private:
689 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); 691 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData);
690 692
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 // VM type for capturing JS regular expressions. 1782 // VM type for capturing JS regular expressions.
1781 class RawJSRegExp : public RawInstance { 1783 class RawJSRegExp : public RawInstance {
1782 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); 1784 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp);
1783 1785
1784 RawObject** from() { 1786 RawObject** from() {
1785 return reinterpret_cast<RawObject**>(&ptr()->data_length_); 1787 return reinterpret_cast<RawObject**>(&ptr()->data_length_);
1786 } 1788 }
1787 RawSmi* data_length_; 1789 RawSmi* data_length_;
1788 RawSmi* num_bracket_expressions_; 1790 RawSmi* num_bracket_expressions_;
1789 RawString* pattern_; // Pattern to be used for matching. 1791 RawString* pattern_; // Pattern to be used for matching.
1792 RawFunction* one_byte_function_;
1793 RawFunction* two_byte_function_;
1794 RawFunction* external_one_byte_function_;
1795 RawFunction* external_two_byte_function_;
1790 RawObject** to() { 1796 RawObject** to() {
1791 return reinterpret_cast<RawObject**>(&ptr()->pattern_); 1797 return reinterpret_cast<RawObject**>(&ptr()->external_two_byte_function_);
1792 } 1798 }
1793 1799
1794 // A bitfield with two fields: 1800 // A bitfield with two fields:
1795 // type: Uninitialized, simple or complex. 1801 // type: Uninitialized, simple or complex.
1796 // flags: Represents global/local, case insensitive, multiline. 1802 // flags: Represents global/local, case insensitive, multiline.
1797 int8_t type_flags_; 1803 int8_t type_flags_;
1798 1804
1799 // Variable length data follows here. 1805 // Variable length data follows here.
1800 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } 1806 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); }
1801 }; 1807 };
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2074 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2069 kTypedDataInt8ArrayViewCid + 15); 2075 kTypedDataInt8ArrayViewCid + 15);
2070 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2076 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2071 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2077 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2072 return (kNullCid - kTypedDataInt8ArrayCid); 2078 return (kNullCid - kTypedDataInt8ArrayCid);
2073 } 2079 }
2074 2080
2075 } // namespace dart 2081 } // namespace dart
2076 2082
2077 #endif // VM_RAW_OBJECT_H_ 2083 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698