OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3516 } else { | 3516 } else { |
3517 ASSERT(flag == JUMP_FUNCTION); | 3517 ASSERT(flag == JUMP_FUNCTION); |
3518 SetCallKind(rcx, call_kind); | 3518 SetCallKind(rcx, call_kind); |
3519 jmp(code); | 3519 jmp(code); |
3520 } | 3520 } |
3521 bind(&done); | 3521 bind(&done); |
3522 } | 3522 } |
3523 } | 3523 } |
3524 | 3524 |
3525 | 3525 |
3526 void MacroAssembler::InvokeCode(Handle<Code> code, | |
3527 const ParameterCount& expected, | |
3528 const ParameterCount& actual, | |
3529 RelocInfo::Mode rmode, | |
3530 InvokeFlag flag, | |
3531 const CallWrapper& call_wrapper, | |
3532 CallKind call_kind) { | |
3533 // You can't call a function without a valid frame. | |
3534 ASSERT(flag == JUMP_FUNCTION || has_frame()); | |
3535 | |
3536 Label done; | |
3537 bool definitely_mismatches = false; | |
3538 Register dummy = rax; | |
3539 InvokePrologue(expected, | |
3540 actual, | |
3541 code, | |
3542 dummy, | |
3543 &done, | |
3544 &definitely_mismatches, | |
3545 flag, | |
3546 Label::kNear, | |
3547 call_wrapper, | |
3548 call_kind); | |
3549 if (!definitely_mismatches) { | |
3550 if (flag == CALL_FUNCTION) { | |
3551 call_wrapper.BeforeCall(CallSize(code)); | |
3552 SetCallKind(rcx, call_kind); | |
3553 Call(code, rmode); | |
3554 call_wrapper.AfterCall(); | |
3555 } else { | |
3556 ASSERT(flag == JUMP_FUNCTION); | |
3557 SetCallKind(rcx, call_kind); | |
3558 Jump(code, rmode); | |
3559 } | |
3560 bind(&done); | |
3561 } | |
3562 } | |
3563 | |
3564 | |
3565 void MacroAssembler::InvokeFunction(Register function, | 3526 void MacroAssembler::InvokeFunction(Register function, |
3566 const ParameterCount& actual, | 3527 const ParameterCount& actual, |
3567 InvokeFlag flag, | 3528 InvokeFlag flag, |
3568 const CallWrapper& call_wrapper, | 3529 const CallWrapper& call_wrapper, |
3569 CallKind call_kind) { | 3530 CallKind call_kind) { |
3570 // You can't call a function without a valid frame. | 3531 // You can't call a function without a valid frame. |
3571 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 3532 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
3572 | 3533 |
3573 ASSERT(function.is(rdi)); | 3534 ASSERT(function.is(rdi)); |
3574 movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); | 3535 movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5047 j(equal, found); | 5008 j(equal, found); |
5048 movq(current, FieldOperand(current, Map::kPrototypeOffset)); | 5009 movq(current, FieldOperand(current, Map::kPrototypeOffset)); |
5049 CompareRoot(current, Heap::kNullValueRootIndex); | 5010 CompareRoot(current, Heap::kNullValueRootIndex); |
5050 j(not_equal, &loop_again); | 5011 j(not_equal, &loop_again); |
5051 } | 5012 } |
5052 | 5013 |
5053 | 5014 |
5054 } } // namespace v8::internal | 5015 } } // namespace v8::internal |
5055 | 5016 |
5056 #endif // V8_TARGET_ARCH_X64 | 5017 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |