| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 // Restore callee-saved registers, tear down frame. | 1124 // Restore callee-saved registers, tear down frame. |
| 1125 __ LeaveCallRuntimeFrame(); | 1125 __ LeaveCallRuntimeFrame(); |
| 1126 __ ret(); | 1126 __ ret(); |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 | 1129 |
| 1130 // Called for inline allocation of objects. | 1130 // Called for inline allocation of objects. |
| 1131 // Input parameters: | 1131 // Input parameters: |
| 1132 // LR : return address. | 1132 // LR : return address. |
| 1133 // SP + 0 : type arguments object (only if class is parameterized). | 1133 // SP + 0 : type arguments object (only if class is parameterized). |
| 1134 uword StubCode::GenerateAllocationStubForClass(Assembler* assembler, | 1134 void StubCode::GenerateAllocationStubForClass( |
| 1135 const Class& cls) { | 1135 Assembler* assembler, const Class& cls, |
| 1136 uword* entry_patch_offset, uword* patch_code_pc_offset) { |
| 1137 *entry_patch_offset = assembler->CodeSize(); |
| 1136 // The generated code is different if the class is parameterized. | 1138 // The generated code is different if the class is parameterized. |
| 1137 const bool is_cls_parameterized = cls.NumTypeArguments() > 0; | 1139 const bool is_cls_parameterized = cls.NumTypeArguments() > 0; |
| 1138 ASSERT(!is_cls_parameterized || | 1140 ASSERT(!is_cls_parameterized || |
| 1139 (cls.type_arguments_field_offset() != Class::kNoTypeArguments)); | 1141 (cls.type_arguments_field_offset() != Class::kNoTypeArguments)); |
| 1140 // kInlineInstanceSize is a constant used as a threshold for determining | 1142 // kInlineInstanceSize is a constant used as a threshold for determining |
| 1141 // when the object initialization should be done as a loop or as | 1143 // when the object initialization should be done as a loop or as |
| 1142 // straight line code. | 1144 // straight line code. |
| 1143 const int kInlineInstanceSize = 12; | 1145 const int kInlineInstanceSize = 12; |
| 1144 const intptr_t instance_size = cls.instance_size(); | 1146 const intptr_t instance_size = cls.instance_size(); |
| 1145 ASSERT(instance_size > 0); | 1147 ASSERT(instance_size > 0); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 // Push null type arguments. | 1245 // Push null type arguments. |
| 1244 __ PushObject(Object::null_object(), PP); | 1246 __ PushObject(Object::null_object(), PP); |
| 1245 } | 1247 } |
| 1246 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. | 1248 __ CallRuntime(kAllocateObjectRuntimeEntry, 2); // Allocate object. |
| 1247 __ Drop(2); // Pop arguments. | 1249 __ Drop(2); // Pop arguments. |
| 1248 __ Pop(R0); // Pop result (newly allocated object). | 1250 __ Pop(R0); // Pop result (newly allocated object). |
| 1249 // R0: new object | 1251 // R0: new object |
| 1250 // Restore the frame pointer. | 1252 // Restore the frame pointer. |
| 1251 __ LeaveStubFrame(); | 1253 __ LeaveStubFrame(); |
| 1252 __ ret(); | 1254 __ ret(); |
| 1253 uword patch_code_pc_offset = assembler->CodeSize(); | 1255 *patch_code_pc_offset = assembler->CodeSize(); |
| 1254 StubCode* stub_code = Isolate::Current()->stub_code(); | 1256 StubCode* stub_code = Isolate::Current()->stub_code(); |
| 1255 __ BranchPatchable(&stub_code->FixAllocationStubTargetLabel()); | 1257 __ BranchPatchable(&stub_code->FixAllocationStubTargetLabel()); |
| 1256 return patch_code_pc_offset; | |
| 1257 } | 1258 } |
| 1258 | 1259 |
| 1259 | 1260 |
| 1260 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function | 1261 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function |
| 1261 // from the entry code of a dart function after an error in passed argument | 1262 // from the entry code of a dart function after an error in passed argument |
| 1262 // name or number is detected. | 1263 // name or number is detected. |
| 1263 // Input parameters: | 1264 // Input parameters: |
| 1264 // LR : return address. | 1265 // LR : return address. |
| 1265 // SP : address of last argument. | 1266 // SP : address of last argument. |
| 1266 // R4: arguments descriptor array. | 1267 // R4: arguments descriptor array. |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 const Register right = R0; | 2078 const Register right = R0; |
| 2078 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); | 2079 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); |
| 2079 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); | 2080 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); |
| 2080 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2081 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2081 __ ret(); | 2082 __ ret(); |
| 2082 } | 2083 } |
| 2083 | 2084 |
| 2084 } // namespace dart | 2085 } // namespace dart |
| 2085 | 2086 |
| 2086 #endif // defined TARGET_ARCH_ARM64 | 2087 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |