Message from discussion
r12718 committed - Use immediate add when possible in space allocator...
Received: by 10.236.149.33 with SMTP id w21mr3001778yhj.33.1350050775009;
Fri, 12 Oct 2012 07:06:15 -0700 (PDT)
X-BeenThere: v8-dev@googlegroups.com
Received: by 10.236.149.34 with SMTP id w22ls4543017yhj.8.gmail; Fri, 12 Oct
2012 07:06:14 -0700 (PDT)
Received: by 10.236.153.6 with SMTP id e6mr2938564yhk.20.1350050774329;
Fri, 12 Oct 2012 07:06:14 -0700 (PDT)
Received: by 10.236.153.6 with SMTP id e6mr2938563yhk.20.1350050774316;
Fri, 12 Oct 2012 07:06:14 -0700 (PDT)
Return-Path: <31iN4UBAKBocnzop3t4p-yz2p0w9rzzrwp.nzx6J-op6rzzrwpr2z503....@codesite.bounces.google.com>
Received: from mail-yh0-f75.google.com (mail-yh0-f75.google.com [209.85.213.75])
by gmr-mx.google.com with ESMTPS id m9si699405yhc.5.2012.10.12.07.06.14
(version=TLSv1/SSLv3 cipher=OTHER);
Fri, 12 Oct 2012 07:06:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of 31iN4UBAKBocnzop3t4p-yz2p0w9rzzrwp.nzx6J-op6rzzrwpr2z503....@codesite.bounces.google.com designates 209.85.213.75 as permitted sender) client-ip=209.85.213.75;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of 31iN4UBAKBocnzop3t4p-yz2p0w9rzzrwp.nzx6J-op6rzzrwpr2z503....@codesite.bounces.google.com designates 209.85.213.75 as permitted sender) smtp.mail=31iN4UBAKBocnzop3t4p-yz2p0w9rzzrwp.nzx6J-op6rzzrwpr2z503....@codesite.bounces.google.com; dkim=pass header...@google.com
Received: by mail-yh0-f75.google.com with SMTP id g71so374696yhg.2
for <v8-dev@googlegroups.com>; Fri, 12 Oct 2012 07:06:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20120113;
h=mime-version:x-generated-by:message-id:date:subject:from:to
:content-type;
bh=Ngm9mwVWYO8gLzoqjBWZvHCzMQjXtajSnWQhXTDGp0M=;
b=fXNADw4HUOmT8v+Kua3f+IB4/diAbvE6aIa5x/5IeMEUAATr8zQG9GkLxkd2rvfcDZ
9CGBtu73r4+VLupa2EA+5VZ+agYj7iWxkyiM1Lh+EH7UZP/7+BwRbu5dcToKTlZ6oLaI
Fel2JFj8NbZvCZFjmszr44/0lnESS3fjOMVuelmFy8pOr0CNZcSfqp1GXlvImBahT72B
mxmalHIeCbEMf5qVJnsP4vYiGW+U3/tVKRiPTcdRiZDGJ4fNbA2Y9u6sOjuAkiI2uuyh
DZ+r34MsqE/gqVcErhy5UA1eroUtY80N5ZuBpwRDV9cvN4LO1uhwZT+0iHzjYHJEaEha
kJJA==
MIME-Version: 1.0
Received: by 10.224.213.1 with SMTP id gu1mr2673178qab.7.1350050774204; Fri,
12 Oct 2012 07:06:14 -0700 (PDT)
X-Generated-By: Google Code
Message-ID: <20cf300fb1d7d3444904cbdd3...@google.com>
Date: Fri, 12 Oct 2012 14:06:14 +0000
Subject: [v8] r12718 committed - Use immediate add when possible in space allocator...
From: codesite-nore...@google.com
To: v8-dev@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
Revision: 12718
Author: da...@chromium.org
Date: Fri Oct 12 07:06:03 2012
Log: Use immediate add when possible in space allocator
Save one instruction in allocating new space by using an immediate add if
possible to calculate the new top of heap.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11091068
Patch from Anthony Berent <aber...@chromium.org>.
http://code.google.com/p/v8/source/detail?r=12718
Modified:
/branches/bleeding_edge/src/arm/macro-assembler-arm.cc
=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Fri Oct 12
04:09:14 2012
+++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Fri Oct 12
07:06:03 2012
@@ -1570,7 +1570,11 @@
Register topaddr = scratch1;
Register obj_size_reg = scratch2;
mov(topaddr, Operand(new_space_allocation_top));
- mov(obj_size_reg, Operand(object_size));
+ Operand obj_size_operand = Operand(object_size);
+ if (!obj_size_operand.is_single_instruction(this)) {
+ // We are about to steal IP, so we need to load this value first
+ mov(obj_size_reg, obj_size_operand);
+ }
// This code stores a temporary value in ip. This is OK, as the code
below
// does not need ip for implicit literal generation.
@@ -1592,7 +1596,13 @@
// Calculate new top and bail out if new space is exhausted. Use result
// to calculate the new top.
- add(scratch2, result, Operand(obj_size_reg), SetCC);
+ if (obj_size_operand.is_single_instruction(this)) {
+ // We can add the size as an immediate
+ add(scratch2, result, obj_size_operand, SetCC);
+ } else {
+ // Doesn't fit in an immediate, we have to use the register
+ add(scratch2, result, obj_size_reg, SetCC);
+ }
b(cs, gc_required);
cmp(scratch2, Operand(ip));
b(hi, gc_required);