| 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 1926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1937 Handle<JSObject> proto = | 1937 Handle<JSObject> proto = |
| 1938 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 1938 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 1939 | 1939 |
| 1940 // Install the call and the apply functions. | 1940 // Install the call and the apply functions. |
| 1941 Handle<JSFunction> call = | 1941 Handle<JSFunction> call = |
| 1942 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1942 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1943 MaybeHandle<JSObject>(), Builtins::kFunctionCall); | 1943 MaybeHandle<JSObject>(), Builtins::kFunctionCall); |
| 1944 Handle<JSFunction> apply = | 1944 Handle<JSFunction> apply = |
| 1945 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1945 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 1946 MaybeHandle<JSObject>(), Builtins::kFunctionApply); | 1946 MaybeHandle<JSObject>(), Builtins::kFunctionApply); |
| 1947 if (FLAG_vector_ics) { |
| 1948 // Apply embeds an IC, so we need a type vector of size 1 in the shared |
| 1949 // function info. |
| 1950 Handle<FixedArray> feedback_vector = factory()->NewTypeFeedbackVector(1); |
| 1951 apply->shared()->set_feedback_vector(*feedback_vector); |
| 1952 } |
| 1947 | 1953 |
| 1948 // Make sure that Function.prototype.call appears to be compiled. | 1954 // Make sure that Function.prototype.call appears to be compiled. |
| 1949 // The code will never be called, but inline caching for call will | 1955 // The code will never be called, but inline caching for call will |
| 1950 // only work if it appears to be compiled. | 1956 // only work if it appears to be compiled. |
| 1951 call->shared()->DontAdaptArguments(); | 1957 call->shared()->DontAdaptArguments(); |
| 1952 ASSERT(call->is_compiled()); | 1958 ASSERT(call->is_compiled()); |
| 1953 | 1959 |
| 1954 // Set the expected parameters for apply to 2; required by builtin. | 1960 // Set the expected parameters for apply to 2; required by builtin. |
| 1955 apply->shared()->set_formal_parameter_count(2); | 1961 apply->shared()->set_formal_parameter_count(2); |
| 1956 | 1962 |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2732 return from + sizeof(NestingCounterType); | 2738 return from + sizeof(NestingCounterType); |
| 2733 } | 2739 } |
| 2734 | 2740 |
| 2735 | 2741 |
| 2736 // Called when the top-level V8 mutex is destroyed. | 2742 // Called when the top-level V8 mutex is destroyed. |
| 2737 void Bootstrapper::FreeThreadResources() { | 2743 void Bootstrapper::FreeThreadResources() { |
| 2738 ASSERT(!IsActive()); | 2744 ASSERT(!IsActive()); |
| 2739 } | 2745 } |
| 2740 | 2746 |
| 2741 } } // namespace v8::internal | 2747 } } // namespace v8::internal |
| OLD | NEW |