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

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

Issue 2510783002: VM: Optimize RegExp.matchAsPrefix(...) by generating a sticky RegExp specialization. (Closed)
Patch Set: Done Created 4 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
« no previous file with comments | « runtime/vm/object_service.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 RUNTIME_VM_RAW_OBJECT_H_ 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_
6 #define RUNTIME_VM_RAW_OBJECT_H_ 6 #define RUNTIME_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 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 2109
2110 // VM type for capturing JS regular expressions. 2110 // VM type for capturing JS regular expressions.
2111 class RawRegExp : public RawInstance { 2111 class RawRegExp : public RawInstance {
2112 RAW_HEAP_OBJECT_IMPLEMENTATION(RegExp); 2112 RAW_HEAP_OBJECT_IMPLEMENTATION(RegExp);
2113 2113
2114 RawObject** from() { 2114 RawObject** from() {
2115 return reinterpret_cast<RawObject**>(&ptr()->num_bracket_expressions_); 2115 return reinterpret_cast<RawObject**>(&ptr()->num_bracket_expressions_);
2116 } 2116 }
2117 RawSmi* num_bracket_expressions_; 2117 RawSmi* num_bracket_expressions_;
2118 RawString* pattern_; // Pattern to be used for matching. 2118 RawString* pattern_; // Pattern to be used for matching.
2119 RawFunction* one_byte_function_; 2119 union {
2120 RawFunction* two_byte_function_; 2120 RawFunction* function_;
2121 RawTypedData* bytecode_;
2122 } one_byte_;
2123 union {
2124 RawFunction* function_;
2125 RawTypedData* bytecode_;
2126 } two_byte_;
2121 RawFunction* external_one_byte_function_; 2127 RawFunction* external_one_byte_function_;
2122 RawFunction* external_two_byte_function_; 2128 RawFunction* external_two_byte_function_;
2123 RawTypedData* one_byte_bytecode_; 2129 union {
2124 RawTypedData* two_byte_bytecode_; 2130 RawFunction* function_;
2131 RawTypedData* bytecode_;
2132 } one_byte_sticky_;
2133 union {
2134 RawFunction* function_;
2135 RawTypedData* bytecode_;
2136 } two_byte_sticky_;
2137 RawFunction* external_one_byte_sticky_function_;
2138 RawFunction* external_two_byte_sticky_function_;
2125 RawObject** to() { 2139 RawObject** to() {
2126 return reinterpret_cast<RawObject**>(&ptr()->two_byte_bytecode_); 2140 return reinterpret_cast<RawObject**>(
2141 &ptr()->external_two_byte_sticky_function_);
2127 } 2142 }
2128 2143
2129 intptr_t num_registers_; 2144 intptr_t num_registers_;
2130 2145
2131 // A bitfield with two fields: 2146 // A bitfield with two fields:
2132 // type: Uninitialized, simple or complex. 2147 // type: Uninitialized, simple or complex.
2133 // flags: Represents global/local, case insensitive, multiline. 2148 // flags: Represents global/local, case insensitive, multiline.
2134 int8_t type_flags_; 2149 int8_t type_flags_;
2135 }; 2150 };
2136 2151
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == 2392 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid ==
2378 kTypedDataInt8ArrayViewCid + 15); 2393 kTypedDataInt8ArrayViewCid + 15);
2379 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); 2394 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14);
2380 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); 2395 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1);
2381 return (kNullCid - kTypedDataInt8ArrayCid); 2396 return (kNullCid - kTypedDataInt8ArrayCid);
2382 } 2397 }
2383 2398
2384 } // namespace dart 2399 } // namespace dart
2385 2400
2386 #endif // RUNTIME_VM_RAW_OBJECT_H_ 2401 #endif // RUNTIME_VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object_service.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698