| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/assembler_macros.h" | 9 #include "vm/assembler_macros.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 __ Bind(&L); | 983 __ Bind(&L); |
| 984 // Setup frame, push callee-saved registers. | 984 // Setup frame, push callee-saved registers. |
| 985 __ EnterCallRuntimeFrame(0); | 985 __ EnterCallRuntimeFrame(0); |
| 986 __ movq(RDI, FieldAddress(CTX, Context::isolate_offset())); | 986 __ movq(RDI, FieldAddress(CTX, Context::isolate_offset())); |
| 987 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry); | 987 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry); |
| 988 __ LeaveCallRuntimeFrame(); | 988 __ LeaveCallRuntimeFrame(); |
| 989 __ ret(); | 989 __ ret(); |
| 990 } | 990 } |
| 991 | 991 |
| 992 | 992 |
| 993 void StubCode::GenerateMethodExtractor(Assembler* assembler, |
| 994 const Function& closure_function) { |
| 995 const Immediate raw_null = |
| 996 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 997 |
| 998 AssemblerMacros::EnterStubFrame(assembler); |
| 999 __ movq(RAX, Address(RBP, 2 * kWordSize)); |
| 1000 __ pushq(RAX); // Push receiver. |
| 1001 |
| 1002 __ LoadClass(R10, RAX); |
| 1003 // Compute instance type arguments into R13. |
| 1004 Label has_no_type_arguments; |
| 1005 __ movq(R13, raw_null); |
| 1006 __ movq(RDI, FieldAddress(R10, |
| 1007 Class::type_arguments_field_offset_in_words_offset())); |
| 1008 __ cmpq(RDI, Immediate(Class::kNoTypeArguments)); |
| 1009 __ j(EQUAL, &has_no_type_arguments, Assembler::kNearJump); |
| 1010 __ movq(R13, FieldAddress(RAX, RDI, TIMES_8, 0)); |
| 1011 __ Bind(&has_no_type_arguments); |
| 1012 __ pushq(R13); // Push type arguments. |
| 1013 |
| 1014 const Code& stub = Code::Handle( |
| 1015 GetAllocationStubForClosure( |
| 1016 Function::ZoneHandle(closure_function.raw()))); |
| 1017 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); |
| 1018 __ call(&label); |
| 1019 __ Drop(2); // Drop receiver and type arguments. |
| 1020 __ LeaveFrame(); |
| 1021 __ ret(); |
| 1022 } |
| 1023 |
| 1024 |
| 993 // Called for inline allocation of objects. | 1025 // Called for inline allocation of objects. |
| 994 // Input parameters: | 1026 // Input parameters: |
| 995 // RSP + 16 : type arguments object (only if class is parameterized). | 1027 // RSP + 16 : type arguments object (only if class is parameterized). |
| 996 // RSP + 8 : type arguments of instantiator (only if class is parameterized). | 1028 // RSP + 8 : type arguments of instantiator (only if class is parameterized). |
| 997 // RSP : points to return address. | 1029 // RSP : points to return address. |
| 998 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, | 1030 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
| 999 const Class& cls) { | 1031 const Class& cls) { |
| 1000 const intptr_t kObjectTypeArgumentsOffset = 2 * kWordSize; | 1032 const intptr_t kObjectTypeArgumentsOffset = 2 * kWordSize; |
| 1001 const intptr_t kInstantiatorTypeArgumentsOffset = 1 * kWordSize; | 1033 const intptr_t kInstantiatorTypeArgumentsOffset = 1 * kWordSize; |
| 1002 const Immediate raw_null = | 1034 const Immediate raw_null = |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2066 __ cmpq(left, right); | 2098 __ cmpq(left, right); |
| 2067 __ Bind(&done); | 2099 __ Bind(&done); |
| 2068 __ popq(right); | 2100 __ popq(right); |
| 2069 __ popq(left); | 2101 __ popq(left); |
| 2070 __ ret(); | 2102 __ ret(); |
| 2071 } | 2103 } |
| 2072 | 2104 |
| 2073 } // namespace dart | 2105 } // namespace dart |
| 2074 | 2106 |
| 2075 #endif // defined TARGET_ARCH_X64 | 2107 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |