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

Side by Side Diff: src/bootstrapper.cc

Issue 2307863003: [regexp] Port RegExpMatch, RegExpSearch, and RegExpTest (Closed)
Patch Set: Rebase Created 4 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
« no previous file with comments | « no previous file | src/builtins/builtins.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 SimpleInstallGetter(proto, factory->sticky_string(), 1635 SimpleInstallGetter(proto, factory->sticky_string(),
1636 Builtins::kRegExpPrototypeStickyGetter, false); 1636 Builtins::kRegExpPrototypeStickyGetter, false);
1637 SimpleInstallGetter(proto, factory->unicode_string(), 1637 SimpleInstallGetter(proto, factory->unicode_string(),
1638 Builtins::kRegExpPrototypeUnicodeGetter, false); 1638 Builtins::kRegExpPrototypeUnicodeGetter, false);
1639 1639
1640 SimpleInstallFunction(proto, "compile", Builtins::kRegExpPrototypeCompile, 1640 SimpleInstallFunction(proto, "compile", Builtins::kRegExpPrototypeCompile,
1641 2, false, DONT_ENUM); 1641 2, false, DONT_ENUM);
1642 SimpleInstallFunction(proto, factory->toString_string(), 1642 SimpleInstallFunction(proto, factory->toString_string(),
1643 Builtins::kRegExpPrototypeToString, 0, false, 1643 Builtins::kRegExpPrototypeToString, 0, false,
1644 DONT_ENUM); 1644 DONT_ENUM);
1645 SimpleInstallFunction(proto, factory->exec_string(),
1646 Builtins::kRegExpPrototypeExec, 1, false,
1647 DONT_ENUM);
1648 SimpleInstallFunction(proto, "test", Builtins::kRegExpPrototypeTest, 1,
1649 false, DONT_ENUM);
1650
1651 {
1652 Handle<JSFunction> fun = SimpleCreateFunction(
1653 isolate, factory->InternalizeUtf8String("[Symbol.match]"),
1654 Builtins::kRegExpPrototypeMatch, 1, false);
1655 InstallFunction(proto, fun, factory->match_symbol(), DONT_ENUM);
1656 }
1657
1658 {
1659 Handle<JSFunction> fun = SimpleCreateFunction(
1660 isolate, factory->InternalizeUtf8String("[Symbol.search]"),
1661 Builtins::kRegExpPrototypeSearch, 1, false);
1662 InstallFunction(proto, fun, factory->search_symbol(), DONT_ENUM);
1663 }
1645 } 1664 }
1646 1665
1647 { 1666 {
1648 // RegExp getters and setters. 1667 // RegExp getters and setters.
1649 1668
1650 // TODO(jgruber): This should really be DONT_ENUM | DONT_DELETE. 1669 // TODO(jgruber): This should really be DONT_ENUM | DONT_DELETE.
1651 // However, that currently breaks layout test expectations. Note that 1670 // However, that currently breaks layout test expectations. Note that
1652 // Firefox sets a couple of these as enumerable. 1671 // Firefox sets a couple of these as enumerable.
1653 const PropertyAttributes no_enum = DONT_ENUM; 1672 const PropertyAttributes no_enum = DONT_ENUM;
1654 1673
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1714 INSTALL_CAPTURE_GETTER(3); 1733 INSTALL_CAPTURE_GETTER(3);
1715 INSTALL_CAPTURE_GETTER(4); 1734 INSTALL_CAPTURE_GETTER(4);
1716 INSTALL_CAPTURE_GETTER(5); 1735 INSTALL_CAPTURE_GETTER(5);
1717 INSTALL_CAPTURE_GETTER(6); 1736 INSTALL_CAPTURE_GETTER(6);
1718 INSTALL_CAPTURE_GETTER(7); 1737 INSTALL_CAPTURE_GETTER(7);
1719 INSTALL_CAPTURE_GETTER(8); 1738 INSTALL_CAPTURE_GETTER(8);
1720 INSTALL_CAPTURE_GETTER(9); 1739 INSTALL_CAPTURE_GETTER(9);
1721 #undef INSTALL_CAPTURE_GETTER 1740 #undef INSTALL_CAPTURE_GETTER
1722 } 1741 }
1723 1742
1724 // TODO(jgruber): shared->set_force_inline on getters.
1725
1726 DCHECK(regexp_fun->has_initial_map()); 1743 DCHECK(regexp_fun->has_initial_map());
1727 Handle<Map> initial_map(regexp_fun->initial_map()); 1744 Handle<Map> initial_map(regexp_fun->initial_map());
1728 1745
1729 DCHECK_EQ(0, initial_map->GetInObjectProperties()); 1746 DCHECK_EQ(0, initial_map->GetInObjectProperties());
1730 1747
1731 Map::EnsureDescriptorSlack(initial_map, 1); 1748 Map::EnsureDescriptorSlack(initial_map, 1);
1732 1749
1733 // ECMA-262, section 15.10.7.5. 1750 // ECMA-262, section 15.10.7.5.
1734 PropertyAttributes writable = 1751 PropertyAttributes writable =
1735 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); 1752 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
1736 DataDescriptor field(factory->last_index_string(), 1753 DataDescriptor field(factory->lastIndex_string(),
1737 JSRegExp::kLastIndexFieldIndex, writable, 1754 JSRegExp::kLastIndexFieldIndex, writable,
1738 Representation::Tagged()); 1755 Representation::Tagged());
1739 initial_map->AppendDescriptor(&field); 1756 initial_map->AppendDescriptor(&field);
1740 1757
1741 static const int num_fields = JSRegExp::kInObjectFieldCount; 1758 static const int num_fields = JSRegExp::kInObjectFieldCount;
1742 initial_map->SetInObjectProperties(num_fields); 1759 initial_map->SetInObjectProperties(num_fields);
1743 initial_map->set_unused_property_fields(0); 1760 initial_map->set_unused_property_fields(0);
1744 initial_map->set_instance_size(initial_map->instance_size() + 1761 initial_map->set_instance_size(initial_map->instance_size() +
1745 num_fields * kPointerSize); 1762 num_fields * kPointerSize);
1746 } 1763 }
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after
4232 } 4249 }
4233 4250
4234 4251
4235 // Called when the top-level V8 mutex is destroyed. 4252 // Called when the top-level V8 mutex is destroyed.
4236 void Bootstrapper::FreeThreadResources() { 4253 void Bootstrapper::FreeThreadResources() {
4237 DCHECK(!IsActive()); 4254 DCHECK(!IsActive());
4238 } 4255 }
4239 4256
4240 } // namespace internal 4257 } // namespace internal
4241 } // namespace v8 4258 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698