| 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 3487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3498 call_wrapper.AfterCall(); | 3498 call_wrapper.AfterCall(); |
| 3499 } else { | 3499 } else { |
| 3500 ASSERT(flag == JUMP_FUNCTION); | 3500 ASSERT(flag == JUMP_FUNCTION); |
| 3501 jmp(code); | 3501 jmp(code); |
| 3502 } | 3502 } |
| 3503 bind(&done); | 3503 bind(&done); |
| 3504 } | 3504 } |
| 3505 } | 3505 } |
| 3506 | 3506 |
| 3507 | 3507 |
| 3508 void MacroAssembler::InvokeCode(Handle<Code> code, | |
| 3509 const ParameterCount& expected, | |
| 3510 const ParameterCount& actual, | |
| 3511 RelocInfo::Mode rmode, | |
| 3512 InvokeFlag flag, | |
| 3513 const CallWrapper& call_wrapper) { | |
| 3514 // You can't call a function without a valid frame. | |
| 3515 ASSERT(flag == JUMP_FUNCTION || has_frame()); | |
| 3516 | |
| 3517 Label done; | |
| 3518 bool definitely_mismatches = false; | |
| 3519 Register dummy = rax; | |
| 3520 InvokePrologue(expected, | |
| 3521 actual, | |
| 3522 code, | |
| 3523 dummy, | |
| 3524 &done, | |
| 3525 &definitely_mismatches, | |
| 3526 flag, | |
| 3527 Label::kNear, | |
| 3528 call_wrapper); | |
| 3529 if (!definitely_mismatches) { | |
| 3530 if (flag == CALL_FUNCTION) { | |
| 3531 call_wrapper.BeforeCall(CallSize(code)); | |
| 3532 Call(code, rmode); | |
| 3533 call_wrapper.AfterCall(); | |
| 3534 } else { | |
| 3535 ASSERT(flag == JUMP_FUNCTION); | |
| 3536 Jump(code, rmode); | |
| 3537 } | |
| 3538 bind(&done); | |
| 3539 } | |
| 3540 } | |
| 3541 | |
| 3542 | |
| 3543 void MacroAssembler::InvokeFunction(Register function, | 3508 void MacroAssembler::InvokeFunction(Register function, |
| 3544 const ParameterCount& actual, | 3509 const ParameterCount& actual, |
| 3545 InvokeFlag flag, | 3510 InvokeFlag flag, |
| 3546 const CallWrapper& call_wrapper) { | 3511 const CallWrapper& call_wrapper) { |
| 3547 // You can't call a function without a valid frame. | 3512 // You can't call a function without a valid frame. |
| 3548 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 3513 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
| 3549 | 3514 |
| 3550 ASSERT(function.is(rdi)); | 3515 ASSERT(function.is(rdi)); |
| 3551 movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); | 3516 movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
| 3552 movq(rsi, FieldOperand(function, JSFunction::kContextOffset)); | 3517 movq(rsi, FieldOperand(function, JSFunction::kContextOffset)); |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5019 j(equal, found); | 4984 j(equal, found); |
| 5020 movq(current, FieldOperand(current, Map::kPrototypeOffset)); | 4985 movq(current, FieldOperand(current, Map::kPrototypeOffset)); |
| 5021 CompareRoot(current, Heap::kNullValueRootIndex); | 4986 CompareRoot(current, Heap::kNullValueRootIndex); |
| 5022 j(not_equal, &loop_again); | 4987 j(not_equal, &loop_again); |
| 5023 } | 4988 } |
| 5024 | 4989 |
| 5025 | 4990 |
| 5026 } } // namespace v8::internal | 4991 } } // namespace v8::internal |
| 5027 | 4992 |
| 5028 #endif // V8_TARGET_ARCH_X64 | 4993 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |