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