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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
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 4345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4356 { | 4356 { |
4357 PushSafepointRegistersScope scope(this); | 4357 PushSafepointRegistersScope scope(this); |
4358 if (instr->object()->IsRegister()) { | 4358 if (instr->object()->IsRegister()) { |
4359 __ Move(result, ToRegister(instr->object())); | 4359 __ Move(result, ToRegister(instr->object())); |
4360 } else { | 4360 } else { |
4361 __ mov(result, ToOperand(instr->object())); | 4361 __ mov(result, ToOperand(instr->object())); |
4362 } | 4362 } |
4363 | 4363 |
4364 LOperand* key = instr->key(); | 4364 LOperand* key = instr->key(); |
4365 if (key->IsConstantOperand()) { | 4365 if (key->IsConstantOperand()) { |
4366 __ mov(ebx, ToImmediate(key, Representation::Smi())); | 4366 LConstantOperand* constant_key = LConstantOperand::cast(key); |
| 4367 int32_t int_key = ToInteger32(constant_key); |
| 4368 if (Smi::IsValid(int_key)) { |
| 4369 __ mov(ebx, Immediate(Smi::FromInt(int_key))); |
| 4370 } else { |
| 4371 // We should never get here at runtime because there is a smi check on |
| 4372 // the key before this point. |
| 4373 __ int3(); |
| 4374 } |
4367 } else { | 4375 } else { |
4368 __ Move(ebx, ToRegister(key)); | 4376 __ Move(ebx, ToRegister(key)); |
4369 __ SmiTag(ebx); | 4377 __ SmiTag(ebx); |
4370 } | 4378 } |
4371 | 4379 |
4372 GrowArrayElementsStub stub(isolate(), instr->hydrogen()->is_js_array(), | 4380 GrowArrayElementsStub stub(isolate(), instr->hydrogen()->is_js_array(), |
4373 instr->hydrogen()->kind()); | 4381 instr->hydrogen()->kind()); |
4374 __ CallStub(&stub); | 4382 __ CallStub(&stub); |
4375 RecordSafepointWithLazyDeopt( | 4383 RecordSafepointWithLazyDeopt( |
4376 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); | 4384 instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS); |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5825 __ bind(deferred->exit()); | 5833 __ bind(deferred->exit()); |
5826 __ bind(&done); | 5834 __ bind(&done); |
5827 } | 5835 } |
5828 | 5836 |
5829 #undef __ | 5837 #undef __ |
5830 | 5838 |
5831 } // namespace internal | 5839 } // namespace internal |
5832 } // namespace v8 | 5840 } // namespace v8 |
5833 | 5841 |
5834 #endif // V8_TARGET_ARCH_X87 | 5842 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |