| 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/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/extensions/externalize-string-extension.h" | 9 #include "src/extensions/externalize-string-extension.h" |
| 10 #include "src/extensions/free-buffer-extension.h" | 10 #include "src/extensions/free-buffer-extension.h" |
| (...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 Handle<JSObject> proto = | 1903 Handle<JSObject> proto = |
| 1904 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 1904 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 1905 | 1905 |
| 1906 // Install the call and the apply functions. | 1906 // Install the call and the apply functions. |
| 1907 Handle<JSFunction> call = | 1907 Handle<JSFunction> call = |
| 1908 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1908 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1909 MaybeHandle<JSObject>(), Builtins::kFunctionCall); | 1909 MaybeHandle<JSObject>(), Builtins::kFunctionCall); |
| 1910 Handle<JSFunction> apply = | 1910 Handle<JSFunction> apply = |
| 1911 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1911 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1912 MaybeHandle<JSObject>(), Builtins::kFunctionApply); | 1912 MaybeHandle<JSObject>(), Builtins::kFunctionApply); |
| 1913 if (FLAG_vector_ics) { |
| 1914 // Apply embeds an IC, so we need a type vector of size 1 in the shared |
| 1915 // function info. |
| 1916 Handle<FixedArray> feedback_vector = factory()->NewTypeFeedbackVector(1); |
| 1917 apply->shared()->set_feedback_vector(*feedback_vector); |
| 1918 } |
| 1913 | 1919 |
| 1914 // Make sure that Function.prototype.call appears to be compiled. | 1920 // Make sure that Function.prototype.call appears to be compiled. |
| 1915 // The code will never be called, but inline caching for call will | 1921 // The code will never be called, but inline caching for call will |
| 1916 // only work if it appears to be compiled. | 1922 // only work if it appears to be compiled. |
| 1917 call->shared()->DontAdaptArguments(); | 1923 call->shared()->DontAdaptArguments(); |
| 1918 ASSERT(call->is_compiled()); | 1924 ASSERT(call->is_compiled()); |
| 1919 | 1925 |
| 1920 // Set the expected parameters for apply to 2; required by builtin. | 1926 // Set the expected parameters for apply to 2; required by builtin. |
| 1921 apply->shared()->set_formal_parameter_count(2); | 1927 apply->shared()->set_formal_parameter_count(2); |
| 1922 | 1928 |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 return from + sizeof(NestingCounterType); | 2692 return from + sizeof(NestingCounterType); |
| 2687 } | 2693 } |
| 2688 | 2694 |
| 2689 | 2695 |
| 2690 // Called when the top-level V8 mutex is destroyed. | 2696 // Called when the top-level V8 mutex is destroyed. |
| 2691 void Bootstrapper::FreeThreadResources() { | 2697 void Bootstrapper::FreeThreadResources() { |
| 2692 ASSERT(!IsActive()); | 2698 ASSERT(!IsActive()); |
| 2693 } | 2699 } |
| 2694 | 2700 |
| 2695 } } // namespace v8::internal | 2701 } } // namespace v8::internal |
| OLD | NEW |