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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 LInstruction* instr) { | 1522 LInstruction* instr) { |
1523 // Change context if needed. | 1523 // Change context if needed. |
1524 bool change_context = | 1524 bool change_context = |
1525 (graph()->info()->closure()->context() != function->context()) || | 1525 (graph()->info()->closure()->context() != function->context()) || |
1526 scope()->contains_with() || | 1526 scope()->contains_with() || |
1527 (scope()->num_heap_slots() > 0); | 1527 (scope()->num_heap_slots() > 0); |
1528 if (change_context) { | 1528 if (change_context) { |
1529 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 1529 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
1530 } | 1530 } |
1531 | 1531 |
1532 // Set eax to arguments count if adaption is not needed. Assumes that eax | 1532 // Set rax to arguments count if adaption is not needed. Assumes that rax |
1533 // is available to write to at this point. | 1533 // is available to write to at this point. |
1534 if (!function->NeedsArgumentsAdaption()) { | 1534 if (!function->NeedsArgumentsAdaption()) { |
1535 __ Set(rax, arity); | 1535 __ Set(rax, arity); |
1536 } | 1536 } |
1537 | 1537 |
1538 LPointerMap* pointers = instr->pointer_map(); | 1538 LPointerMap* pointers = instr->pointer_map(); |
1539 RecordPosition(pointers->position()); | 1539 RecordPosition(pointers->position()); |
1540 | 1540 |
1541 // Invoke function. | 1541 // Invoke function. |
1542 if (*function == *graph()->info()->closure()) { | 1542 if (*function == *graph()->info()->closure()) { |
1543 __ CallSelf(); | 1543 __ CallSelf(); |
1544 } else { | 1544 } else { |
1545 __ call(FieldOperand(rdi, JSFunction::kCodeEntryOffset)); | 1545 __ call(FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
1546 } | 1546 } |
1547 | 1547 |
1548 // Setup deoptimization. | 1548 // Setup deoptimization. |
1549 RegisterLazyDeoptimization(instr); | 1549 RegisterLazyDeoptimization(instr); |
1550 | 1550 |
1551 // Restore context. | 1551 // Restore context. |
1552 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 1552 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
1553 } | 1553 } |
1554 | 1554 |
1555 | 1555 |
1556 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { | 1556 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { |
1557 ASSERT(ToRegister(instr->result()).is(eax)); | 1557 ASSERT(ToRegister(instr->result()).is(rax)); |
1558 __ Move(rdi, instr->function()); | 1558 __ Move(rdi, instr->function()); |
1559 CallKnownFunction(instr->function(), instr->arity(), instr); | 1559 CallKnownFunction(instr->function(), instr->arity(), instr); |
1560 } | 1560 } |
1561 | 1561 |
1562 | 1562 |
1563 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { | 1563 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { |
1564 Abort("Unimplemented: %s", "DoDeferredMathAbsTaggedHeapNumber"); | 1564 Abort("Unimplemented: %s", "DoDeferredMathAbsTaggedHeapNumber"); |
1565 } | 1565 } |
1566 | 1566 |
1567 | 1567 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2037 | 2037 |
2038 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2038 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2039 Abort("Unimplemented: %s", "DoOsrEntry"); | 2039 Abort("Unimplemented: %s", "DoOsrEntry"); |
2040 } | 2040 } |
2041 | 2041 |
2042 #undef __ | 2042 #undef __ |
2043 | 2043 |
2044 } } // namespace v8::internal | 2044 } } // namespace v8::internal |
2045 | 2045 |
2046 #endif // V8_TARGET_ARCH_X64 | 2046 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |