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 5871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5882 // backpatching it with the spill slot operands. | 5882 // backpatching it with the spill slot operands. |
5883 DCHECK(!environment->HasBeenRegistered()); | 5883 DCHECK(!environment->HasBeenRegistered()); |
5884 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 5884 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
5885 | 5885 |
5886 GenerateOsrPrologue(); | 5886 GenerateOsrPrologue(); |
5887 } | 5887 } |
5888 | 5888 |
5889 | 5889 |
5890 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { | 5890 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
5891 DCHECK(ToRegister(instr->context()).is(esi)); | 5891 DCHECK(ToRegister(instr->context()).is(esi)); |
5892 __ test(eax, Immediate(kSmiTagMask)); | |
5893 DeoptimizeIf(zero, instr, Deoptimizer::kSmi); | |
5894 | |
5895 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | |
5896 __ CmpObjectType(eax, JS_PROXY_TYPE, ecx); | |
5897 DeoptimizeIf(below_equal, instr, Deoptimizer::kWrongInstanceType); | |
5898 | 5892 |
5899 Label use_cache, call_runtime; | 5893 Label use_cache, call_runtime; |
5900 __ CheckEnumCache(&call_runtime); | 5894 __ CheckEnumCache(&call_runtime); |
5901 | 5895 |
5902 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); | 5896 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); |
5903 __ jmp(&use_cache, Label::kNear); | 5897 __ jmp(&use_cache, Label::kNear); |
5904 | 5898 |
5905 // Get the set of properties to enumerate. | 5899 // Get the set of properties to enumerate. |
5906 __ bind(&call_runtime); | 5900 __ bind(&call_runtime); |
5907 __ push(eax); | 5901 __ push(eax); |
5908 CallRuntime(Runtime::kGetPropertyNamesFast, instr); | 5902 CallRuntime(Runtime::kGetPropertyNamesFast, instr); |
5909 | |
5910 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), | |
5911 isolate()->factory()->meta_map()); | |
5912 DeoptimizeIf(not_equal, instr, Deoptimizer::kWrongMap); | |
5913 __ bind(&use_cache); | 5903 __ bind(&use_cache); |
5914 } | 5904 } |
5915 | 5905 |
5916 | 5906 |
5917 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { | 5907 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { |
5918 Register map = ToRegister(instr->map()); | 5908 Register map = ToRegister(instr->map()); |
5919 Register result = ToRegister(instr->result()); | 5909 Register result = ToRegister(instr->result()); |
5920 Label load_cache, done; | 5910 Label load_cache, done; |
5921 __ EnumLength(result, map); | 5911 __ EnumLength(result, map); |
5922 __ cmp(result, Immediate(Smi::FromInt(0))); | 5912 __ cmp(result, Immediate(Smi::FromInt(0))); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6030 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6020 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6031 } | 6021 } |
6032 | 6022 |
6033 | 6023 |
6034 #undef __ | 6024 #undef __ |
6035 | 6025 |
6036 } // namespace internal | 6026 } // namespace internal |
6037 } // namespace v8 | 6027 } // namespace v8 |
6038 | 6028 |
6039 #endif // V8_TARGET_ARCH_X87 | 6029 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |