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

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

Issue 14364010: Lithium: avoid registers for constants when possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Last comments Created 7 years, 8 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/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('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 5455 matching lines...) Expand 10 before | Expand all | Expand 10 after
5466 scratch2, 5466 scratch2,
5467 deferred->entry(), 5467 deferred->entry(),
5468 flags); 5468 flags);
5469 } 5469 }
5470 5470
5471 __ bind(deferred->exit()); 5471 __ bind(deferred->exit());
5472 } 5472 }
5473 5473
5474 5474
5475 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { 5475 void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
5476 Register size = ToRegister(instr->size());
5477 Register result = ToRegister(instr->result()); 5476 Register result = ToRegister(instr->result());
5478 5477
5479 // TODO(3095996): Get rid of this. For now, we need to make the 5478 // TODO(3095996): Get rid of this. For now, we need to make the
5480 // result register contain a valid pointer because it is already 5479 // result register contain a valid pointer because it is already
5481 // contained in the register pointer map. 5480 // contained in the register pointer map.
5482 __ mov(result, Operand(Smi::FromInt(0))); 5481 __ mov(result, Operand(Smi::FromInt(0)));
5483 5482
5484 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); 5483 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
5485 __ SmiTag(size, size); 5484 if (instr->size()->IsRegister()) {
5486 __ push(size); 5485 Register size = ToRegister(instr->size());
5486 ASSERT(!size.is(result));
5487 __ SmiTag(size);
5488 __ push(size);
5489 } else {
5490 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5491 __ Push(Smi::FromInt(size));
5492 }
5493
5487 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { 5494 if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
5488 CallRuntimeFromDeferred( 5495 CallRuntimeFromDeferred(
5489 Runtime::kAllocateInOldPointerSpace, 1, instr); 5496 Runtime::kAllocateInOldPointerSpace, 1, instr);
5490 } else { 5497 } else {
5491 CallRuntimeFromDeferred( 5498 CallRuntimeFromDeferred(
5492 Runtime::kAllocateInNewSpace, 1, instr); 5499 Runtime::kAllocateInNewSpace, 1, instr);
5493 } 5500 }
5494 __ StoreToSafepointRegisterSlot(r0, result); 5501 __ StoreToSafepointRegisterSlot(r0, result);
5495 } 5502 }
5496 5503
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
6013 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6020 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6014 __ ldr(result, FieldMemOperand(scratch, 6021 __ ldr(result, FieldMemOperand(scratch,
6015 FixedArray::kHeaderSize - kPointerSize)); 6022 FixedArray::kHeaderSize - kPointerSize));
6016 __ bind(&done); 6023 __ bind(&done);
6017 } 6024 }
6018 6025
6019 6026
6020 #undef __ 6027 #undef __
6021 6028
6022 } } // namespace v8::internal 6029 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698