Commit 28c557dd authored by ishell@chromium.org's avatar ishell@chromium.org

HLoadNamedField for Smis optimized for x64

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/108633003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18283 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9f8d6442
......@@ -6216,7 +6216,11 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<1> {
set_representation(Representation::Integer32());
} else if (representation.IsSmi()) {
set_type(HType::Smi());
set_representation(representation);
if (SmiValuesAre32Bits()) {
set_representation(Representation::Integer32());
} else {
set_representation(representation);
}
} else if (representation.IsDouble() ||
representation.IsExternal() ||
representation.IsInteger32()) {
......
......@@ -2843,7 +2843,17 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
__ movq(result, FieldOperand(object, JSObject::kPropertiesOffset));
object = result;
}
__ Load(result, FieldOperand(object, offset), access.representation());
Representation representation = access.representation();
if (representation.IsSmi() &&
instr->hydrogen()->representation().IsInteger32()) {
// Read int value directly from upper half of the smi.
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2;
representation = Representation::Integer32();
}
__ Load(result, FieldOperand(object, offset), representation);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment