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

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

Issue 23618002: Hydrogenisation of binops (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 7 years, 3 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') | src/x64/lithium-x64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
1892 break; 1892 break;
1893 } 1893 }
1894 } 1894 }
1895 1895
1896 1896
1897 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { 1897 void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
1898 ASSERT(ToRegister(instr->left()).is(rdx)); 1898 ASSERT(ToRegister(instr->left()).is(rdx));
1899 ASSERT(ToRegister(instr->right()).is(rax)); 1899 ASSERT(ToRegister(instr->right()).is(rax));
1900 ASSERT(ToRegister(instr->result()).is(rax)); 1900 ASSERT(ToRegister(instr->result()).is(rax));
1901 1901
1902 BinaryOpStub stub(instr->op(), NO_OVERWRITE); 1902 BinaryOpStub stub(instr->op());
1903 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 1903 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
1904 __ nop(); // Signals no inlined code. 1904 __ nop(); // Signals no inlined code.
1905 } 1905 }
1906 1906
1907 1907
1908 int LCodeGen::GetNextEmittedBlock() const { 1908 int LCodeGen::GetNextEmittedBlock() const {
1909 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { 1909 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) {
1910 if (!chunk_->GetLabel(i)->HasReplacement()) return i; 1910 if (!chunk_->GetLabel(i)->HasReplacement()) return i;
1911 } 1911 }
1912 return -1; 1912 return -1;
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after
4714 codegen()->DoDeferredTaggedToI(instr_, done()); 4714 codegen()->DoDeferredTaggedToI(instr_, done());
4715 } 4715 }
4716 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } 4716 virtual LInstruction* instr() V8_OVERRIDE { return instr_; }
4717 private: 4717 private:
4718 LTaggedToI* instr_; 4718 LTaggedToI* instr_;
4719 }; 4719 };
4720 4720
4721 LOperand* input = instr->value(); 4721 LOperand* input = instr->value();
4722 ASSERT(input->IsRegister()); 4722 ASSERT(input->IsRegister());
4723 ASSERT(input->Equals(instr->result())); 4723 ASSERT(input->Equals(instr->result()));
4724 Register input_reg = ToRegister(input);
4724 4725
4725 Register input_reg = ToRegister(input); 4726 if (instr->hydrogen()->value()->representation().IsSmi()) {
4726 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); 4727 __ SmiToInteger32(input_reg, input_reg);
4727 __ JumpIfNotSmi(input_reg, deferred->entry()); 4728 } else {
4728 __ SmiToInteger32(input_reg, input_reg); 4729 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr);
4729 __ bind(deferred->exit()); 4730 __ JumpIfNotSmi(input_reg, deferred->entry());
4731 __ SmiToInteger32(input_reg, input_reg);
4732 __ bind(deferred->exit());
4733 }
4730 } 4734 }
4731 4735
4732 4736
4733 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { 4737 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
4734 LOperand* input = instr->value(); 4738 LOperand* input = instr->value();
4735 ASSERT(input->IsRegister()); 4739 ASSERT(input->IsRegister());
4736 LOperand* result = instr->result(); 4740 LOperand* result = instr->result();
4737 ASSERT(result->IsDoubleRegister()); 4741 ASSERT(result->IsDoubleRegister());
4738 4742
4739 Register input_reg = ToRegister(input); 4743 Register input_reg = ToRegister(input);
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
5493 FixedArray::kHeaderSize - kPointerSize)); 5497 FixedArray::kHeaderSize - kPointerSize));
5494 __ bind(&done); 5498 __ bind(&done);
5495 } 5499 }
5496 5500
5497 5501
5498 #undef __ 5502 #undef __
5499 5503
5500 } } // namespace v8::internal 5504 } } // namespace v8::internal
5501 5505
5502 #endif // V8_TARGET_ARCH_X64 5506 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698