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

Side by Side Diff: runtime/vm/object_service.cc

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.cc ('k') | runtime/vm/raw_object.h » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 #include "vm/debugger.h" 5 #include "vm/debugger.h"
6 #include "vm/disassembler.h" 6 #include "vm/disassembler.h"
7 #include "vm/object.h" 7 #include "vm/object.h"
8 #include "vm/object_store.h" 8 #include "vm/object_store.h"
9 #include "vm/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1505
1506 jsobj.AddProperty("pattern", String::Handle(pattern())); 1506 jsobj.AddProperty("pattern", String::Handle(pattern()));
1507 1507
1508 if (ref) { 1508 if (ref) {
1509 return; 1509 return;
1510 } 1510 }
1511 1511
1512 jsobj.AddProperty("isCaseSensitive", !is_ignore_case()); 1512 jsobj.AddProperty("isCaseSensitive", !is_ignore_case());
1513 jsobj.AddProperty("isMultiLine", is_multi_line()); 1513 jsobj.AddProperty("isMultiLine", is_multi_line());
1514 1514
1515 Function& func = Function::Handle(); 1515 if (!FLAG_interpret_irregexp) {
1516 func = function(kOneByteStringCid); 1516 Function& func = Function::Handle();
1517 jsobj.AddProperty("_oneByteFunction", func); 1517 func = function(kOneByteStringCid, /*sticky=*/false);
1518 func = function(kTwoByteStringCid); 1518 jsobj.AddProperty("_oneByteFunction", func);
1519 jsobj.AddProperty("_twoByteFunction", func); 1519 func = function(kTwoByteStringCid, /*sticky=*/false);
1520 func = function(kExternalOneByteStringCid); 1520 jsobj.AddProperty("_twoByteFunction", func);
1521 jsobj.AddProperty("_externalOneByteFunction", func); 1521 func = function(kExternalOneByteStringCid, /*sticky=*/false);
1522 func = function(kExternalTwoByteStringCid); 1522 jsobj.AddProperty("_externalOneByteFunction", func);
1523 jsobj.AddProperty("_externalTwoByteFunction", func); 1523 func = function(kExternalTwoByteStringCid, /*sticky=*/false);
1524 1524 jsobj.AddProperty("_externalTwoByteFunction", func);
1525 TypedData& bc = TypedData::Handle(); 1525 func = function(kOneByteStringCid, /*sticky=*/true);
1526 bc = bytecode(true); 1526 jsobj.AddProperty("_oneByteFunctionSticky", func);
1527 jsobj.AddProperty("_oneByteBytecode", bc); 1527 func = function(kTwoByteStringCid, /*sticky=*/true);
1528 bc = bytecode(false); 1528 jsobj.AddProperty("_twoByteFunctionSticky", func);
1529 jsobj.AddProperty("_twoByteBytecode", bc); 1529 func = function(kExternalOneByteStringCid, /*sticky=*/true);
1530 jsobj.AddProperty("_externalOneByteFunctionSticky", func);
1531 func = function(kExternalTwoByteStringCid, /*sticky=*/true);
1532 jsobj.AddProperty("_externalTwoByteFunctionSticky", func);
1533 } else {
1534 TypedData& bc = TypedData::Handle();
1535 bc = bytecode(/*is_one_byte=*/true, /*sticky=*/false);
1536 jsobj.AddProperty("_oneByteBytecode", bc);
1537 bc = bytecode(/*is_one_byte=*/false, /*sticky=*/false);
1538 jsobj.AddProperty("_twoByteBytecode", bc);
1539 bc = bytecode(/*is_one_byte=*/true, /*sticky=*/true);
1540 jsobj.AddProperty("_oneByteBytecodeSticky", bc);
1541 bc = bytecode(/*is_one_byte=*/false, /*sticky=*/true);
1542 jsobj.AddProperty("_twoByteBytecodeSticky", bc);
1543 }
1530 } 1544 }
1531 1545
1532 1546
1533 void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const { 1547 void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const {
1534 JSONObject jsobj(stream); 1548 JSONObject jsobj(stream);
1535 PrintSharedInstanceJSON(&jsobj, ref); 1549 PrintSharedInstanceJSON(&jsobj, ref);
1536 jsobj.AddProperty("kind", "WeakProperty"); 1550 jsobj.AddProperty("kind", "WeakProperty");
1537 jsobj.AddServiceId(*this); 1551 jsobj.AddServiceId(*this);
1538 if (ref) { 1552 if (ref) {
1539 return; 1553 return;
(...skipping 20 matching lines...) Expand all
1560 jsobj.AddProperty("mirrorReferent", referent_handle); 1574 jsobj.AddProperty("mirrorReferent", referent_handle);
1561 } 1575 }
1562 1576
1563 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 1577 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
1564 Instance::PrintJSONImpl(stream, ref); 1578 Instance::PrintJSONImpl(stream, ref);
1565 } 1579 }
1566 1580
1567 #endif 1581 #endif
1568 1582
1569 } // namespace dart 1583 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698