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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 __ push(rax); | 1509 __ push(rax); |
1510 __ CallRuntime(Runtime::kTraceExit, 1); | 1510 __ CallRuntime(Runtime::kTraceExit, 1); |
1511 } | 1511 } |
1512 __ movq(rsp, rbp); | 1512 __ movq(rsp, rbp); |
1513 __ pop(rbp); | 1513 __ pop(rbp); |
1514 __ ret((ParameterCount() + 1) * kPointerSize); | 1514 __ ret((ParameterCount() + 1) * kPointerSize); |
1515 } | 1515 } |
1516 | 1516 |
1517 | 1517 |
1518 void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) { | 1518 void LCodeGen::DoLoadGlobal(LLoadGlobal* instr) { |
1519 Abort("Unimplemented: %s", "DoLoadGlobal"); | 1519 Register result = ToRegister(instr->result()); |
| 1520 if (result.is(rax)) { |
| 1521 __ load_rax(instr->hydrogen()->cell().location(), |
| 1522 RelocInfo::GLOBAL_PROPERTY_CELL); |
| 1523 } else { |
| 1524 __ movq(result, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); |
| 1525 __ movq(result, Operand(result, 0)); |
| 1526 } |
| 1527 if (instr->hydrogen()->check_hole_value()) { |
| 1528 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 1529 DeoptimizeIf(equal, instr->environment()); |
| 1530 } |
1520 } | 1531 } |
1521 | 1532 |
1522 | 1533 |
1523 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { | 1534 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
1524 Register value = ToRegister(instr->InputAt(0)); | 1535 Register value = ToRegister(instr->InputAt(0)); |
1525 Register temp = ToRegister(instr->TempAt(0)); | 1536 Register temp = ToRegister(instr->TempAt(0)); |
1526 ASSERT(!value.is(temp)); | 1537 ASSERT(!value.is(temp)); |
1527 bool check_hole = instr->hydrogen()->check_hole_value(); | 1538 bool check_hole = instr->hydrogen()->check_hole_value(); |
1528 if (!check_hole && value.is(rax)) { | 1539 if (!check_hole && value.is(rax)) { |
1529 __ store_rax(instr->hydrogen()->cell().location(), | 1540 __ store_rax(instr->hydrogen()->cell().location(), |
1530 RelocInfo::GLOBAL_PROPERTY_CELL); | 1541 RelocInfo::GLOBAL_PROPERTY_CELL); |
1531 return; | 1542 return; |
1532 } | 1543 } |
1533 // If the cell we are storing to contains the hole it could have | 1544 // If the cell we are storing to contains the hole it could have |
1534 // been deleted from the property dictionary. In that case, we need | 1545 // been deleted from the property dictionary. In that case, we need |
1535 // to update the property details in the property dictionary to mark | 1546 // to update the property details in the property dictionary to mark |
1536 // it as no longer deleted. We deoptimize in that case. | 1547 // it as no longer deleted. We deoptimize in that case. |
1537 __ movq(temp, | 1548 __ movq(temp, instr->hydrogen()->cell(), RelocInfo::GLOBAL_PROPERTY_CELL); |
1538 Handle<Object>::cast(instr->hydrogen()->cell()), | |
1539 RelocInfo::GLOBAL_PROPERTY_CELL); | |
1540 if (check_hole) { | 1549 if (check_hole) { |
1541 __ CompareRoot(Operand(temp, 0), Heap::kTheHoleValueRootIndex); | 1550 __ CompareRoot(Operand(temp, 0), Heap::kTheHoleValueRootIndex); |
1542 DeoptimizeIf(equal, instr->environment()); | 1551 DeoptimizeIf(equal, instr->environment()); |
1543 } | 1552 } |
1544 __ movq(Operand(temp, 0), value); | 1553 __ movq(Operand(temp, 0), value); |
1545 } | 1554 } |
1546 | 1555 |
1547 | 1556 |
1548 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 1557 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
1549 Abort("Unimplemented: %s", "DoLoadContextSlot"); | 1558 Abort("Unimplemented: %s", "DoLoadContextSlot"); |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2329 | 2338 |
2330 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2339 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2331 Abort("Unimplemented: %s", "DoOsrEntry"); | 2340 Abort("Unimplemented: %s", "DoOsrEntry"); |
2332 } | 2341 } |
2333 | 2342 |
2334 #undef __ | 2343 #undef __ |
2335 | 2344 |
2336 } } // namespace v8::internal | 2345 } } // namespace v8::internal |
2337 | 2346 |
2338 #endif // V8_TARGET_ARCH_X64 | 2347 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |