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 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
| 10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
| (...skipping 3315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3326 // Check for the hole value. | 3326 // Check for the hole value. |
| 3327 if (hinstr->RequiresHoleCheck()) { | 3327 if (hinstr->RequiresHoleCheck()) { |
| 3328 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 3328 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
| 3329 __ SmiTst(result, scratch); | 3329 __ SmiTst(result, scratch); |
| 3330 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, | 3330 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, |
| 3331 Operand(zero_reg)); | 3331 Operand(zero_reg)); |
| 3332 } else { | 3332 } else { |
| 3333 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3333 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
| 3334 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); | 3334 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(scratch)); |
| 3335 } | 3335 } |
| 3336 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { | |
| 3337 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); | |
| 3338 Label done; | |
| 3339 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | |
| 3340 __ Branch(&done, ne, result, Operand(scratch)); | |
| 3341 if (info()->IsStub()) { | |
| 3342 // A stub can safely convert the hole to undefined only if the array | |
| 3343 // protector cell contains (Smi) 1. Otherwise it needs to bail out. | |
| 3344 __ 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.
| |
| 3345 __ lw(scratch, FieldMemOperand(result, Cell::kValueOffset)); | |
|
paul.l...
2015/04/23 15:34:23
nit: This should probably be 'ld'. I say 'probably
mvstanton
2015/04/27 07:57:13
Done.
| |
| 3346 DeoptimizeIf(ne, instr, Deoptimizer::kHole, scratch, | |
| 3347 Operand(Smi::FromInt(1))); | |
| 3348 } | |
| 3349 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | |
| 3350 __ bind(&done); | |
| 3336 } | 3351 } |
| 3337 } | 3352 } |
| 3338 | 3353 |
| 3339 | 3354 |
| 3340 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3355 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
| 3341 if (instr->is_typed_elements()) { | 3356 if (instr->is_typed_elements()) { |
| 3342 DoLoadKeyedExternalArray(instr); | 3357 DoLoadKeyedExternalArray(instr); |
| 3343 } else if (instr->hydrogen()->representation().IsDouble()) { | 3358 } else if (instr->hydrogen()->representation().IsDouble()) { |
| 3344 DoLoadKeyedFixedDoubleArray(instr); | 3359 DoLoadKeyedFixedDoubleArray(instr); |
| 3345 } else { | 3360 } else { |
| (...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6024 __ li(at, scope_info); | 6039 __ li(at, scope_info); |
| 6025 __ Push(at, ToRegister(instr->function())); | 6040 __ Push(at, ToRegister(instr->function())); |
| 6026 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6041 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6027 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6042 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6028 } | 6043 } |
| 6029 | 6044 |
| 6030 | 6045 |
| 6031 #undef __ | 6046 #undef __ |
| 6032 | 6047 |
| 6033 } } // namespace v8::internal | 6048 } } // namespace v8::internal |
| OLD | NEW |