Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: runtime/vm/stub_code_arm64.cc

Issue 1288953003: Port "Add mapping from address to id for runtime functions." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 __ ldr(R7, Address(R1)); 416 __ ldr(R7, Address(R1));
417 __ AddImmediate(R1, R1, -kWordSize); 417 __ AddImmediate(R1, R1, -kWordSize);
418 __ AddImmediate(R3, R3, kWordSize); 418 __ AddImmediate(R3, R3, kWordSize);
419 __ AddImmediateSetFlags(R2, R2, -Smi::RawValue(1)); 419 __ AddImmediateSetFlags(R2, R2, -Smi::RawValue(1));
420 __ str(R7, Address(R3, -kWordSize)); 420 __ str(R7, Address(R3, -kWordSize));
421 __ b(&loop, GE); 421 __ b(&loop, GE);
422 __ Bind(&loop_exit); 422 __ Bind(&loop_exit);
423 } 423 }
424 424
425 425
426 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
427 intptr_t deopt_reason,
428 uword saved_registers_address);
429
430 DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
431
432
433 // Used by eager and lazy deoptimization. Preserve result in RAX if necessary. 426 // Used by eager and lazy deoptimization. Preserve result in RAX if necessary.
434 // This stub translates optimized frame into unoptimized frame. The optimized 427 // This stub translates optimized frame into unoptimized frame. The optimized
435 // frame can contain values in registers and on stack, the unoptimized 428 // frame can contain values in registers and on stack, the unoptimized
436 // frame contains all values on stack. 429 // frame contains all values on stack.
437 // Deoptimization occurs in following steps: 430 // Deoptimization occurs in following steps:
438 // - Push all registers that can contain values. 431 // - Push all registers that can contain values.
439 // - Call C routine to copy the stack and saved registers into temporary buffer. 432 // - Call C routine to copy the stack and saved registers into temporary buffer.
440 // - Adjust caller's frame to correct unoptimized frame size. 433 // - Adjust caller's frame to correct unoptimized frame size.
441 // - Fill the unoptimized frame. 434 // - Fill the unoptimized frame.
442 // - Materialize objects that require allocation (e.g. Double instances). 435 // - Materialize objects that require allocation (e.g. Double instances).
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context. 1005 __ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context.
1013 __ Drop(1); // Pop number of context variables argument. 1006 __ Drop(1); // Pop number of context variables argument.
1014 __ Pop(R0); // Pop the new context object. 1007 __ Pop(R0); // Pop the new context object.
1015 // R0: new object 1008 // R0: new object
1016 // Restore the frame pointer. 1009 // Restore the frame pointer.
1017 __ LeaveStubFrame(); 1010 __ LeaveStubFrame();
1018 __ ret(); 1011 __ ret();
1019 } 1012 }
1020 1013
1021 1014
1022 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
1023
1024 // Helper stub to implement Assembler::StoreIntoObject. 1015 // Helper stub to implement Assembler::StoreIntoObject.
1025 // Input parameters: 1016 // Input parameters:
1026 // R0: Address being stored 1017 // R0: Address being stored
1027 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { 1018 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
1028 Label add_to_buffer; 1019 Label add_to_buffer;
1029 // Check whether this object has already been remembered. Skip adding to the 1020 // Check whether this object has already been remembered. Skip adding to the
1030 // store buffer if the object is in the store buffer already. 1021 // store buffer if the object is in the store buffer already.
1031 __ LoadFieldFromOffset(TMP, R0, Object::tags_offset()); 1022 __ LoadFieldFromOffset(TMP, R0, Object::tags_offset());
1032 __ tsti(TMP, Immediate(1 << RawObject::kRememberedBit)); 1023 __ tsti(TMP, Immediate(1 << RawObject::kRememberedBit));
1033 __ b(&add_to_buffer, EQ); 1024 __ b(&add_to_buffer, EQ);
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 __ Pop(R0); // Get Code object 1972 __ Pop(R0); // Get Code object
1982 __ Pop(R4); // Restore argument descriptor. 1973 __ Pop(R4); // Restore argument descriptor.
1983 __ LoadFieldFromOffset(R0, R0, Code::instructions_offset()); 1974 __ LoadFieldFromOffset(R0, R0, Code::instructions_offset());
1984 __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag); 1975 __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
1985 __ LeaveStubFrame(); 1976 __ LeaveStubFrame();
1986 __ br(R0); 1977 __ br(R0);
1987 __ brk(0); 1978 __ brk(0);
1988 } 1979 }
1989 1980
1990 1981
1991 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
1992 BigintCompare,
1993 RawBigint* left,
1994 RawBigint* right);
1995
1996
1997 // Does identical check (object references are equal or not equal) with special 1982 // Does identical check (object references are equal or not equal) with special
1998 // checks for boxed numbers. 1983 // checks for boxed numbers.
1999 // Left and right are pushed on stack. 1984 // Left and right are pushed on stack.
2000 // Return Zero condition flag set if equal. 1985 // Return Zero condition flag set if equal.
2001 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint 1986 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint
2002 // cannot contain a value that fits in Mint or Smi. 1987 // cannot contain a value that fits in Mint or Smi.
2003 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, 1988 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler,
2004 const Register left, 1989 const Register left,
2005 const Register right) { 1990 const Register right) {
2006 Label reference_compare, done, check_mint, check_bigint; 1991 Label reference_compare, done, check_mint, check_bigint;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 // Result: 2136 // Result:
2152 // R1: entry point. 2137 // R1: entry point.
2153 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { 2138 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
2154 EmitMegamorphicLookup(assembler, R0, R1, R1); 2139 EmitMegamorphicLookup(assembler, R0, R1, R1);
2155 __ ret(); 2140 __ ret();
2156 } 2141 }
2157 2142
2158 } // namespace dart 2143 } // namespace dart
2159 2144
2160 #endif // defined TARGET_ARCH_ARM64 2145 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698