OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3278 // Check for the hole value. | 3278 // Check for the hole value. |
3279 if (instr->hydrogen()->RequiresHoleCheck()) { | 3279 if (instr->hydrogen()->RequiresHoleCheck()) { |
3280 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 3280 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
3281 __ SmiTst(result, scratch); | 3281 __ SmiTst(result, scratch); |
3282 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, | 3282 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, |
3283 Operand(zero_reg)); | 3283 Operand(zero_reg)); |
3284 } else { | 3284 } else { |
3285 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3285 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
3286 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); | 3286 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); |
3287 } | 3287 } |
| 3288 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
| 3289 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); |
| 3290 Label done; |
| 3291 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
| 3292 __ Branch(&done, ne, result, Operand(scratch)); |
| 3293 if (info()->IsStub()) { |
| 3294 // A stub can safely convert the hole to undefined only if the array |
| 3295 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise |
| 3296 // it needs to bail out. |
| 3297 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); |
| 3298 __ lw(result, FieldMemOperand(result, Cell::kValueOffset)); |
| 3299 DeoptimizeIf(ne, instr, Deoptimizer::kHole, result, |
| 3300 Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); |
| 3301 } |
| 3302 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
| 3303 __ bind(&done); |
3288 } | 3304 } |
3289 } | 3305 } |
3290 | 3306 |
3291 | 3307 |
3292 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3308 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
3293 if (instr->is_typed_elements()) { | 3309 if (instr->is_typed_elements()) { |
3294 DoLoadKeyedExternalArray(instr); | 3310 DoLoadKeyedExternalArray(instr); |
3295 } else if (instr->hydrogen()->representation().IsDouble()) { | 3311 } else if (instr->hydrogen()->representation().IsDouble()) { |
3296 DoLoadKeyedFixedDoubleArray(instr); | 3312 DoLoadKeyedFixedDoubleArray(instr); |
3297 } else { | 3313 } else { |
(...skipping 2667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5965 __ li(at, scope_info); | 5981 __ li(at, scope_info); |
5966 __ Push(at, ToRegister(instr->function())); | 5982 __ Push(at, ToRegister(instr->function())); |
5967 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5983 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5968 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5984 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5969 } | 5985 } |
5970 | 5986 |
5971 | 5987 |
5972 #undef __ | 5988 #undef __ |
5973 | 5989 |
5974 } } // namespace v8::internal | 5990 } } // namespace v8::internal |
OLD | NEW |