Chromium Code Reviews| 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 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1656 DataDescriptor field(factory->last_index_string(), | 1656 DataDescriptor field(factory->last_index_string(), |
| 1657 JSRegExp::kLastIndexFieldIndex, writable, | 1657 JSRegExp::kLastIndexFieldIndex, writable, |
| 1658 Representation::Tagged()); | 1658 Representation::Tagged()); |
| 1659 initial_map->AppendDescriptor(&field); | 1659 initial_map->AppendDescriptor(&field); |
| 1660 | 1660 |
| 1661 static const int num_fields = JSRegExp::kInObjectFieldCount; | 1661 static const int num_fields = JSRegExp::kInObjectFieldCount; |
| 1662 initial_map->SetInObjectProperties(num_fields); | 1662 initial_map->SetInObjectProperties(num_fields); |
| 1663 initial_map->set_unused_property_fields(0); | 1663 initial_map->set_unused_property_fields(0); |
| 1664 initial_map->set_instance_size(initial_map->instance_size() + | 1664 initial_map->set_instance_size(initial_map->instance_size() + |
| 1665 num_fields * kPointerSize); | 1665 num_fields * kPointerSize); |
| 1666 | |
| 1667 { | |
| 1668 // RegExp.prototype setup. | |
| 1669 | |
| 1670 Handle<JSObject> proto = | |
| 1671 factory->NewJSObject(isolate->object_function(), TENURED); | |
| 1672 JSObject::AddProperty(proto, factory->constructor_string(), regexp_fun, | |
| 1673 DONT_ENUM); | |
| 1674 Accessors::FunctionSetPrototype(regexp_fun, proto).Assert(); | |
|
Igor Sheludko
2016/09/29 12:55:28
I think you can pass the right prototype object to
jgruber
2016/09/29 14:40:26
Done.
| |
| 1675 | |
| 1676 SimpleInstallFunction(proto, "exec", Builtins::kRegExpPrototypeExec, 1, | |
| 1677 true, DONT_ENUM); | |
| 1678 } | |
| 1666 } | 1679 } |
| 1667 | 1680 |
| 1668 { // -- E r r o r | 1681 { // -- E r r o r |
| 1669 InstallError(isolate, global, factory->Error_string(), | 1682 InstallError(isolate, global, factory->Error_string(), |
| 1670 Context::ERROR_FUNCTION_INDEX); | 1683 Context::ERROR_FUNCTION_INDEX); |
| 1671 InstallMakeError(isolate, isolate->builtins()->MakeError(), | 1684 InstallMakeError(isolate, isolate->builtins()->MakeError(), |
| 1672 Context::MAKE_ERROR_INDEX); | 1685 Context::MAKE_ERROR_INDEX); |
| 1673 } | 1686 } |
| 1674 | 1687 |
| 1675 { // -- E v a l E r r o r | 1688 { // -- E v a l E r r o r |
| (...skipping 2507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4183 } | 4196 } |
| 4184 | 4197 |
| 4185 | 4198 |
| 4186 // Called when the top-level V8 mutex is destroyed. | 4199 // Called when the top-level V8 mutex is destroyed. |
| 4187 void Bootstrapper::FreeThreadResources() { | 4200 void Bootstrapper::FreeThreadResources() { |
| 4188 DCHECK(!IsActive()); | 4201 DCHECK(!IsActive()); |
| 4189 } | 4202 } |
| 4190 | 4203 |
| 4191 } // namespace internal | 4204 } // namespace internal |
| 4192 } // namespace v8 | 4205 } // namespace v8 |
| OLD | NEW |