OLD | NEW |
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 Loading... |
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 } | 1645 } |
1649 | 1646 |
1650 { | 1647 { |
1651 // RegExp getters and setters. | 1648 // RegExp getters and setters. |
1652 | 1649 |
1653 // TODO(jgruber): This should really be DONT_ENUM | DONT_DELETE. | 1650 // TODO(jgruber): This should really be DONT_ENUM | DONT_DELETE. |
1654 // However, that currently breaks layout test expectations. Note that | 1651 // However, that currently breaks layout test expectations. Note that |
1655 // Firefox sets a couple of these as enumerable. | 1652 // Firefox sets a couple of these as enumerable. |
1656 const PropertyAttributes no_enum = DONT_ENUM; | 1653 const PropertyAttributes no_enum = DONT_ENUM; |
1657 | 1654 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1717 INSTALL_CAPTURE_GETTER(3); | 1714 INSTALL_CAPTURE_GETTER(3); |
1718 INSTALL_CAPTURE_GETTER(4); | 1715 INSTALL_CAPTURE_GETTER(4); |
1719 INSTALL_CAPTURE_GETTER(5); | 1716 INSTALL_CAPTURE_GETTER(5); |
1720 INSTALL_CAPTURE_GETTER(6); | 1717 INSTALL_CAPTURE_GETTER(6); |
1721 INSTALL_CAPTURE_GETTER(7); | 1718 INSTALL_CAPTURE_GETTER(7); |
1722 INSTALL_CAPTURE_GETTER(8); | 1719 INSTALL_CAPTURE_GETTER(8); |
1723 INSTALL_CAPTURE_GETTER(9); | 1720 INSTALL_CAPTURE_GETTER(9); |
1724 #undef INSTALL_CAPTURE_GETTER | 1721 #undef INSTALL_CAPTURE_GETTER |
1725 } | 1722 } |
1726 | 1723 |
| 1724 // TODO(jgruber): shared->set_force_inline on getters. |
| 1725 |
1727 DCHECK(regexp_fun->has_initial_map()); | 1726 DCHECK(regexp_fun->has_initial_map()); |
1728 Handle<Map> initial_map(regexp_fun->initial_map()); | 1727 Handle<Map> initial_map(regexp_fun->initial_map()); |
1729 | 1728 |
1730 DCHECK_EQ(0, initial_map->GetInObjectProperties()); | 1729 DCHECK_EQ(0, initial_map->GetInObjectProperties()); |
1731 | 1730 |
1732 Map::EnsureDescriptorSlack(initial_map, 1); | 1731 Map::EnsureDescriptorSlack(initial_map, 1); |
1733 | 1732 |
1734 // ECMA-262, section 15.10.7.5. | 1733 // ECMA-262, section 15.10.7.5. |
1735 PropertyAttributes writable = | 1734 PropertyAttributes writable = |
1736 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); | 1735 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); |
1737 DataDescriptor field(factory->lastIndex_string(), | 1736 DataDescriptor field(factory->last_index_string(), |
1738 JSRegExp::kLastIndexFieldIndex, writable, | 1737 JSRegExp::kLastIndexFieldIndex, writable, |
1739 Representation::Tagged()); | 1738 Representation::Tagged()); |
1740 initial_map->AppendDescriptor(&field); | 1739 initial_map->AppendDescriptor(&field); |
1741 | 1740 |
1742 static const int num_fields = JSRegExp::kInObjectFieldCount; | 1741 static const int num_fields = JSRegExp::kInObjectFieldCount; |
1743 initial_map->SetInObjectProperties(num_fields); | 1742 initial_map->SetInObjectProperties(num_fields); |
1744 initial_map->set_unused_property_fields(0); | 1743 initial_map->set_unused_property_fields(0); |
1745 initial_map->set_instance_size(initial_map->instance_size() + | 1744 initial_map->set_instance_size(initial_map->instance_size() + |
1746 num_fields * kPointerSize); | 1745 num_fields * kPointerSize); |
1747 } | 1746 } |
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4233 } | 4232 } |
4234 | 4233 |
4235 | 4234 |
4236 // Called when the top-level V8 mutex is destroyed. | 4235 // Called when the top-level V8 mutex is destroyed. |
4237 void Bootstrapper::FreeThreadResources() { | 4236 void Bootstrapper::FreeThreadResources() { |
4238 DCHECK(!IsActive()); | 4237 DCHECK(!IsActive()); |
4239 } | 4238 } |
4240 | 4239 |
4241 } // namespace internal | 4240 } // namespace internal |
4242 } // namespace v8 | 4241 } // namespace v8 |
OLD | NEW |