Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index df2dd859aa28a39cd88477f8c4e3a5dd7671255d..27bfe15e3378e93db232e51441784415a41e7a63 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -1285,6 +1285,13 @@ void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { |
} |
+void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
+ Register result = ToRegister(instr->result()); |
+ Register map = ToRegister(instr->InputAt(0)); |
+ __ EnumLength(result, map); |
+} |
+ |
+ |
void LCodeGen::DoElementsKind(LElementsKind* instr) { |
Register result = ToRegister(instr->result()); |
Register input = ToRegister(instr->InputAt(0)); |
@@ -5217,11 +5224,19 @@ void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
Register map = ToRegister(instr->map()); |
Register result = ToRegister(instr->result()); |
+ Label load_cache, done; |
+ __ EnumLength(result, map); |
+ __ Cmp(result, Smi::FromInt(0)); |
+ __ j(not_equal, &load_cache); |
+ __ LoadRoot(result, Heap::kEmptyFixedArrayRootIndex); |
+ __ jmp(&done); |
+ __ bind(&load_cache); |
__ LoadInstanceDescriptors(map, result); |
__ movq(result, |
FieldOperand(result, DescriptorArray::kEnumCacheOffset)); |
__ movq(result, |
FieldOperand(result, FixedArray::SizeFor(instr->idx()))); |
+ __ bind(&done); |
Condition cc = masm()->CheckSmi(result); |
DeoptimizeIf(cc, instr->environment()); |
} |