| 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_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 Label loop; | 380 Label loop; |
| 381 __ Bind(&loop); | 381 __ Bind(&loop); |
| 382 __ ldr(IP, Address(R1, kWordSize, Address::PreIndex)); | 382 __ ldr(IP, Address(R1, kWordSize, Address::PreIndex)); |
| 383 __ InitializeFieldNoBarrier(R0, Address(R3, R2, LSL, 1), IP); | 383 __ InitializeFieldNoBarrier(R0, Address(R3, R2, LSL, 1), IP); |
| 384 __ Bind(&enter); | 384 __ Bind(&enter); |
| 385 __ subs(R2, R2, Operand(Smi::RawValue(1))); // R2 is Smi. | 385 __ subs(R2, R2, Operand(Smi::RawValue(1))); // R2 is Smi. |
| 386 __ b(&loop, PL); | 386 __ b(&loop, PL); |
| 387 } | 387 } |
| 388 | 388 |
| 389 | 389 |
| 390 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame, | |
| 391 intptr_t deopt_reason, | |
| 392 uword saved_registers_address); | |
| 393 | |
| 394 DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp); | |
| 395 | |
| 396 | |
| 397 // Used by eager and lazy deoptimization. Preserve result in R0 if necessary. | 390 // Used by eager and lazy deoptimization. Preserve result in R0 if necessary. |
| 398 // This stub translates optimized frame into unoptimized frame. The optimized | 391 // This stub translates optimized frame into unoptimized frame. The optimized |
| 399 // frame can contain values in registers and on stack, the unoptimized | 392 // frame can contain values in registers and on stack, the unoptimized |
| 400 // frame contains all values on stack. | 393 // frame contains all values on stack. |
| 401 // Deoptimization occurs in following steps: | 394 // Deoptimization occurs in following steps: |
| 402 // - Push all registers that can contain values. | 395 // - Push all registers that can contain values. |
| 403 // - Call C routine to copy the stack and saved registers into temporary buffer. | 396 // - Call C routine to copy the stack and saved registers into temporary buffer. |
| 404 // - Adjust caller's frame to correct unoptimized frame size. | 397 // - Adjust caller's frame to correct unoptimized frame size. |
| 405 // - Fill the unoptimized frame. | 398 // - Fill the unoptimized frame. |
| 406 // - Materialize objects that require allocation (e.g. Double instances). | 399 // - Materialize objects that require allocation (e.g. Double instances). |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. | 948 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. |
| 956 __ Drop(1); // Pop number of context variables argument. | 949 __ Drop(1); // Pop number of context variables argument. |
| 957 __ Pop(R0); // Pop the new context object. | 950 __ Pop(R0); // Pop the new context object. |
| 958 // R0: new object | 951 // R0: new object |
| 959 // Restore the frame pointer. | 952 // Restore the frame pointer. |
| 960 __ LeaveStubFrame(); | 953 __ LeaveStubFrame(); |
| 961 __ Ret(); | 954 __ Ret(); |
| 962 } | 955 } |
| 963 | 956 |
| 964 | 957 |
| 965 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); | |
| 966 | |
| 967 // Helper stub to implement Assembler::StoreIntoObject. | 958 // Helper stub to implement Assembler::StoreIntoObject. |
| 968 // Input parameters: | 959 // Input parameters: |
| 969 // R0: address (i.e. object) being stored into. | 960 // R0: address (i.e. object) being stored into. |
| 970 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { | 961 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { |
| 971 // Save values being destroyed. | 962 // Save values being destroyed. |
| 972 __ PushList((1 << R1) | (1 << R2) | (1 << R3)); | 963 __ PushList((1 << R1) | (1 << R2) | (1 << R3)); |
| 973 | 964 |
| 974 Label add_to_buffer; | 965 Label add_to_buffer; |
| 975 // Check whether this object has already been remembered. Skip adding to the | 966 // Check whether this object has already been remembered. Skip adding to the |
| 976 // store buffer if the object is in the store buffer already. | 967 // store buffer if the object is in the store buffer already. |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 __ Pop(R0); // Get Code object | 1904 __ Pop(R0); // Get Code object |
| 1914 __ Pop(R4); // Restore argument descriptor. | 1905 __ Pop(R4); // Restore argument descriptor. |
| 1915 __ ldr(R0, FieldAddress(R0, Code::instructions_offset())); | 1906 __ ldr(R0, FieldAddress(R0, Code::instructions_offset())); |
| 1916 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); | 1907 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); |
| 1917 __ LeaveStubFrame(); | 1908 __ LeaveStubFrame(); |
| 1918 __ bx(R0); | 1909 __ bx(R0); |
| 1919 __ bkpt(0); | 1910 __ bkpt(0); |
| 1920 } | 1911 } |
| 1921 | 1912 |
| 1922 | 1913 |
| 1923 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, | |
| 1924 BigintCompare, | |
| 1925 RawBigint* left, | |
| 1926 RawBigint* right); | |
| 1927 | |
| 1928 | |
| 1929 // Does identical check (object references are equal or not equal) with special | 1914 // Does identical check (object references are equal or not equal) with special |
| 1930 // checks for boxed numbers. | 1915 // checks for boxed numbers. |
| 1931 // LR: return address. | 1916 // LR: return address. |
| 1932 // Return Zero condition flag set if equal. | 1917 // Return Zero condition flag set if equal. |
| 1933 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint | 1918 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint |
| 1934 // cannot contain a value that fits in Mint or Smi. | 1919 // cannot contain a value that fits in Mint or Smi. |
| 1935 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, | 1920 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, |
| 1936 const Register left, | 1921 const Register left, |
| 1937 const Register right, | 1922 const Register right, |
| 1938 const Register temp) { | 1923 const Register temp) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2094 // Result: | 2079 // Result: |
| 2095 // R1: entry point. | 2080 // R1: entry point. |
| 2096 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2081 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2097 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2082 EmitMegamorphicLookup(assembler, R0, R1, R1); |
| 2098 __ Ret(); | 2083 __ Ret(); |
| 2099 } | 2084 } |
| 2100 | 2085 |
| 2101 } // namespace dart | 2086 } // namespace dart |
| 2102 | 2087 |
| 2103 #endif // defined TARGET_ARCH_ARM | 2088 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |