OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
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 5143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5154 | 5154 |
5155 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { | 5155 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
5156 if (!instr->hydrogen()->value()->type().IsHeapObject()) { | 5156 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
5157 LOperand* input = instr->value(); | 5157 LOperand* input = instr->value(); |
5158 Condition cc = masm()->CheckSmi(ToRegister(input)); | 5158 Condition cc = masm()->CheckSmi(ToRegister(input)); |
5159 DeoptimizeIf(cc, instr, Deoptimizer::kSmi); | 5159 DeoptimizeIf(cc, instr, Deoptimizer::kSmi); |
5160 } | 5160 } |
5161 } | 5161 } |
5162 | 5162 |
5163 | 5163 |
5164 void LCodeGen::DoCheckArrayBufferNotNeutered( | |
5165 LCheckArrayBufferNotNeutered* instr) { | |
5166 Register view = ToRegister(instr->view()); | |
5167 | |
5168 Label has_no_buffer; | |
5169 __ movp(kScratchRegister, | |
5170 FieldOperand(view, JSArrayBufferView::kBufferOffset)); | |
5171 __ JumpIfSmi(kScratchRegister, &has_no_buffer); | |
5172 __ testb(FieldOperand(kScratchRegister, JSArrayBuffer::kBitFieldOffset), | |
5173 Immediate(1 << JSArrayBuffer::WasNeutered::kShift)); | |
5174 DeoptimizeIf(not_zero, instr, Deoptimizer::kOutOfBounds); | |
Sven Panne
2015/04/28 13:45:16
Would it be worth introducing a new deopt message
| |
5175 | |
5176 __ bind(&has_no_buffer); | |
5177 } | |
5178 | |
5179 | |
5164 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { | 5180 void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) { |
5165 Register input = ToRegister(instr->value()); | 5181 Register input = ToRegister(instr->value()); |
5166 | 5182 |
5167 __ movp(kScratchRegister, FieldOperand(input, HeapObject::kMapOffset)); | 5183 __ movp(kScratchRegister, FieldOperand(input, HeapObject::kMapOffset)); |
5168 | 5184 |
5169 if (instr->hydrogen()->is_interval_check()) { | 5185 if (instr->hydrogen()->is_interval_check()) { |
5170 InstanceType first; | 5186 InstanceType first; |
5171 InstanceType last; | 5187 InstanceType last; |
5172 instr->hydrogen()->GetCheckInterval(&first, &last); | 5188 instr->hydrogen()->GetCheckInterval(&first, &last); |
5173 | 5189 |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5933 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5949 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5934 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5950 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5935 } | 5951 } |
5936 | 5952 |
5937 | 5953 |
5938 #undef __ | 5954 #undef __ |
5939 | 5955 |
5940 } } // namespace v8::internal | 5956 } } // namespace v8::internal |
5941 | 5957 |
5942 #endif // V8_TARGET_ARCH_X64 | 5958 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |