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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 4797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4808 __ FastAllocate(size, result, temp, flags); | 4808 __ FastAllocate(size, result, temp, flags); |
4809 } | 4809 } |
4810 } | 4810 } |
4811 | 4811 |
4812 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { | 4812 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { |
4813 Register result = ToRegister(instr->result()); | 4813 Register result = ToRegister(instr->result()); |
4814 | 4814 |
4815 // TODO(3095996): Get rid of this. For now, we need to make the | 4815 // TODO(3095996): Get rid of this. For now, we need to make the |
4816 // result register contain a valid pointer because it is already | 4816 // result register contain a valid pointer because it is already |
4817 // contained in the register pointer map. | 4817 // contained in the register pointer map. |
4818 __ Move(result, Immediate(Smi::FromInt(0))); | 4818 __ Move(result, Immediate(Smi::kZero)); |
4819 | 4819 |
4820 PushSafepointRegistersScope scope(this); | 4820 PushSafepointRegistersScope scope(this); |
4821 if (instr->size()->IsRegister()) { | 4821 if (instr->size()->IsRegister()) { |
4822 Register size = ToRegister(instr->size()); | 4822 Register size = ToRegister(instr->size()); |
4823 DCHECK(!size.is(result)); | 4823 DCHECK(!size.is(result)); |
4824 __ SmiTag(ToRegister(instr->size())); | 4824 __ SmiTag(ToRegister(instr->size())); |
4825 __ push(size); | 4825 __ push(size); |
4826 } else { | 4826 } else { |
4827 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 4827 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
4828 if (size >= 0 && size <= Smi::kMaxValue) { | 4828 if (size >= 0 && size <= Smi::kMaxValue) { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5112 CallRuntime(Runtime::kForInEnumerate, instr); | 5112 CallRuntime(Runtime::kForInEnumerate, instr); |
5113 __ bind(&use_cache); | 5113 __ bind(&use_cache); |
5114 } | 5114 } |
5115 | 5115 |
5116 | 5116 |
5117 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { | 5117 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
5118 Register map = ToRegister(instr->map()); | 5118 Register map = ToRegister(instr->map()); |
5119 Register result = ToRegister(instr->result()); | 5119 Register result = ToRegister(instr->result()); |
5120 Label load_cache, done; | 5120 Label load_cache, done; |
5121 __ EnumLength(result, map); | 5121 __ EnumLength(result, map); |
5122 __ cmp(result, Immediate(Smi::FromInt(0))); | 5122 __ cmp(result, Immediate(Smi::kZero)); |
5123 __ j(not_equal, &load_cache, Label::kNear); | 5123 __ j(not_equal, &load_cache, Label::kNear); |
5124 __ mov(result, isolate()->factory()->empty_fixed_array()); | 5124 __ mov(result, isolate()->factory()->empty_fixed_array()); |
5125 __ jmp(&done, Label::kNear); | 5125 __ jmp(&done, Label::kNear); |
5126 | 5126 |
5127 __ bind(&load_cache); | 5127 __ bind(&load_cache); |
5128 __ LoadInstanceDescriptors(map, result); | 5128 __ LoadInstanceDescriptors(map, result); |
5129 __ mov(result, | 5129 __ mov(result, |
5130 FieldOperand(result, DescriptorArray::kEnumCacheOffset)); | 5130 FieldOperand(result, DescriptorArray::kEnumCacheOffset)); |
5131 __ mov(result, | 5131 __ mov(result, |
5132 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); | 5132 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5213 __ bind(deferred->exit()); | 5213 __ bind(deferred->exit()); |
5214 __ bind(&done); | 5214 __ bind(&done); |
5215 } | 5215 } |
5216 | 5216 |
5217 #undef __ | 5217 #undef __ |
5218 | 5218 |
5219 } // namespace internal | 5219 } // namespace internal |
5220 } // namespace v8 | 5220 } // namespace v8 |
5221 | 5221 |
5222 #endif // V8_TARGET_ARCH_IA32 | 5222 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |