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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 108933002: HLoadKeyed for Smis optimized for x64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 7c9949a1fad8da5b441e7ecd79d96ab41dbea073..e8287e2aaec1fdf907b7d4fb670e5da30ac95c64 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -3053,6 +3053,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
+ HLoadKeyed* hinstr = instr->hydrogen();
Register result = ToRegister(instr->result());
LOperand* key = instr->key();
if (!key->IsConstantOperand()) {
@@ -3062,24 +3063,34 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
// gets replaced during bound check elimination with the index
// argument to the bounds check, which can be tagged, so that
// case must be handled here, too.
- if (instr->hydrogen()->IsDehoisted()) {
+ if (hinstr->IsDehoisted()) {
// Sign extend key because it could be a 32 bit negative value
// and the dehoisted address computation happens in 64 bits
__ movsxlq(key_reg, key_reg);
}
}
- // Load the result.
- __ movq(result,
+ bool requires_hole_check = hinstr->RequiresHoleCheck();
+ int offs = FixedArray::kHeaderSize - kHeapObjectTag;
Toon Verwaest 2013/12/09 13:47:23 Please write out variable names: "offset".
Igor Sheludko 2013/12/09 17:27:06 Done.
+ Representation representation = hinstr->representation();
+
+ if (hinstr->type().IsSmi() && representation.IsInteger32()) {
Toon Verwaest 2013/12/09 13:47:23 Why check for hinstr->type().IsSmi()? You should o
Igor Sheludko 2013/12/09 17:27:06 We can't rely only on IsInteger32() case since we
+ ASSERT(!requires_hole_check);
+ // Read int value directly from upper half of the smi.
+ offs += kPointerSize / 2;
Toon Verwaest 2013/12/09 13:47:23 Isn't there a kSmiTagSize you can use? You just wa
Igor Sheludko 2013/12/09 17:27:06 kSmiTagSize is a number of bits, so we can't use i
+ }
+
+ __ Load(result,
BuildFastArrayOperand(instr->elements(),
key,
FAST_ELEMENTS,
- FixedArray::kHeaderSize - kHeapObjectTag,
- instr->additional_index()));
+ offs,
+ instr->additional_index()),
+ representation);
// Check for the hole value.
- if (instr->hydrogen()->RequiresHoleCheck()) {
- if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
+ if (requires_hole_check) {
+ if (IsFastSmiElementsKind(hinstr->elements_kind())) {
Condition smi = __ CheckSmi(result);
DeoptimizeIf(NegateCondition(smi), instr->environment());
} else {
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698