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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 DCHECK(source_shared->code()->gc_metadata() == NULL); | 264 DCHECK(source_shared->code()->gc_metadata() == NULL); |
265 target_shared->set_dont_flush(true); | 265 target_shared->set_dont_flush(true); |
266 source_shared->set_dont_flush(true); | 266 source_shared->set_dont_flush(true); |
267 | 267 |
268 // Set the code, scope info, formal parameter count, and the length | 268 // Set the code, scope info, formal parameter count, and the length |
269 // of the target shared function info. | 269 // of the target shared function info. |
270 target_shared->ReplaceCode(source_shared->code()); | 270 target_shared->ReplaceCode(source_shared->code()); |
271 target_shared->set_scope_info(source_shared->scope_info()); | 271 target_shared->set_scope_info(source_shared->scope_info()); |
272 target_shared->set_length(source_shared->length()); | 272 target_shared->set_length(source_shared->length()); |
273 target_shared->set_feedback_vector(source_shared->feedback_vector()); | 273 target_shared->set_feedback_vector(source_shared->feedback_vector()); |
274 target_shared->set_internal_formal_parameter_count( | 274 target_shared->set_formal_parameter_count( |
275 source_shared->internal_formal_parameter_count()); | 275 source_shared->formal_parameter_count()); |
276 target_shared->set_script(source_shared->script()); | 276 target_shared->set_script(source_shared->script()); |
277 target_shared->set_start_position_and_type( | 277 target_shared->set_start_position_and_type( |
278 source_shared->start_position_and_type()); | 278 source_shared->start_position_and_type()); |
279 target_shared->set_end_position(source_shared->end_position()); | 279 target_shared->set_end_position(source_shared->end_position()); |
280 bool was_native = target_shared->native(); | 280 bool was_native = target_shared->native(); |
281 target_shared->set_compiler_hints(source_shared->compiler_hints()); | 281 target_shared->set_compiler_hints(source_shared->compiler_hints()); |
282 target_shared->set_native(was_native); | 282 target_shared->set_native(was_native); |
283 target_shared->set_profiler_ticks(source_shared->profiler_ticks()); | 283 target_shared->set_profiler_ticks(source_shared->profiler_ticks()); |
284 | 284 |
285 // Set the code of the target function. | 285 // Set the code of the target function. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // Find frame containing arguments passed to the caller. | 376 // Find frame containing arguments passed to the caller. |
377 JavaScriptFrameIterator it(isolate); | 377 JavaScriptFrameIterator it(isolate); |
378 JavaScriptFrame* frame = it.frame(); | 378 JavaScriptFrame* frame = it.frame(); |
379 List<JSFunction*> functions(2); | 379 List<JSFunction*> functions(2); |
380 frame->GetFunctions(&functions); | 380 frame->GetFunctions(&functions); |
381 if (functions.length() > 1) { | 381 if (functions.length() > 1) { |
382 int inlined_jsframe_index = functions.length() - 1; | 382 int inlined_jsframe_index = functions.length() - 1; |
383 JSFunction* inlined_function = functions[inlined_jsframe_index]; | 383 JSFunction* inlined_function = functions[inlined_jsframe_index]; |
384 SlotRefValueBuilder slot_refs( | 384 SlotRefValueBuilder slot_refs( |
385 frame, inlined_jsframe_index, | 385 frame, inlined_jsframe_index, |
386 inlined_function->shared()->internal_formal_parameter_count()); | 386 inlined_function->shared()->formal_parameter_count()); |
387 | 387 |
388 int args_count = slot_refs.args_length(); | 388 int args_count = slot_refs.args_length(); |
389 | 389 |
390 *total_argc = prefix_argc + args_count; | 390 *total_argc = prefix_argc + args_count; |
391 SmartArrayPointer<Handle<Object> > param_data( | 391 SmartArrayPointer<Handle<Object> > param_data( |
392 NewArray<Handle<Object> >(*total_argc)); | 392 NewArray<Handle<Object> >(*total_argc)); |
393 slot_refs.Prepare(isolate); | 393 slot_refs.Prepare(isolate); |
394 for (int i = 0; i < args_count; i++) { | 394 for (int i = 0; i < args_count; i++) { |
395 Handle<Object> val = slot_refs.GetNext(isolate, 0); | 395 Handle<Object> val = slot_refs.GetNext(isolate, 0); |
396 param_data[prefix_argc + i] = val; | 396 param_data[prefix_argc + i] = val; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 | 643 |
644 | 644 |
645 RUNTIME_FUNCTION(RuntimeReference_IsFunction) { | 645 RUNTIME_FUNCTION(RuntimeReference_IsFunction) { |
646 SealHandleScope shs(isolate); | 646 SealHandleScope shs(isolate); |
647 DCHECK(args.length() == 1); | 647 DCHECK(args.length() == 1); |
648 CONVERT_ARG_CHECKED(Object, obj, 0); | 648 CONVERT_ARG_CHECKED(Object, obj, 0); |
649 return isolate->heap()->ToBoolean(obj->IsJSFunction()); | 649 return isolate->heap()->ToBoolean(obj->IsJSFunction()); |
650 } | 650 } |
651 } | 651 } |
652 } // namespace v8::internal | 652 } // namespace v8::internal |
OLD | NEW |