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/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1796 #undef EXPORT_PRIVATE_SYMBOL | 1796 #undef EXPORT_PRIVATE_SYMBOL |
| 1797 | 1797 |
| 1798 #define EXPORT_PUBLIC_SYMBOL(NAME, DESCRIPTION) \ | 1798 #define EXPORT_PUBLIC_SYMBOL(NAME, DESCRIPTION) \ |
| 1799 Handle<String> NAME##_name = \ | 1799 Handle<String> NAME##_name = \ |
| 1800 isolate->factory()->NewStringFromAsciiChecked(#NAME); \ | 1800 isolate->factory()->NewStringFromAsciiChecked(#NAME); \ |
| 1801 JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \ | 1801 JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \ |
| 1802 NONE); | 1802 NONE); |
| 1803 PUBLIC_SYMBOL_LIST(EXPORT_PUBLIC_SYMBOL) | 1803 PUBLIC_SYMBOL_LIST(EXPORT_PUBLIC_SYMBOL) |
| 1804 #undef EXPORT_PUBLIC_SYMBOL | 1804 #undef EXPORT_PUBLIC_SYMBOL |
| 1805 | 1805 |
| 1806 Handle<JSFunction> apply = InstallFunction( | 1806 { |
| 1807 container, "reflect_apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1807 Handle<JSFunction> apply = InstallFunction( |
| 1808 MaybeHandle<JSObject>(), Builtins::kReflectApply); | 1808 container, "reflect_apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1809 apply->shared()->set_internal_formal_parameter_count(3); | 1809 MaybeHandle<JSObject>(), Builtins::kReflectApply); |
| 1810 apply->shared()->set_length(3); | 1810 apply->shared()->set_internal_formal_parameter_count(3); |
| 1811 apply->shared()->set_feedback_vector( | 1811 apply->shared()->set_length(3); |
| 1812 *TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate)); | 1812 Handle<TypeFeedbackVector> feedback_vector = |
|
Michael Starzinger
2015/10/01 17:37:48
Holy sh*t, GCMole didn't find this, that is concer
Benedikt Meurer
2015/10/01 17:52:23
Good point. Can you look into this Michi?
| |
| 1813 isolate->native_context()->set_reflect_apply(*apply); | 1813 TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate); |
| 1814 apply->shared()->set_feedback_vector(*feedback_vector); | |
| 1815 isolate->native_context()->set_reflect_apply(*apply); | |
| 1816 } | |
| 1814 | 1817 |
| 1815 Handle<JSFunction> construct = InstallFunction( | 1818 { |
| 1816 container, "reflect_construct", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1819 Handle<JSFunction> construct = InstallFunction( |
| 1817 MaybeHandle<JSObject>(), Builtins::kReflectConstruct); | 1820 container, "reflect_construct", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1818 construct->shared()->set_internal_formal_parameter_count(3); | 1821 MaybeHandle<JSObject>(), Builtins::kReflectConstruct); |
| 1819 construct->shared()->set_length(2); | 1822 construct->shared()->set_internal_formal_parameter_count(3); |
| 1820 construct->shared()->set_feedback_vector( | 1823 construct->shared()->set_length(2); |
| 1821 *TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate)); | 1824 Handle<TypeFeedbackVector> feedback_vector = |
| 1822 isolate->native_context()->set_reflect_construct(*construct); | 1825 TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate); |
| 1826 construct->shared()->set_feedback_vector(*feedback_vector); | |
| 1827 isolate->native_context()->set_reflect_construct(*construct); | |
| 1828 } | |
| 1823 } | 1829 } |
| 1824 | 1830 |
| 1825 | 1831 |
| 1826 void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate, | 1832 void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate, |
| 1827 Handle<JSObject> container) { | 1833 Handle<JSObject> container) { |
| 1828 HandleScope scope(isolate); | 1834 HandleScope scope(isolate); |
| 1829 | 1835 |
| 1830 #define INITIALIZE_FLAG(FLAG) \ | 1836 #define INITIALIZE_FLAG(FLAG) \ |
| 1831 { \ | 1837 { \ |
| 1832 Handle<String> name = \ | 1838 Handle<String> name = \ |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2414 Handle<JSObject> proto = | 2420 Handle<JSObject> proto = |
| 2415 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 2421 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 2416 | 2422 |
| 2417 // Install the call and the apply functions. | 2423 // Install the call and the apply functions. |
| 2418 Handle<JSFunction> call = | 2424 Handle<JSFunction> call = |
| 2419 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 2425 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 2420 MaybeHandle<JSObject>(), Builtins::kFunctionCall); | 2426 MaybeHandle<JSObject>(), Builtins::kFunctionCall); |
| 2421 Handle<JSFunction> apply = | 2427 Handle<JSFunction> apply = |
| 2422 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 2428 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 2423 MaybeHandle<JSObject>(), Builtins::kFunctionApply); | 2429 MaybeHandle<JSObject>(), Builtins::kFunctionApply); |
| 2424 apply->shared()->set_feedback_vector( | 2430 Handle<TypeFeedbackVector> feedback_vector = |
| 2425 *TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate())); | 2431 TypeFeedbackVector::CreatePushAppliedArgumentsVector(isolate()); |
| 2432 apply->shared()->set_feedback_vector(*feedback_vector); | |
| 2426 | 2433 |
| 2427 // Make sure that Function.prototype.call appears to be compiled. | 2434 // Make sure that Function.prototype.call appears to be compiled. |
| 2428 // The code will never be called, but inline caching for call will | 2435 // The code will never be called, but inline caching for call will |
| 2429 // only work if it appears to be compiled. | 2436 // only work if it appears to be compiled. |
| 2430 call->shared()->DontAdaptArguments(); | 2437 call->shared()->DontAdaptArguments(); |
| 2431 DCHECK(call->is_compiled()); | 2438 DCHECK(call->is_compiled()); |
| 2432 | 2439 |
| 2433 // Set the expected parameters for apply to 2; required by builtin. | 2440 // Set the expected parameters for apply to 2; required by builtin. |
| 2434 apply->shared()->set_internal_formal_parameter_count(2); | 2441 apply->shared()->set_internal_formal_parameter_count(2); |
| 2435 | 2442 |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3264 } | 3271 } |
| 3265 | 3272 |
| 3266 | 3273 |
| 3267 // Called when the top-level V8 mutex is destroyed. | 3274 // Called when the top-level V8 mutex is destroyed. |
| 3268 void Bootstrapper::FreeThreadResources() { | 3275 void Bootstrapper::FreeThreadResources() { |
| 3269 DCHECK(!IsActive()); | 3276 DCHECK(!IsActive()); |
| 3270 } | 3277 } |
| 3271 | 3278 |
| 3272 } // namespace internal | 3279 } // namespace internal |
| 3273 } // namespace v8 | 3280 } // namespace v8 |
| OLD | NEW |