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

Side by Side Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/hydrogen-osr.h" 10 #include "src/crankshaft/hydrogen-osr.h"
(...skipping 5264 matching lines...) Expand 10 before | Expand all | Expand 10 after
5275 } 5275 }
5276 } 5276 }
5277 5277
5278 5278
5279 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { 5279 void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
5280 Register result = ToRegister(instr->result()); 5280 Register result = ToRegister(instr->result());
5281 5281
5282 // TODO(3095996): Get rid of this. For now, we need to make the 5282 // TODO(3095996): Get rid of this. For now, we need to make the
5283 // result register contain a valid pointer because it is already 5283 // result register contain a valid pointer because it is already
5284 // contained in the register pointer map. 5284 // contained in the register pointer map.
5285 __ LoadSmiLiteral(result, Smi::kZero); 5285 __ LoadSmiLiteral(result, Smi::FromInt(0));
5286 5286
5287 PushSafepointRegistersScope scope(this); 5287 PushSafepointRegistersScope scope(this);
5288 if (instr->size()->IsRegister()) { 5288 if (instr->size()->IsRegister()) {
5289 Register size = ToRegister(instr->size()); 5289 Register size = ToRegister(instr->size());
5290 DCHECK(!size.is(result)); 5290 DCHECK(!size.is(result));
5291 __ SmiTag(size); 5291 __ SmiTag(size);
5292 __ push(size); 5292 __ push(size);
5293 } else { 5293 } else {
5294 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5294 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5295 #if !V8_TARGET_ARCH_PPC64 5295 #if !V8_TARGET_ARCH_PPC64
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
5608 CallRuntime(Runtime::kForInEnumerate, instr); 5608 CallRuntime(Runtime::kForInEnumerate, instr);
5609 __ bind(&use_cache); 5609 __ bind(&use_cache);
5610 } 5610 }
5611 5611
5612 5612
5613 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5613 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5614 Register map = ToRegister(instr->map()); 5614 Register map = ToRegister(instr->map());
5615 Register result = ToRegister(instr->result()); 5615 Register result = ToRegister(instr->result());
5616 Label load_cache, done; 5616 Label load_cache, done;
5617 __ EnumLength(result, map); 5617 __ EnumLength(result, map);
5618 __ CmpSmiLiteral(result, Smi::kZero, r0); 5618 __ CmpSmiLiteral(result, Smi::FromInt(0), r0);
5619 __ bne(&load_cache); 5619 __ bne(&load_cache);
5620 __ mov(result, Operand(isolate()->factory()->empty_fixed_array())); 5620 __ mov(result, Operand(isolate()->factory()->empty_fixed_array()));
5621 __ b(&done); 5621 __ b(&done);
5622 5622
5623 __ bind(&load_cache); 5623 __ bind(&load_cache);
5624 __ LoadInstanceDescriptors(map, result); 5624 __ LoadInstanceDescriptors(map, result);
5625 __ LoadP(result, FieldMemOperand(result, DescriptorArray::kEnumCacheOffset)); 5625 __ LoadP(result, FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
5626 __ LoadP(result, FieldMemOperand(result, FixedArray::SizeFor(instr->idx()))); 5626 __ LoadP(result, FieldMemOperand(result, FixedArray::SizeFor(instr->idx())));
5627 __ cmpi(result, Operand::Zero()); 5627 __ cmpi(result, Operand::Zero());
5628 DeoptimizeIf(eq, instr, DeoptimizeReason::kNoCache); 5628 DeoptimizeIf(eq, instr, DeoptimizeReason::kNoCache);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
5707 __ LoadP(result, 5707 __ LoadP(result,
5708 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5708 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5709 __ bind(deferred->exit()); 5709 __ bind(deferred->exit());
5710 __ bind(&done); 5710 __ bind(&done);
5711 } 5711 }
5712 5712
5713 #undef __ 5713 #undef __
5714 5714
5715 } // namespace internal 5715 } // namespace internal
5716 } // namespace v8 5716 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.cc ('k') | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698