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 3266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3277 // Check for the hole value. | 3277 // Check for the hole value. |
3278 if (instr->hydrogen()->RequiresHoleCheck()) { | 3278 if (instr->hydrogen()->RequiresHoleCheck()) { |
3279 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 3279 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
3280 __ SmiTst(result, scratch); | 3280 __ SmiTst(result, scratch); |
3281 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, | 3281 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, |
3282 Operand(zero_reg)); | 3282 Operand(zero_reg)); |
3283 } else { | 3283 } else { |
3284 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3284 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
3285 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); | 3285 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); |
3286 } | 3286 } |
3287 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { | |
3288 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); | |
3289 Label done; | |
3290 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | |
3291 __ Branch(&done, ne, result, Operand(scratch)); | |
3292 if (info()->IsStub()) { | |
3293 // A stub can safely convert the hole to undefined only if the array | |
3294 // protector cell contains (Smi) 1. Otherwise it needs to bail out. | |
3295 __ LoadRoot(scratch, Heap::kArrayProtectorRootIndex); | |
balazs.kilvady
2015/04/23 16:24:37
The result register should be used instead of scra
mvstanton
2015/04/27 07:57:13
Done.
| |
3296 __ lw(scratch, FieldMemOperand(result, Cell::kValueOffset)); | |
3297 DeoptimizeIf(ne, instr, Deoptimizer::kHole, scratch, | |
3298 Operand(Smi::FromInt(1))); | |
3299 } | |
3300 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | |
3301 __ bind(&done); | |
3287 } | 3302 } |
3288 } | 3303 } |
3289 | 3304 |
3290 | 3305 |
3291 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3306 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
3292 if (instr->is_typed_elements()) { | 3307 if (instr->is_typed_elements()) { |
3293 DoLoadKeyedExternalArray(instr); | 3308 DoLoadKeyedExternalArray(instr); |
3294 } else if (instr->hydrogen()->representation().IsDouble()) { | 3309 } else if (instr->hydrogen()->representation().IsDouble()) { |
3295 DoLoadKeyedFixedDoubleArray(instr); | 3310 DoLoadKeyedFixedDoubleArray(instr); |
3296 } else { | 3311 } else { |
(...skipping 2667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5964 __ li(at, scope_info); | 5979 __ li(at, scope_info); |
5965 __ Push(at, ToRegister(instr->function())); | 5980 __ Push(at, ToRegister(instr->function())); |
5966 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5981 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5967 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5982 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5968 } | 5983 } |
5969 | 5984 |
5970 | 5985 |
5971 #undef __ | 5986 #undef __ |
5972 | 5987 |
5973 } } // namespace v8::internal | 5988 } } // namespace v8::internal |
OLD | NEW |