OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 3477 matching lines...) Loading... |
3488 if (requires_hole_check) { | 3488 if (requires_hole_check) { |
3489 if (IsFastSmiElementsKind(hinstr->elements_kind())) { | 3489 if (IsFastSmiElementsKind(hinstr->elements_kind())) { |
3490 __ TestIfSmi(result, r0); | 3490 __ TestIfSmi(result, r0); |
3491 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, cr0); | 3491 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, cr0); |
3492 } else { | 3492 } else { |
3493 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3493 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
3494 __ cmp(result, scratch); | 3494 __ cmp(result, scratch); |
3495 DeoptimizeIf(eq, instr, Deoptimizer::kHole); | 3495 DeoptimizeIf(eq, instr, Deoptimizer::kHole); |
3496 } | 3496 } |
3497 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { | 3497 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
3498 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); | 3498 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_SMI_ELEMENTS || |
| 3499 instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); |
3499 Label done; | 3500 Label done; |
3500 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 3501 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
3501 __ cmp(result, scratch); | 3502 __ cmp(result, scratch); |
3502 __ bne(&done); | 3503 __ bne(&done); |
3503 if (info()->IsStub()) { | 3504 if (info()->IsStub()) { |
3504 // A stub can safely convert the hole to undefined only if the array | 3505 // A stub can safely convert the hole to undefined only if the array |
3505 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise | 3506 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise |
3506 // it needs to bail out. | 3507 // it needs to bail out. |
3507 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); | 3508 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); |
3508 __ LoadP(result, FieldMemOperand(result, Cell::kValueOffset)); | 3509 __ LoadP(result, FieldMemOperand(result, Cell::kValueOffset)); |
(...skipping 2705 matching lines...) Loading... |
6214 __ Push(scope_info); | 6215 __ Push(scope_info); |
6215 __ push(ToRegister(instr->function())); | 6216 __ push(ToRegister(instr->function())); |
6216 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6217 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6217 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6218 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6218 } | 6219 } |
6219 | 6220 |
6220 | 6221 |
6221 #undef __ | 6222 #undef __ |
6222 } | 6223 } |
6223 } // namespace v8::internal | 6224 } // namespace v8::internal |
OLD | NEW |