Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 3166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3177 | 3177 |
| 3178 // Check for the hole value. | 3178 // Check for the hole value. |
| 3179 if (instr->hydrogen()->RequiresHoleCheck()) { | 3179 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 3180 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 3180 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
| 3181 __ test(result, Immediate(kSmiTagMask)); | 3181 __ test(result, Immediate(kSmiTagMask)); |
| 3182 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotASmi); | 3182 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotASmi); |
| 3183 } else { | 3183 } else { |
| 3184 __ cmp(result, factory()->the_hole_value()); | 3184 __ cmp(result, factory()->the_hole_value()); |
| 3185 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | 3185 DeoptimizeIf(equal, instr, Deoptimizer::kHole); |
| 3186 } | 3186 } |
| 3187 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { | |
| 3188 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); | |
| 3189 Label done; | |
| 3190 __ cmp(result, factory()->the_hole_value()); | |
| 3191 __ j(not_equal, &done); | |
| 3192 if (info()->IsStub()) { | |
| 3193 // A stub can safely convert the hole to undefined only if the array | |
| 3194 // protector cell contains (Smi) 1. Otherwise it needs to bail out. | |
| 3195 __ mov(result, isolate()->factory()->array_protector()); | |
|
Jakob Kummerow
2015/04/23 13:40:00
You can collapse this into one instruction:
__ cm
mvstanton
2015/04/27 07:57:12
Actually I can't do that for a PropertyCell, just
| |
| 3196 __ cmp(FieldOperand(result, Cell::kValueOffset), | |
| 3197 Immediate(Smi::FromInt(1))); | |
|
Jakob Kummerow
2015/04/23 13:40:00
Please factor out the magic 0/1 constants as "stat
mvstanton
2015/04/27 07:57:12
Done.
| |
| 3198 DeoptimizeIf(not_equal, instr, Deoptimizer::kHole); | |
| 3199 } | |
| 3200 __ mov(result, isolate()->factory()->undefined_value()); | |
| 3201 __ bind(&done); | |
| 3187 } | 3202 } |
| 3188 } | 3203 } |
| 3189 | 3204 |
| 3190 | 3205 |
| 3191 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3206 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
| 3192 if (instr->is_typed_elements()) { | 3207 if (instr->is_typed_elements()) { |
| 3193 DoLoadKeyedExternalArray(instr); | 3208 DoLoadKeyedExternalArray(instr); |
| 3194 } else if (instr->hydrogen()->representation().IsDouble()) { | 3209 } else if (instr->hydrogen()->representation().IsDouble()) { |
| 3195 DoLoadKeyedFixedDoubleArray(instr); | 3210 DoLoadKeyedFixedDoubleArray(instr); |
| 3196 } else { | 3211 } else { |
| (...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5738 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5753 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5739 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5754 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5740 } | 5755 } |
| 5741 | 5756 |
| 5742 | 5757 |
| 5743 #undef __ | 5758 #undef __ |
| 5744 | 5759 |
| 5745 } } // namespace v8::internal | 5760 } } // namespace v8::internal |
| 5746 | 5761 |
| 5747 #endif // V8_TARGET_ARCH_IA32 | 5762 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |