OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 __ bge(&done_convert); | 1010 __ bge(&done_convert); |
1011 __ bind(&convert); | 1011 __ bind(&convert); |
1012 ToObjectStub stub(isolate()); | 1012 ToObjectStub stub(isolate()); |
1013 __ CallStub(&stub); | 1013 __ CallStub(&stub); |
1014 __ bind(&done_convert); | 1014 __ bind(&done_convert); |
1015 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); | 1015 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
1016 __ push(r3); | 1016 __ push(r3); |
1017 | 1017 |
1018 // Check for proxies. | 1018 // Check for proxies. |
1019 Label call_runtime; | 1019 Label call_runtime; |
1020 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 1020 __ CompareObjectType(r3, r4, r4, JS_PROXY_TYPE); |
1021 __ CompareObjectType(r3, r4, r4, LAST_JS_PROXY_TYPE); | 1021 __ beq(&call_runtime); |
1022 __ ble(&call_runtime); | |
1023 | 1022 |
1024 // Check cache validity in generated code. This is a fast case for | 1023 // Check cache validity in generated code. This is a fast case for |
1025 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1024 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
1026 // guarantee cache validity, call the runtime system to check cache | 1025 // guarantee cache validity, call the runtime system to check cache |
1027 // validity or get the property names in a fixed array. | 1026 // validity or get the property names in a fixed array. |
1028 __ CheckEnumCache(null_value, &call_runtime); | 1027 __ CheckEnumCache(null_value, &call_runtime); |
1029 | 1028 |
1030 // The enum cache is valid. Load the map of the object being | 1029 // The enum cache is valid. Load the map of the object being |
1031 // iterated over and use the cache for the iteration. | 1030 // iterated over and use the cache for the iteration. |
1032 Label use_cache; | 1031 Label use_cache; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 __ bind(&fixed_array); | 1076 __ bind(&fixed_array); |
1078 | 1077 |
1079 __ EmitLoadTypeFeedbackVector(r4); | 1078 __ EmitLoadTypeFeedbackVector(r4); |
1080 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); | 1079 __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate()))); |
1081 int vector_index = SmiFromSlot(slot)->value(); | 1080 int vector_index = SmiFromSlot(slot)->value(); |
1082 __ StoreP( | 1081 __ StoreP( |
1083 r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0); | 1082 r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0); |
1084 | 1083 |
1085 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi indicates slow check | 1084 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi indicates slow check |
1086 __ LoadP(r5, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object | 1085 __ LoadP(r5, MemOperand(sp, 0 * kPointerSize)); // Get enumerated object |
1087 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); | 1086 STATIC_ASSERT(JS_PROXY_TYPE == FIRST_JS_RECEIVER_TYPE); |
1088 __ CompareObjectType(r5, r6, r6, LAST_JS_PROXY_TYPE); | 1087 __ CompareObjectType(r5, r6, r6, JS_PROXY_TYPE); |
1089 __ bgt(&non_proxy); | 1088 __ bgt(&non_proxy); |
1090 __ LoadSmiLiteral(r4, Smi::FromInt(0)); // Zero indicates proxy | 1089 __ LoadSmiLiteral(r4, Smi::FromInt(0)); // Zero indicates proxy |
1091 __ bind(&non_proxy); | 1090 __ bind(&non_proxy); |
1092 __ Push(r4, r3); // Smi and array | 1091 __ Push(r4, r3); // Smi and array |
1093 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 1092 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
1094 __ LoadSmiLiteral(r3, Smi::FromInt(0)); | 1093 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
1095 __ Push(r4, r3); // Fixed array length (as smi) and initial index. | 1094 __ Push(r4, r3); // Fixed array length (as smi) and initial index. |
1096 | 1095 |
1097 // Generate code for doing the condition check. | 1096 // Generate code for doing the condition check. |
1098 __ bind(&loop); | 1097 __ bind(&loop); |
(...skipping 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3260 VisitForAccumulatorValue(args->at(0)); | 3259 VisitForAccumulatorValue(args->at(0)); |
3261 | 3260 |
3262 Label materialize_true, materialize_false; | 3261 Label materialize_true, materialize_false; |
3263 Label* if_true = NULL; | 3262 Label* if_true = NULL; |
3264 Label* if_false = NULL; | 3263 Label* if_false = NULL; |
3265 Label* fall_through = NULL; | 3264 Label* fall_through = NULL; |
3266 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, | 3265 context()->PrepareTest(&materialize_true, &materialize_false, &if_true, |
3267 &if_false, &fall_through); | 3266 &if_false, &fall_through); |
3268 | 3267 |
3269 __ JumpIfSmi(r3, if_false); | 3268 __ JumpIfSmi(r3, if_false); |
3270 Register map = r4; | 3269 __ CompareObjectType(r3, r4, r4, JS_PROXY_TYPE); |
3271 Register type_reg = r5; | |
3272 __ LoadP(map, FieldMemOperand(r3, HeapObject::kMapOffset)); | |
3273 __ lbz(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | |
3274 __ subi(type_reg, type_reg, Operand(FIRST_JS_PROXY_TYPE)); | |
3275 __ cmpli(type_reg, Operand(LAST_JS_PROXY_TYPE - FIRST_JS_PROXY_TYPE)); | |
3276 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); | 3270 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); |
3277 Split(le, if_true, if_false, fall_through); | 3271 Split(eq, if_true, if_false, fall_through); |
3278 | 3272 |
3279 context()->Plug(if_true, if_false); | 3273 context()->Plug(if_true, if_false); |
3280 } | 3274 } |
3281 | 3275 |
3282 | 3276 |
3283 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { | 3277 void FullCodeGenerator::EmitObjectEquals(CallRuntime* expr) { |
3284 ZoneList<Expression*>* args = expr->arguments(); | 3278 ZoneList<Expression*>* args = expr->arguments(); |
3285 DCHECK(args->length() == 2); | 3279 DCHECK(args->length() == 2); |
3286 | 3280 |
3287 // Load the two objects into registers and perform the comparison. | 3281 // Load the two objects into registers and perform the comparison. |
(...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4919 return ON_STACK_REPLACEMENT; | 4913 return ON_STACK_REPLACEMENT; |
4920 } | 4914 } |
4921 | 4915 |
4922 DCHECK(interrupt_address == | 4916 DCHECK(interrupt_address == |
4923 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4917 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4924 return OSR_AFTER_STACK_CHECK; | 4918 return OSR_AFTER_STACK_CHECK; |
4925 } | 4919 } |
4926 } // namespace internal | 4920 } // namespace internal |
4927 } // namespace v8 | 4921 } // namespace v8 |
4928 #endif // V8_TARGET_ARCH_PPC | 4922 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |