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

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

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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
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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 kGetterFunction, // represents getter functions e.g: get foo() { .. }. 618 kGetterFunction, // represents getter functions e.g: get foo() { .. }.
619 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }. 619 kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
620 kConstructor, 620 kConstructor,
621 kImplicitGetter, // represents an implicit getter for fields. 621 kImplicitGetter, // represents an implicit getter for fields.
622 kImplicitSetter, // represents an implicit setter for fields. 622 kImplicitSetter, // represents an implicit setter for fields.
623 kImplicitStaticFinalGetter, // represents an implicit getter for static 623 kImplicitStaticFinalGetter, // represents an implicit getter for static
624 // final fields (incl. static const fields). 624 // final fields (incl. static const fields).
625 kMethodExtractor, // converts method into implicit closure on the receiver. 625 kMethodExtractor, // converts method into implicit closure on the receiver.
626 kNoSuchMethodDispatcher, // invokes noSuchMethod. 626 kNoSuchMethodDispatcher, // invokes noSuchMethod.
627 kInvokeFieldDispatcher, // invokes a field as a closure. 627 kInvokeFieldDispatcher, // invokes a field as a closure.
628 kIrregexpFunction, // represents a generated irregexp matcher function.
628 }; 629 };
629 630
630 enum AsyncModifier { 631 enum AsyncModifier {
631 kNoModifier, 632 kNoModifier,
632 kAsync, 633 kAsync,
633 }; 634 };
634 635
635 private: 636 private:
636 // So that the MarkingVisitor::DetachCode can null out the code fields. 637 // So that the MarkingVisitor::DetachCode can null out the code fields.
637 friend class MarkingVisitor; 638 friend class MarkingVisitor;
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 // VM type for capturing JS regular expressions. 1711 // VM type for capturing JS regular expressions.
1711 class RawJSRegExp : public RawInstance { 1712 class RawJSRegExp : public RawInstance {
1712 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp); 1713 RAW_HEAP_OBJECT_IMPLEMENTATION(JSRegExp);
1713 1714
1714 RawObject** from() { 1715 RawObject** from() {
1715 return reinterpret_cast<RawObject**>(&ptr()->data_length_); 1716 return reinterpret_cast<RawObject**>(&ptr()->data_length_);
1716 } 1717 }
1717 RawSmi* data_length_; 1718 RawSmi* data_length_;
1718 RawSmi* num_bracket_expressions_; 1719 RawSmi* num_bracket_expressions_;
1719 RawString* pattern_; // Pattern to be used for matching. 1720 RawString* pattern_; // Pattern to be used for matching.
1721 RawFunction* one_byte_function_;
1722 RawFunction* two_byte_function_;
1720 RawObject** to() { 1723 RawObject** to() {
1721 return reinterpret_cast<RawObject**>(&ptr()->pattern_); 1724 return reinterpret_cast<RawObject**>(&ptr()->two_byte_function_);
1722 } 1725 }
1723 1726
1724 intptr_t type_; // Uninitialized, simple or complex. 1727 intptr_t type_; // Uninitialized, simple or complex.
1725 intptr_t flags_; // Represents global/local, case insensitive, multiline. 1728 intptr_t flags_; // Represents global/local, case insensitive, multiline.
1726 1729
1727 // Variable length data follows here. 1730 // Variable length data follows here.
1728 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } 1731 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); }
1729 }; 1732 };
1730 1733
1731 1734
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2000 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
1998 kTypedDataInt8ArrayViewCid + 15); 2001 kTypedDataInt8ArrayViewCid + 15);
1999 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2002 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2000 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2003 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2001 return (kNullCid - kTypedDataInt8ArrayCid); 2004 return (kNullCid - kTypedDataInt8ArrayCid);
2002 } 2005 }
2003 2006
2004 } // namespace dart 2007 } // namespace dart
2005 2008
2006 #endif // VM_RAW_OBJECT_H_ 2009 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698