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

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

Issue 151163005: A64: Synchronize with r16356. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 LOperand* right = instr->right(); 1780 LOperand* right = instr->right();
1781 ASSERT(left->Equals(instr->result())); 1781 ASSERT(left->Equals(instr->result()));
1782 ASSERT(left->IsRegister()); 1782 ASSERT(left->IsRegister());
1783 if (right->IsRegister()) { 1783 if (right->IsRegister()) {
1784 ASSERT(ToRegister(right).is(ecx)); 1784 ASSERT(ToRegister(right).is(ecx));
1785 1785
1786 switch (instr->op()) { 1786 switch (instr->op()) {
1787 case Token::ROR: 1787 case Token::ROR:
1788 __ ror_cl(ToRegister(left)); 1788 __ ror_cl(ToRegister(left));
1789 if (instr->can_deopt()) { 1789 if (instr->can_deopt()) {
1790 __ test(ToRegister(left), Immediate(0x80000000)); 1790 __ test(ToRegister(left), ToRegister(left));
1791 DeoptimizeIf(not_zero, instr->environment()); 1791 DeoptimizeIf(sign, instr->environment());
1792 } 1792 }
1793 break; 1793 break;
1794 case Token::SAR: 1794 case Token::SAR:
1795 __ sar_cl(ToRegister(left)); 1795 __ sar_cl(ToRegister(left));
1796 break; 1796 break;
1797 case Token::SHR: 1797 case Token::SHR:
1798 __ shr_cl(ToRegister(left)); 1798 __ shr_cl(ToRegister(left));
1799 if (instr->can_deopt()) { 1799 if (instr->can_deopt()) {
1800 __ test(ToRegister(left), Immediate(0x80000000)); 1800 __ test(ToRegister(left), ToRegister(left));
1801 DeoptimizeIf(not_zero, instr->environment()); 1801 DeoptimizeIf(sign, instr->environment());
1802 } 1802 }
1803 break; 1803 break;
1804 case Token::SHL: 1804 case Token::SHL:
1805 __ shl_cl(ToRegister(left)); 1805 __ shl_cl(ToRegister(left));
1806 break; 1806 break;
1807 default: 1807 default:
1808 UNREACHABLE(); 1808 UNREACHABLE();
1809 break; 1809 break;
1810 } 1810 }
1811 } else { 1811 } else {
1812 int value = ToInteger32(LConstantOperand::cast(right)); 1812 int value = ToInteger32(LConstantOperand::cast(right));
1813 uint8_t shift_count = static_cast<uint8_t>(value & 0x1F); 1813 uint8_t shift_count = static_cast<uint8_t>(value & 0x1F);
1814 switch (instr->op()) { 1814 switch (instr->op()) {
1815 case Token::ROR: 1815 case Token::ROR:
1816 if (shift_count == 0 && instr->can_deopt()) { 1816 if (shift_count == 0 && instr->can_deopt()) {
1817 __ test(ToRegister(left), Immediate(0x80000000)); 1817 __ test(ToRegister(left), ToRegister(left));
1818 DeoptimizeIf(not_zero, instr->environment()); 1818 DeoptimizeIf(sign, instr->environment());
1819 } else { 1819 } else {
1820 __ ror(ToRegister(left), shift_count); 1820 __ ror(ToRegister(left), shift_count);
1821 } 1821 }
1822 break; 1822 break;
1823 case Token::SAR: 1823 case Token::SAR:
1824 if (shift_count != 0) { 1824 if (shift_count != 0) {
1825 __ sar(ToRegister(left), shift_count); 1825 __ sar(ToRegister(left), shift_count);
1826 } 1826 }
1827 break; 1827 break;
1828 case Token::SHR: 1828 case Token::SHR:
1829 if (shift_count == 0 && instr->can_deopt()) { 1829 if (shift_count == 0 && instr->can_deopt()) {
1830 __ test(ToRegister(left), Immediate(0x80000000)); 1830 __ test(ToRegister(left), ToRegister(left));
1831 DeoptimizeIf(not_zero, instr->environment()); 1831 DeoptimizeIf(sign, instr->environment());
1832 } else { 1832 } else {
1833 __ shr(ToRegister(left), shift_count); 1833 __ shr(ToRegister(left), shift_count);
1834 } 1834 }
1835 break; 1835 break;
1836 case Token::SHL: 1836 case Token::SHL:
1837 if (shift_count != 0) { 1837 if (shift_count != 0) {
1838 if (instr->hydrogen_value()->representation().IsSmi() && 1838 if (instr->hydrogen_value()->representation().IsSmi() &&
1839 instr->can_deopt()) { 1839 instr->can_deopt()) {
1840 if (shift_count != 1) { 1840 if (shift_count != 1) {
1841 __ shl(ToRegister(left), shift_count - 1); 1841 __ shl(ToRegister(left), shift_count - 1);
(...skipping 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after
4342 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4342 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4343 } 4343 }
4344 } 4344 }
4345 4345
4346 4346
4347 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 4347 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4348 CallRuntime(instr->function(), instr->arity(), instr); 4348 CallRuntime(instr->function(), instr->arity(), instr);
4349 } 4349 }
4350 4350
4351 4351
4352 void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) {
4353 Register function = ToRegister(instr->function());
4354 Register code_object = ToRegister(instr->code_object());
4355 __ lea(code_object, FieldOperand(code_object, Code::kHeaderSize));
4356 __ mov(FieldOperand(function, JSFunction::kCodeEntryOffset), code_object);
4357 }
4358
4359
4352 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { 4360 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
4353 Register result = ToRegister(instr->result()); 4361 Register result = ToRegister(instr->result());
4354 Register base = ToRegister(instr->base_object()); 4362 Register base = ToRegister(instr->base_object());
4355 __ lea(result, Operand(base, instr->offset())); 4363 __ lea(result, Operand(base, instr->offset()));
4356 } 4364 }
4357 4365
4358 4366
4359 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { 4367 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
4360 Representation representation = instr->representation(); 4368 Representation representation = instr->representation();
4361 4369
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
6202 6210
6203 6211
6204 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { 6212 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
6205 ASSERT(ToRegister(instr->context()).is(esi)); 6213 ASSERT(ToRegister(instr->context()).is(esi));
6206 // Use the fast case closure allocation code that allocates in new 6214 // Use the fast case closure allocation code that allocates in new
6207 // space for nested functions that don't need literals cloning. 6215 // space for nested functions that don't need literals cloning.
6208 bool pretenure = instr->hydrogen()->pretenure(); 6216 bool pretenure = instr->hydrogen()->pretenure();
6209 if (!pretenure && instr->hydrogen()->has_no_literals()) { 6217 if (!pretenure && instr->hydrogen()->has_no_literals()) {
6210 FastNewClosureStub stub(instr->hydrogen()->language_mode(), 6218 FastNewClosureStub stub(instr->hydrogen()->language_mode(),
6211 instr->hydrogen()->is_generator()); 6219 instr->hydrogen()->is_generator());
6212 __ push(Immediate(instr->hydrogen()->shared_info())); 6220 __ mov(ebx, Immediate(instr->hydrogen()->shared_info()));
6213 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 6221 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
6214 } else { 6222 } else {
6215 __ push(esi); 6223 __ push(esi);
6216 __ push(Immediate(instr->hydrogen()->shared_info())); 6224 __ push(Immediate(instr->hydrogen()->shared_info()));
6217 __ push(Immediate(pretenure ? factory()->true_value() 6225 __ push(Immediate(pretenure ? factory()->true_value()
6218 : factory()->false_value())); 6226 : factory()->false_value()));
6219 CallRuntime(Runtime::kNewClosure, 3, instr); 6227 CallRuntime(Runtime::kNewClosure, 3, instr);
6220 } 6228 }
6221 } 6229 }
6222 6230
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
6550 FixedArray::kHeaderSize - kPointerSize)); 6558 FixedArray::kHeaderSize - kPointerSize));
6551 __ bind(&done); 6559 __ bind(&done);
6552 } 6560 }
6553 6561
6554 6562
6555 #undef __ 6563 #undef __
6556 6564
6557 } } // namespace v8::internal 6565 } } // namespace v8::internal
6558 6566
6559 #endif // V8_TARGET_ARCH_IA32 6567 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698