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

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

Issue 15861009: Tag smi-constants as smi. This also fixes code that copies holes into arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 6 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/hydrogen-instructions.cc ('k') | src/property-details.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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 596
597 597
598 double LCodeGen::ToDouble(LConstantOperand* op) const { 598 double LCodeGen::ToDouble(LConstantOperand* op) const {
599 HConstant* constant = chunk_->LookupConstant(op); 599 HConstant* constant = chunk_->LookupConstant(op);
600 ASSERT(constant->HasDoubleValue()); 600 ASSERT(constant->HasDoubleValue());
601 return constant->DoubleValue(); 601 return constant->DoubleValue();
602 } 602 }
603 603
604 604
605 bool LCodeGen::IsInteger32(LConstantOperand* op) const { 605 bool LCodeGen::IsInteger32(LConstantOperand* op) const {
606 return chunk_->LookupLiteralRepresentation(op).IsInteger32(); 606 return chunk_->LookupLiteralRepresentation(op).IsSmiOrInteger32();
607 } 607 }
608 608
609 609
610 bool LCodeGen::IsSmi(LConstantOperand* op) const { 610 bool LCodeGen::IsSmi(LConstantOperand* op) const {
611 return chunk_->LookupLiteralRepresentation(op).IsSmi(); 611 return chunk_->LookupLiteralRepresentation(op).IsSmi();
612 } 612 }
613 613
614 614
615 Operand LCodeGen::ToOperand(LOperand* op) const { 615 Operand LCodeGen::ToOperand(LOperand* op) const {
616 if (op->IsRegister()) return Operand(ToRegister(op)); 616 if (op->IsRegister()) return Operand(ToRegister(op));
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 } 2120 }
2121 } 2121 }
2122 2122
2123 2123
2124 void LCodeGen::DoBranch(LBranch* instr) { 2124 void LCodeGen::DoBranch(LBranch* instr) {
2125 int true_block = chunk_->LookupDestination(instr->true_block_id()); 2125 int true_block = chunk_->LookupDestination(instr->true_block_id());
2126 int false_block = chunk_->LookupDestination(instr->false_block_id()); 2126 int false_block = chunk_->LookupDestination(instr->false_block_id());
2127 CpuFeatureScope scope(masm(), SSE2); 2127 CpuFeatureScope scope(masm(), SSE2);
2128 2128
2129 Representation r = instr->hydrogen()->value()->representation(); 2129 Representation r = instr->hydrogen()->value()->representation();
2130 if (r.IsInteger32() || r.IsSmi()) { 2130 if (r.IsSmiOrInteger32()) {
2131 Register reg = ToRegister(instr->value()); 2131 Register reg = ToRegister(instr->value());
2132 __ test(reg, Operand(reg)); 2132 __ test(reg, Operand(reg));
2133 EmitBranch(true_block, false_block, not_zero); 2133 EmitBranch(true_block, false_block, not_zero);
2134 } else if (r.IsDouble()) { 2134 } else if (r.IsDouble()) {
2135 XMMRegister reg = ToDoubleRegister(instr->value()); 2135 XMMRegister reg = ToDoubleRegister(instr->value());
2136 __ xorps(xmm0, xmm0); 2136 __ xorps(xmm0, xmm0);
2137 __ ucomisd(reg, xmm0); 2137 __ ucomisd(reg, xmm0);
2138 EmitBranch(true_block, false_block, not_equal); 2138 EmitBranch(true_block, false_block, not_equal);
2139 } else { 2139 } else {
2140 ASSERT(r.IsTagged()); 2140 ASSERT(r.IsTagged());
(...skipping 4442 matching lines...) Expand 10 before | Expand all | Expand 10 after
6583 FixedArray::kHeaderSize - kPointerSize)); 6583 FixedArray::kHeaderSize - kPointerSize));
6584 __ bind(&done); 6584 __ bind(&done);
6585 } 6585 }
6586 6586
6587 6587
6588 #undef __ 6588 #undef __
6589 6589
6590 } } // namespace v8::internal 6590 } } // namespace v8::internal
6591 6591
6592 #endif // V8_TARGET_ARCH_IA32 6592 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698