| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 mov(ebx, Immediate(ext)); | 1417 mov(ebx, Immediate(ext)); |
| 1418 CEntryStub ces(1); | 1418 CEntryStub ces(1); |
| 1419 return TryTailCallStub(&ces); | 1419 return TryTailCallStub(&ces); |
| 1420 } | 1420 } |
| 1421 | 1421 |
| 1422 | 1422 |
| 1423 void MacroAssembler::InvokePrologue(const ParameterCount& expected, | 1423 void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
| 1424 const ParameterCount& actual, | 1424 const ParameterCount& actual, |
| 1425 Handle<Code> code_constant, | 1425 Handle<Code> code_constant, |
| 1426 const Operand& code_operand, | 1426 const Operand& code_operand, |
| 1427 Label* done, | 1427 NearLabel* done, |
| 1428 InvokeFlag flag, | 1428 InvokeFlag flag, |
| 1429 PostCallGenerator* post_call_generator) { | 1429 PostCallGenerator* post_call_generator) { |
| 1430 bool definitely_matches = false; | 1430 bool definitely_matches = false; |
| 1431 Label invoke; | 1431 Label invoke; |
| 1432 if (expected.is_immediate()) { | 1432 if (expected.is_immediate()) { |
| 1433 ASSERT(actual.is_immediate()); | 1433 ASSERT(actual.is_immediate()); |
| 1434 if (expected.immediate() == actual.immediate()) { | 1434 if (expected.immediate() == actual.immediate()) { |
| 1435 definitely_matches = true; | 1435 definitely_matches = true; |
| 1436 } else { | 1436 } else { |
| 1437 mov(eax, actual.immediate()); | 1437 mov(eax, actual.immediate()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 bind(&invoke); | 1485 bind(&invoke); |
| 1486 } | 1486 } |
| 1487 } | 1487 } |
| 1488 | 1488 |
| 1489 | 1489 |
| 1490 void MacroAssembler::InvokeCode(const Operand& code, | 1490 void MacroAssembler::InvokeCode(const Operand& code, |
| 1491 const ParameterCount& expected, | 1491 const ParameterCount& expected, |
| 1492 const ParameterCount& actual, | 1492 const ParameterCount& actual, |
| 1493 InvokeFlag flag, | 1493 InvokeFlag flag, |
| 1494 PostCallGenerator* post_call_generator) { | 1494 PostCallGenerator* post_call_generator) { |
| 1495 Label done; | 1495 NearLabel done; |
| 1496 InvokePrologue(expected, actual, Handle<Code>::null(), code, | 1496 InvokePrologue(expected, actual, Handle<Code>::null(), code, |
| 1497 &done, flag, post_call_generator); | 1497 &done, flag, post_call_generator); |
| 1498 if (flag == CALL_FUNCTION) { | 1498 if (flag == CALL_FUNCTION) { |
| 1499 call(code); | 1499 call(code); |
| 1500 if (post_call_generator != NULL) post_call_generator->Generate(); | 1500 if (post_call_generator != NULL) post_call_generator->Generate(); |
| 1501 } else { | 1501 } else { |
| 1502 ASSERT(flag == JUMP_FUNCTION); | 1502 ASSERT(flag == JUMP_FUNCTION); |
| 1503 jmp(code); | 1503 jmp(code); |
| 1504 } | 1504 } |
| 1505 bind(&done); | 1505 bind(&done); |
| 1506 } | 1506 } |
| 1507 | 1507 |
| 1508 | 1508 |
| 1509 void MacroAssembler::InvokeCode(Handle<Code> code, | 1509 void MacroAssembler::InvokeCode(Handle<Code> code, |
| 1510 const ParameterCount& expected, | 1510 const ParameterCount& expected, |
| 1511 const ParameterCount& actual, | 1511 const ParameterCount& actual, |
| 1512 RelocInfo::Mode rmode, | 1512 RelocInfo::Mode rmode, |
| 1513 InvokeFlag flag, | 1513 InvokeFlag flag, |
| 1514 PostCallGenerator* post_call_generator) { | 1514 PostCallGenerator* post_call_generator) { |
| 1515 Label done; | 1515 NearLabel done; |
| 1516 Operand dummy(eax); | 1516 Operand dummy(eax); |
| 1517 InvokePrologue(expected, actual, code, dummy, &done, | 1517 InvokePrologue(expected, actual, code, dummy, &done, |
| 1518 flag, post_call_generator); | 1518 flag, post_call_generator); |
| 1519 if (flag == CALL_FUNCTION) { | 1519 if (flag == CALL_FUNCTION) { |
| 1520 call(code, rmode); | 1520 call(code, rmode); |
| 1521 if (post_call_generator != NULL) post_call_generator->Generate(); | 1521 if (post_call_generator != NULL) post_call_generator->Generate(); |
| 1522 } else { | 1522 } else { |
| 1523 ASSERT(flag == JUMP_FUNCTION); | 1523 ASSERT(flag == JUMP_FUNCTION); |
| 1524 jmp(code, rmode); | 1524 jmp(code, rmode); |
| 1525 } | 1525 } |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 | 2022 |
| 2023 // Check that the code was patched as expected. | 2023 // Check that the code was patched as expected. |
| 2024 ASSERT(masm_.pc_ == address_ + size_); | 2024 ASSERT(masm_.pc_ == address_ + size_); |
| 2025 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2025 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 | 2028 |
| 2029 } } // namespace v8::internal | 2029 } } // namespace v8::internal |
| 2030 | 2030 |
| 2031 #endif // V8_TARGET_ARCH_IA32 | 2031 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |