| 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/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
| (...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 // Install the call and the apply functions. | 2136 // Install the call and the apply functions. |
| 2137 Handle<JSFunction> call = | 2137 Handle<JSFunction> call = |
| 2138 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 2138 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 2139 MaybeHandle<JSObject>(), Builtins::kFunctionCall); | 2139 MaybeHandle<JSObject>(), Builtins::kFunctionCall); |
| 2140 Handle<JSFunction> apply = | 2140 Handle<JSFunction> apply = |
| 2141 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 2141 InstallFunction(proto, "apply", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| 2142 MaybeHandle<JSObject>(), Builtins::kFunctionApply); | 2142 MaybeHandle<JSObject>(), Builtins::kFunctionApply); |
| 2143 if (FLAG_vector_ics) { | 2143 if (FLAG_vector_ics) { |
| 2144 // Apply embeds an IC, so we need a type vector of size 1 in the shared | 2144 // Apply embeds an IC, so we need a type vector of size 1 in the shared |
| 2145 // function info. | 2145 // function info. |
| 2146 FeedbackVectorSpec spec(0, 1); | 2146 FeedbackVectorSpec spec(0, Code::CALL_IC); |
| 2147 spec.SetKind(0, Code::CALL_IC); | |
| 2148 Handle<TypeFeedbackVector> feedback_vector = | 2147 Handle<TypeFeedbackVector> feedback_vector = |
| 2149 factory()->NewTypeFeedbackVector(spec); | 2148 factory()->NewTypeFeedbackVector(&spec); |
| 2150 apply->shared()->set_feedback_vector(*feedback_vector); | 2149 apply->shared()->set_feedback_vector(*feedback_vector); |
| 2151 } | 2150 } |
| 2152 | 2151 |
| 2153 // Make sure that Function.prototype.call appears to be compiled. | 2152 // Make sure that Function.prototype.call appears to be compiled. |
| 2154 // The code will never be called, but inline caching for call will | 2153 // The code will never be called, but inline caching for call will |
| 2155 // only work if it appears to be compiled. | 2154 // only work if it appears to be compiled. |
| 2156 call->shared()->DontAdaptArguments(); | 2155 call->shared()->DontAdaptArguments(); |
| 2157 DCHECK(call->is_compiled()); | 2156 DCHECK(call->is_compiled()); |
| 2158 | 2157 |
| 2159 // Set the expected parameters for apply to 2; required by builtin. | 2158 // Set the expected parameters for apply to 2; required by builtin. |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2919 return from + sizeof(NestingCounterType); | 2918 return from + sizeof(NestingCounterType); |
| 2920 } | 2919 } |
| 2921 | 2920 |
| 2922 | 2921 |
| 2923 // Called when the top-level V8 mutex is destroyed. | 2922 // Called when the top-level V8 mutex is destroyed. |
| 2924 void Bootstrapper::FreeThreadResources() { | 2923 void Bootstrapper::FreeThreadResources() { |
| 2925 DCHECK(!IsActive()); | 2924 DCHECK(!IsActive()); |
| 2926 } | 2925 } |
| 2927 | 2926 |
| 2928 } } // namespace v8::internal | 2927 } } // namespace v8::internal |
| OLD | NEW |