| Index: src/ia32/lithium-codegen-ia32.cc
|
| ===================================================================
|
| --- src/ia32/lithium-codegen-ia32.cc (revision 13123)
|
| +++ src/ia32/lithium-codegen-ia32.cc (working copy)
|
| @@ -2849,6 +2849,14 @@
|
| break;
|
| }
|
| }
|
| +
|
| + if (instr->prefetch_distance() != NULL) {
|
| + InsertArrayPrefetch(
|
| + operand,
|
| + instr->prefetch_distance(),
|
| + elements_kind,
|
| + ToRegister(instr->temp()));
|
| + }
|
| }
|
|
|
|
|
| @@ -2876,20 +2884,30 @@
|
| FixedDoubleArray::kHeaderSize - kHeapObjectTag,
|
| instr->additional_index());
|
| __ movdbl(result, double_load_operand);
|
| +
|
| + if (instr->prefetch_distance() != NULL) {
|
| + InsertArrayPrefetch(
|
| + double_load_operand,
|
| + instr->prefetch_distance(),
|
| + FAST_DOUBLE_ELEMENTS,
|
| + ToRegister(instr->temp()));
|
| + }
|
| }
|
|
|
|
|
| void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
|
| Register result = ToRegister(instr->result());
|
|
|
| + Operand load_operand = BuildFastArrayOperand(
|
| + instr->elements(),
|
| + instr->key(),
|
| + instr->hydrogen()->key()->representation(),
|
| + FAST_ELEMENTS,
|
| + FixedArray::kHeaderSize - kHeapObjectTag,
|
| + instr->additional_index());
|
| +
|
| // Load the result.
|
| - __ mov(result,
|
| - BuildFastArrayOperand(instr->elements(),
|
| - instr->key(),
|
| - instr->hydrogen()->key()->representation(),
|
| - FAST_ELEMENTS,
|
| - FixedArray::kHeaderSize - kHeapObjectTag,
|
| - instr->additional_index()));
|
| + __ mov(result, load_operand);
|
|
|
| // Check for the hole value.
|
| if (instr->hydrogen()->RequiresHoleCheck()) {
|
| @@ -2901,6 +2919,14 @@
|
| DeoptimizeIf(equal, instr->environment());
|
| }
|
| }
|
| +
|
| + if (instr->prefetch_distance() != NULL) {
|
| + InsertArrayPrefetch(
|
| + load_operand,
|
| + instr->prefetch_distance(),
|
| + FAST_ELEMENTS,
|
| + ToRegister(instr->temp()));
|
| + }
|
| }
|
|
|
|
|
| @@ -2915,6 +2941,26 @@
|
| }
|
|
|
|
|
| +void LCodeGen::InsertArrayPrefetch(
|
| + const Operand& operand,
|
| + LOperand* prefetch_distance,
|
| + ElementsKind elements_kind,
|
| + Register scratch) {
|
| + __ lea(scratch, operand);
|
| + int shift_size = ElementsKindToShiftSize(elements_kind);
|
| + if (prefetch_distance->IsConstantOperand()) {
|
| + __ prefetch(Operand(scratch,
|
| + ToInteger32(LConstantOperand::cast(prefetch_distance)) << shift_size),
|
| + 1);
|
| + } else {
|
| + ASSERT(prefetch_distance->IsRegister());
|
| + ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size);
|
| + __ prefetch(
|
| + Operand(scratch, ToRegister(prefetch_distance), scale_factor, 0), 1);
|
| + }
|
| +}
|
| +
|
| +
|
| Operand LCodeGen::BuildFastArrayOperand(
|
| LOperand* elements_pointer,
|
| LOperand* key,
|
|
|