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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2031 // Install the call and the apply functions. | 2031 // Install the call and the apply functions. |
2032 Handle<JSFunction> call = | 2032 Handle<JSFunction> call = |
2033 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 2033 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
2034 MaybeHandle<JSObject>(), Builtins::kFunctionCall); | 2034 MaybeHandle<JSObject>(), Builtins::kFunctionCall); |
2035 Handle<JSFunction> apply = | 2035 Handle<JSFunction> apply = |
2036 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 2036 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
2037 MaybeHandle<JSObject>(), Builtins::kFunctionApply); | 2037 MaybeHandle<JSObject>(), Builtins::kFunctionApply); |
2038 if (FLAG_vector_ics) { | 2038 if (FLAG_vector_ics) { |
2039 // Apply embeds an IC, so we need a type vector of size 1 in the shared | 2039 // Apply embeds an IC, so we need a type vector of size 1 in the shared |
2040 // function info. | 2040 // function info. |
| 2041 FeedbackVectorSpec spec(0, 1); |
| 2042 spec.SetKind(0, Code::CALL_IC); |
2041 Handle<TypeFeedbackVector> feedback_vector = | 2043 Handle<TypeFeedbackVector> feedback_vector = |
2042 factory()->NewTypeFeedbackVector(0, 1); | 2044 factory()->NewTypeFeedbackVector(spec); |
2043 apply->shared()->set_feedback_vector(*feedback_vector); | 2045 apply->shared()->set_feedback_vector(*feedback_vector); |
2044 } | 2046 } |
2045 | 2047 |
2046 // Make sure that Function.prototype.call appears to be compiled. | 2048 // Make sure that Function.prototype.call appears to be compiled. |
2047 // The code will never be called, but inline caching for call will | 2049 // The code will never be called, but inline caching for call will |
2048 // only work if it appears to be compiled. | 2050 // only work if it appears to be compiled. |
2049 call->shared()->DontAdaptArguments(); | 2051 call->shared()->DontAdaptArguments(); |
2050 DCHECK(call->is_compiled()); | 2052 DCHECK(call->is_compiled()); |
2051 | 2053 |
2052 // Set the expected parameters for apply to 2; required by builtin. | 2054 // Set the expected parameters for apply to 2; required by builtin. |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2832 return from + sizeof(NestingCounterType); | 2834 return from + sizeof(NestingCounterType); |
2833 } | 2835 } |
2834 | 2836 |
2835 | 2837 |
2836 // Called when the top-level V8 mutex is destroyed. | 2838 // Called when the top-level V8 mutex is destroyed. |
2837 void Bootstrapper::FreeThreadResources() { | 2839 void Bootstrapper::FreeThreadResources() { |
2838 DCHECK(!IsActive()); | 2840 DCHECK(!IsActive()); |
2839 } | 2841 } |
2840 | 2842 |
2841 } } // namespace v8::internal | 2843 } } // namespace v8::internal |
OLD | NEW |