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/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
| 8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
| 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 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3340 // Check for the hole value. | 3340 // Check for the hole value. |
| 3341 if (instr->hydrogen()->RequiresHoleCheck()) { | 3341 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 3342 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 3342 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
| 3343 __ SmiTst(result); | 3343 __ SmiTst(result); |
| 3344 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi); | 3344 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi); |
| 3345 } else { | 3345 } else { |
| 3346 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3346 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
| 3347 __ cmp(result, scratch); | 3347 __ cmp(result, scratch); |
| 3348 DeoptimizeIf(eq, instr, Deoptimizer::kHole); | 3348 DeoptimizeIf(eq, instr, Deoptimizer::kHole); |
| 3349 } | 3349 } |
| 3350 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { | |
| 3351 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); | |
| 3352 Label done; | |
| 3353 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | |
| 3354 __ cmp(result, scratch); | |
| 3355 __ b(ne, &done); | |
| 3356 if (info()->IsStub()) { | |
| 3357 // A stub can safely convert the hole to undefined only if the array | |
| 3358 // protector cell contains (Smi) 1. Otherwise it needs to bail out. | |
| 3359 __ 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:12
Done.
| |
| 3360 __ ldr(scratch, FieldMemOperand(result, Cell::kValueOffset)); | |
| 3361 __ cmp(scratch, Operand(Smi::FromInt(1))); | |
| 3362 DeoptimizeIf(ne, instr, Deoptimizer::kHole); | |
| 3363 } | |
| 3364 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | |
| 3365 __ bind(&done); | |
| 3350 } | 3366 } |
| 3351 } | 3367 } |
| 3352 | 3368 |
| 3353 | 3369 |
| 3354 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3370 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
| 3355 if (instr->is_typed_elements()) { | 3371 if (instr->is_typed_elements()) { |
| 3356 DoLoadKeyedExternalArray(instr); | 3372 DoLoadKeyedExternalArray(instr); |
| 3357 } else if (instr->hydrogen()->representation().IsDouble()) { | 3373 } else if (instr->hydrogen()->representation().IsDouble()) { |
| 3358 DoLoadKeyedFixedDoubleArray(instr); | 3374 DoLoadKeyedFixedDoubleArray(instr); |
| 3359 } else { | 3375 } else { |
| (...skipping 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5909 __ Push(scope_info); | 5925 __ Push(scope_info); |
| 5910 __ push(ToRegister(instr->function())); | 5926 __ push(ToRegister(instr->function())); |
| 5911 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5927 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5912 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5928 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5913 } | 5929 } |
| 5914 | 5930 |
| 5915 | 5931 |
| 5916 #undef __ | 5932 #undef __ |
| 5917 | 5933 |
| 5918 } } // namespace v8::internal | 5934 } } // namespace v8::internal |
| OLD | NEW |