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