Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 6312186: X64: Add Crankshaft operation LoadGlobal. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-x64
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698