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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) { | 196 RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) { |
197 HandleScope scope(isolate); | 197 HandleScope scope(isolate); |
198 DCHECK(args.length() == 1); | 198 DCHECK(args.length() == 1); |
199 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 199 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
200 Handle<Code> caller_code(function->shared()->code()); | 200 Handle<Code> caller_code(function->shared()->code()); |
201 | 201 |
202 // We're not prepared to handle a function with arguments object. | 202 // We're not prepared to handle a function with arguments object. |
203 DCHECK(!function->shared()->uses_arguments()); | 203 DCHECK(!function->shared()->uses_arguments()); |
204 | 204 |
205 RUNTIME_ASSERT(FLAG_use_osr); | 205 CHECK(FLAG_use_osr); |
206 | 206 |
207 // Passing the PC in the javascript frame from the caller directly is | 207 // Passing the PC in the javascript frame from the caller directly is |
208 // not GC safe, so we walk the stack to get it. | 208 // not GC safe, so we walk the stack to get it. |
209 JavaScriptFrameIterator it(isolate); | 209 JavaScriptFrameIterator it(isolate); |
210 JavaScriptFrame* frame = it.frame(); | 210 JavaScriptFrame* frame = it.frame(); |
211 if (!caller_code->contains(frame->pc())) { | 211 if (!caller_code->contains(frame->pc())) { |
212 // Code on the stack may not be the code object referenced by the shared | 212 // Code on the stack may not be the code object referenced by the shared |
213 // function info. It may have been replaced to include deoptimization data. | 213 // function info. It may have been replaced to include deoptimization data. |
214 caller_code = Handle<Code>(frame->LookupCode()); | 214 caller_code = Handle<Code>(frame->LookupCode()); |
215 } | 215 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 DCHECK(is_valid_language_mode(args.smi_at(3))); | 370 DCHECK(is_valid_language_mode(args.smi_at(3))); |
371 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 371 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
372 DCHECK(args[4]->IsSmi()); | 372 DCHECK(args[4]->IsSmi()); |
373 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 373 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
374 isolate); | 374 isolate); |
375 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 375 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
376 language_mode, args.smi_at(4), args.smi_at(5)); | 376 language_mode, args.smi_at(4), args.smi_at(5)); |
377 } | 377 } |
378 } // namespace internal | 378 } // namespace internal |
379 } // namespace v8 | 379 } // namespace v8 |
OLD | NEW |