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