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/ast/scopes.h" | 7 #include "src/ast/scopes.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/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 __ j(above_equal, &done_convert, Label::kNear); | 976 __ j(above_equal, &done_convert, Label::kNear); |
977 __ bind(&convert); | 977 __ bind(&convert); |
978 ToObjectStub stub(isolate()); | 978 ToObjectStub stub(isolate()); |
979 __ CallStub(&stub); | 979 __ CallStub(&stub); |
980 __ bind(&done_convert); | 980 __ bind(&done_convert); |
981 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); | 981 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
982 __ push(eax); | 982 __ push(eax); |
983 | 983 |
984 // Check for proxies. | 984 // Check for proxies. |
985 Label call_runtime, use_cache, fixed_array; | 985 Label call_runtime, use_cache, fixed_array; |
986 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 986 __ CmpObjectType(eax, JS_PROXY_TYPE, ecx); |
987 __ CmpObjectType(eax, LAST_JS_PROXY_TYPE, ecx); | 987 __ j(equal, &call_runtime); |
988 __ j(below_equal, &call_runtime); | |
989 | 988 |
990 // Check cache validity in generated code. This is a fast case for | 989 // Check cache validity in generated code. This is a fast case for |
991 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 990 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
992 // guarantee cache validity, call the runtime system to check cache | 991 // guarantee cache validity, call the runtime system to check cache |
993 // validity or get the property names in a fixed array. | 992 // validity or get the property names in a fixed array. |
994 __ CheckEnumCache(&call_runtime); | 993 __ CheckEnumCache(&call_runtime); |
995 | 994 |
996 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); | 995 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); |
997 __ jmp(&use_cache, Label::kNear); | 996 __ jmp(&use_cache, Label::kNear); |
998 | 997 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 __ bind(&fixed_array); | 1033 __ bind(&fixed_array); |
1035 | 1034 |
1036 // No need for a write barrier, we are storing a Smi in the feedback vector. | 1035 // No need for a write barrier, we are storing a Smi in the feedback vector. |
1037 __ EmitLoadTypeFeedbackVector(ebx); | 1036 __ EmitLoadTypeFeedbackVector(ebx); |
1038 int vector_index = SmiFromSlot(slot)->value(); | 1037 int vector_index = SmiFromSlot(slot)->value(); |
1039 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(vector_index)), | 1038 __ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(vector_index)), |
1040 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1039 Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1041 | 1040 |
1042 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check | 1041 __ mov(ebx, Immediate(Smi::FromInt(1))); // Smi indicates slow check |
1043 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object | 1042 __ mov(ecx, Operand(esp, 0 * kPointerSize)); // Get enumerated object |
1044 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 1043 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); |
1045 __ CmpObjectType(ecx, LAST_JS_PROXY_TYPE, ecx); | 1044 __ CmpObjectType(ecx, JS_PROXY_TYPE, ecx); |
1046 __ j(above, &non_proxy); | 1045 __ j(above, &non_proxy); |
1047 __ Move(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy | 1046 __ Move(ebx, Immediate(Smi::FromInt(0))); // Zero indicates proxy |
1048 __ bind(&non_proxy); | 1047 __ bind(&non_proxy); |
1049 __ push(ebx); // Smi | 1048 __ push(ebx); // Smi |
1050 __ push(eax); // Array | 1049 __ push(eax); // Array |
1051 __ mov(eax, FieldOperand(eax, FixedArray::kLengthOffset)); | 1050 __ mov(eax, FieldOperand(eax, FixedArray::kLengthOffset)); |
1052 __ push(eax); // Fixed array length (as smi). | 1051 __ push(eax); // Fixed array length (as smi). |
1053 __ push(Immediate(Smi::FromInt(0))); // Initial index. | 1052 __ push(Immediate(Smi::FromInt(0))); // Initial index. |
1054 | 1053 |
1055 // Generate code for doing the condition check. | 1054 // Generate code for doing the condition check. |
(...skipping 2076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3132 | 3131 |
3133 VisitForAccumulatorValue(args->at(0)); | 3132 VisitForAccumulatorValue(args->at(0)); |
3134 | 3133 |
3135 Label materialize_true, materialize_false; | 3134 Label materialize_true, materialize_false; |
3136 Label* if_true = NULL; | 3135 Label* if_true = NULL; |
3137 Label* if_false = NULL; | 3136 Label* if_false = NULL; |
3138 Label* fall_through = NULL; | 3137 Label* fall_through = NULL; |
3139 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3138 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
3140 &if_false, &fall_through); | 3139 &if_false, &fall_through); |
3141 | 3140 |
| 3141 |
3142 __ JumpIfSmi(eax, if_false); | 3142 __ JumpIfSmi(eax, if_false); |
3143 Register map = ebx; | 3143 __ CmpObjectType(eax, JS_PROXY_TYPE, ebx); |
3144 __ mov(map, FieldOperand(eax, HeapObject::kMapOffset)); | |
3145 __ CmpInstanceType(map, FIRST_JS_PROXY_TYPE); | |
3146 __ j(less, if_false); | |
3147 __ CmpInstanceType(map, LAST_JS_PROXY_TYPE); | |
3148 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3144 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3149 Split(less_equal, if_true, if_false, fall_through); | 3145 Split(equal, if_true, if_false, fall_through); |
3150 | 3146 |
3151 context()->Plug(if_true, if_false); | 3147 context()->Plug(if_true, if_false); |
3152 } | 3148 } |
3153 | 3149 |
3154 | 3150 |
3155 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 3151 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
3156 ZoneList<Expression*>* args = expr->arguments(); | 3152 ZoneList<Expression*>* args = expr->arguments(); |
3157 DCHECK(args->length() == 2); | 3153 DCHECK(args->length() == 2); |
3158 | 3154 |
3159 // Load the two objects into registers and perform the comparison. | 3155 // Load the two objects into registers and perform the comparison. |
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4832 Assembler::target_address_at(call_target_address, | 4828 Assembler::target_address_at(call_target_address, |
4833 unoptimized_code)); | 4829 unoptimized_code)); |
4834 return OSR_AFTER_STACK_CHECK; | 4830 return OSR_AFTER_STACK_CHECK; |
4835 } | 4831 } |
4836 | 4832 |
4837 | 4833 |
4838 } // namespace internal | 4834 } // namespace internal |
4839 } // namespace v8 | 4835 } // namespace v8 |
4840 | 4836 |
4841 #endif // V8_TARGET_ARCH_X87 | 4837 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |