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 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 function->shared()->set_native(true); | 2430 function->shared()->set_native(true); |
2431 native_context()->set(Context::REGEXP_INTERNAL_MATCH, *function); | 2431 native_context()->set(Context::REGEXP_INTERNAL_MATCH, *function); |
2432 } | 2432 } |
2433 | 2433 |
2434 // Create the last match info. One for external use, and one for internal | 2434 // Create the last match info. One for external use, and one for internal |
2435 // use when we don't want to modify the externally visible match info. | 2435 // use when we don't want to modify the externally visible match info. |
2436 Handle<RegExpMatchInfo> last_match_info = factory->NewRegExpMatchInfo(); | 2436 Handle<RegExpMatchInfo> last_match_info = factory->NewRegExpMatchInfo(); |
2437 native_context()->set_regexp_last_match_info(*last_match_info); | 2437 native_context()->set_regexp_last_match_info(*last_match_info); |
2438 Handle<RegExpMatchInfo> internal_match_info = factory->NewRegExpMatchInfo(); | 2438 Handle<RegExpMatchInfo> internal_match_info = factory->NewRegExpMatchInfo(); |
2439 native_context()->set_regexp_internal_match_info(*internal_match_info); | 2439 native_context()->set_regexp_internal_match_info(*internal_match_info); |
| 2440 |
| 2441 // Force the RegExp constructor to fast properties, so that we can use the |
| 2442 // fast paths for various things like |
| 2443 // |
| 2444 // x instanceof RegExp |
| 2445 // |
| 2446 // etc. We should probably come up with a more principled approach once |
| 2447 // the JavaScript builtins are gone. |
| 2448 JSObject::MigrateSlowToFast(regexp_fun, 0, "Bootstrapping"); |
2440 } | 2449 } |
2441 | 2450 |
2442 { // -- E r r o r | 2451 { // -- E r r o r |
2443 InstallError(isolate, global, factory->Error_string(), | 2452 InstallError(isolate, global, factory->Error_string(), |
2444 Context::ERROR_FUNCTION_INDEX); | 2453 Context::ERROR_FUNCTION_INDEX); |
2445 InstallMakeError(isolate, isolate->builtins()->MakeError(), | 2454 InstallMakeError(isolate, isolate->builtins()->MakeError(), |
2446 Context::MAKE_ERROR_INDEX); | 2455 Context::MAKE_ERROR_INDEX); |
2447 } | 2456 } |
2448 | 2457 |
2449 { // -- E v a l E r r o r | 2458 { // -- E v a l E r r o r |
(...skipping 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5265 } | 5274 } |
5266 | 5275 |
5267 | 5276 |
5268 // Called when the top-level V8 mutex is destroyed. | 5277 // Called when the top-level V8 mutex is destroyed. |
5269 void Bootstrapper::FreeThreadResources() { | 5278 void Bootstrapper::FreeThreadResources() { |
5270 DCHECK(!IsActive()); | 5279 DCHECK(!IsActive()); |
5271 } | 5280 } |
5272 | 5281 |
5273 } // namespace internal | 5282 } // namespace internal |
5274 } // namespace v8 | 5283 } // namespace v8 |
OLD | NEW |