| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 // Convert the object to a JS object. | 1114 // Convert the object to a JS object. |
| 1115 Label convert, done_convert; | 1115 Label convert, done_convert; |
| 1116 __ JumpIfSmi(a0, &convert); | 1116 __ JumpIfSmi(a0, &convert); |
| 1117 __ GetObjectType(a0, a1, a1); | 1117 __ GetObjectType(a0, a1, a1); |
| 1118 __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); | 1118 __ Branch(&done_convert, ge, a1, Operand(FIRST_SPEC_OBJECT_TYPE)); |
| 1119 __ bind(&convert); | 1119 __ bind(&convert); |
| 1120 __ push(a0); | 1120 __ push(a0); |
| 1121 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1121 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
| 1122 __ mov(a0, v0); | 1122 __ mov(a0, v0); |
| 1123 __ bind(&done_convert); | 1123 __ bind(&done_convert); |
| 1124 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
| 1124 __ push(a0); | 1125 __ push(a0); |
| 1125 | 1126 |
| 1126 // Check for proxies. | 1127 // Check for proxies. |
| 1127 Label call_runtime; | 1128 Label call_runtime; |
| 1128 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1129 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
| 1129 __ GetObjectType(a0, a1, a1); | 1130 __ GetObjectType(a0, a1, a1); |
| 1130 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE)); | 1131 __ Branch(&call_runtime, le, a1, Operand(LAST_JS_PROXY_TYPE)); |
| 1131 | 1132 |
| 1132 // Check cache validity in generated code. This is a fast case for | 1133 // Check cache validity in generated code. This is a fast case for |
| 1133 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1134 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
| 1134 // guarantee cache validity, call the runtime system to check cache | 1135 // guarantee cache validity, call the runtime system to check cache |
| 1135 // validity or get the property names in a fixed array. | 1136 // validity or get the property names in a fixed array. |
| 1136 __ CheckEnumCache(null_value, &call_runtime); | 1137 __ CheckEnumCache(null_value, &call_runtime); |
| 1137 | 1138 |
| 1138 // The enum cache is valid. Load the map of the object being | 1139 // The enum cache is valid. Load the map of the object being |
| 1139 // iterated over and use the cache for the iteration. | 1140 // iterated over and use the cache for the iteration. |
| 1140 Label use_cache; | 1141 Label use_cache; |
| 1141 __ lw(v0, FieldMemOperand(a0, HeapObject::kMapOffset)); | 1142 __ lw(v0, FieldMemOperand(a0, HeapObject::kMapOffset)); |
| 1142 __ Branch(&use_cache); | 1143 __ Branch(&use_cache); |
| 1143 | 1144 |
| 1144 // Get the set of properties to enumerate. | 1145 // Get the set of properties to enumerate. |
| 1145 __ bind(&call_runtime); | 1146 __ bind(&call_runtime); |
| 1146 __ push(a0); // Duplicate the enumerable object on the stack. | 1147 __ push(a0); // Duplicate the enumerable object on the stack. |
| 1147 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); | 1148 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); |
| 1149 PrepareForBailoutForId(stmt->EnumId(), TOS_REG); |
| 1148 | 1150 |
| 1149 // If we got a map from the runtime call, we can do a fast | 1151 // If we got a map from the runtime call, we can do a fast |
| 1150 // modification check. Otherwise, we got a fixed array, and we have | 1152 // modification check. Otherwise, we got a fixed array, and we have |
| 1151 // to do a slow check. | 1153 // to do a slow check. |
| 1152 Label fixed_array; | 1154 Label fixed_array; |
| 1153 __ lw(a2, FieldMemOperand(v0, HeapObject::kMapOffset)); | 1155 __ lw(a2, FieldMemOperand(v0, HeapObject::kMapOffset)); |
| 1154 __ LoadRoot(at, Heap::kMetaMapRootIndex); | 1156 __ LoadRoot(at, Heap::kMetaMapRootIndex); |
| 1155 __ Branch(&fixed_array, ne, a2, Operand(at)); | 1157 __ Branch(&fixed_array, ne, a2, Operand(at)); |
| 1156 | 1158 |
| 1157 // We got a map in register v0. Get the enumeration cache from it. | 1159 // We got a map in register v0. Get the enumeration cache from it. |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 int properties_count = constant_properties->length() / 2; | 1678 int properties_count = constant_properties->length() / 2; |
| 1677 if (expr->may_store_doubles() || expr->depth() > 1 || | 1679 if (expr->may_store_doubles() || expr->depth() > 1 || |
| 1678 masm()->serializer_enabled() || flags != ObjectLiteral::kFastElements || | 1680 masm()->serializer_enabled() || flags != ObjectLiteral::kFastElements || |
| 1679 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1681 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
| 1680 __ Push(a3, a2, a1, a0); | 1682 __ Push(a3, a2, a1, a0); |
| 1681 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1683 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
| 1682 } else { | 1684 } else { |
| 1683 FastCloneShallowObjectStub stub(isolate(), properties_count); | 1685 FastCloneShallowObjectStub stub(isolate(), properties_count); |
| 1684 __ CallStub(&stub); | 1686 __ CallStub(&stub); |
| 1685 } | 1687 } |
| 1688 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
| 1686 | 1689 |
| 1687 // If result_saved is true the result is on top of the stack. If | 1690 // If result_saved is true the result is on top of the stack. If |
| 1688 // result_saved is false the result is in v0. | 1691 // result_saved is false the result is in v0. |
| 1689 bool result_saved = false; | 1692 bool result_saved = false; |
| 1690 | 1693 |
| 1691 // Mark all computed expressions that are bound to a key that | 1694 // Mark all computed expressions that are bound to a key that |
| 1692 // is shadowed by a later occurrence of the same key. For the | 1695 // is shadowed by a later occurrence of the same key. For the |
| 1693 // marked expressions, no store code is emitted. | 1696 // marked expressions, no store code is emitted. |
| 1694 expr->CalculateEmitStore(zone()); | 1697 expr->CalculateEmitStore(zone()); |
| 1695 | 1698 |
| (...skipping 3507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5203 Assembler::target_address_at(pc_immediate_load_address)) == | 5206 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5204 reinterpret_cast<uint32_t>( | 5207 reinterpret_cast<uint32_t>( |
| 5205 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5208 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5206 return OSR_AFTER_STACK_CHECK; | 5209 return OSR_AFTER_STACK_CHECK; |
| 5207 } | 5210 } |
| 5208 | 5211 |
| 5209 | 5212 |
| 5210 } } // namespace v8::internal | 5213 } } // namespace v8::internal |
| 5211 | 5214 |
| 5212 #endif // V8_TARGET_ARCH_MIPS | 5215 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |