OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 // No generational barrier needed, since array is in new space. | 352 // No generational barrier needed, since array is in new space. |
353 __ InitializeFieldNoBarrier(RAX, Address(RBX, 0), RDI); | 353 __ InitializeFieldNoBarrier(RAX, Address(RBX, 0), RDI); |
354 __ addq(RBX, Immediate(kWordSize)); | 354 __ addq(RBX, Immediate(kWordSize)); |
355 __ subq(R12, Immediate(kWordSize)); | 355 __ subq(R12, Immediate(kWordSize)); |
356 __ Bind(&loop_condition); | 356 __ Bind(&loop_condition); |
357 __ decq(R10); | 357 __ decq(R10); |
358 __ j(POSITIVE, &loop, Assembler::kNearJump); | 358 __ j(POSITIVE, &loop, Assembler::kNearJump); |
359 } | 359 } |
360 | 360 |
361 | 361 |
362 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame, | |
363 intptr_t deopt_reason, | |
364 uword saved_registers_address); | |
365 | |
366 DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp); | |
367 | |
368 | |
369 // Used by eager and lazy deoptimization. Preserve result in RAX if necessary. | 362 // Used by eager and lazy deoptimization. Preserve result in RAX if necessary. |
370 // This stub translates optimized frame into unoptimized frame. The optimized | 363 // This stub translates optimized frame into unoptimized frame. The optimized |
371 // frame can contain values in registers and on stack, the unoptimized | 364 // frame can contain values in registers and on stack, the unoptimized |
372 // frame contains all values on stack. | 365 // frame contains all values on stack. |
373 // Deoptimization occurs in following steps: | 366 // Deoptimization occurs in following steps: |
374 // - Push all registers that can contain values. | 367 // - Push all registers that can contain values. |
375 // - Call C routine to copy the stack and saved registers into temporary buffer. | 368 // - Call C routine to copy the stack and saved registers into temporary buffer. |
376 // - Adjust caller's frame to correct unoptimized frame size. | 369 // - Adjust caller's frame to correct unoptimized frame size. |
377 // - Fill the unoptimized frame. | 370 // - Fill the unoptimized frame. |
378 // - Materialize objects that require allocation (e.g. Double instances). | 371 // - Materialize objects that require allocation (e.g. Double instances). |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. | 956 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. |
964 __ popq(RAX); // Pop number of context variables argument. | 957 __ popq(RAX); // Pop number of context variables argument. |
965 __ popq(RAX); // Pop the new context object. | 958 __ popq(RAX); // Pop the new context object. |
966 // RAX: new object | 959 // RAX: new object |
967 // Restore the frame pointer. | 960 // Restore the frame pointer. |
968 __ LeaveStubFrame(); | 961 __ LeaveStubFrame(); |
969 __ ret(); | 962 __ ret(); |
970 } | 963 } |
971 | 964 |
972 | 965 |
973 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); | |
974 | |
975 // Helper stub to implement Assembler::StoreIntoObject. | 966 // Helper stub to implement Assembler::StoreIntoObject. |
976 // Input parameters: | 967 // Input parameters: |
977 // RDX: Address being stored | 968 // RDX: Address being stored |
978 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { | 969 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { |
979 // Save registers being destroyed. | 970 // Save registers being destroyed. |
980 __ pushq(RAX); | 971 __ pushq(RAX); |
981 __ pushq(RCX); | 972 __ pushq(RCX); |
982 | 973 |
983 Label add_to_buffer; | 974 Label add_to_buffer; |
984 // Check whether this object has already been remembered. Skip adding to the | 975 // Check whether this object has already been remembered. Skip adding to the |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1976 __ popq(RAX); // Get Code object. | 1967 __ popq(RAX); // Get Code object. |
1977 __ popq(R10); // Restore argument descriptor. | 1968 __ popq(R10); // Restore argument descriptor. |
1978 __ movq(RAX, FieldAddress(RAX, Code::instructions_offset())); | 1969 __ movq(RAX, FieldAddress(RAX, Code::instructions_offset())); |
1979 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 1970 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
1980 __ LeaveStubFrame(); | 1971 __ LeaveStubFrame(); |
1981 __ jmp(RAX); | 1972 __ jmp(RAX); |
1982 __ int3(); | 1973 __ int3(); |
1983 } | 1974 } |
1984 | 1975 |
1985 | 1976 |
1986 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, | |
1987 BigintCompare, | |
1988 RawBigint* left, | |
1989 RawBigint* right); | |
1990 | |
1991 | |
1992 // Does identical check (object references are equal or not equal) with special | 1977 // Does identical check (object references are equal or not equal) with special |
1993 // checks for boxed numbers. | 1978 // checks for boxed numbers. |
1994 // Left and right are pushed on stack. | 1979 // Left and right are pushed on stack. |
1995 // Return ZF set. | 1980 // Return ZF set. |
1996 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint | 1981 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint |
1997 // cannot contain a value that fits in Mint or Smi. | 1982 // cannot contain a value that fits in Mint or Smi. |
1998 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, | 1983 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, |
1999 const Register left, | 1984 const Register left, |
2000 const Register right) { | 1985 const Register right) { |
2001 Label reference_compare, done, check_mint, check_bigint; | 1986 Label reference_compare, done, check_mint, check_bigint; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2146 // Result: | 2131 // Result: |
2147 // RCX: entry point. | 2132 // RCX: entry point. |
2148 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2133 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
2149 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); | 2134 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); |
2150 __ ret(); | 2135 __ ret(); |
2151 } | 2136 } |
2152 | 2137 |
2153 } // namespace dart | 2138 } // namespace dart |
2154 | 2139 |
2155 #endif // defined TARGET_ARCH_X64 | 2140 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |