| 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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 __ LeaveFrame(); | 317 __ LeaveFrame(); |
| 318 __ ret(); | 318 __ ret(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 | 321 |
| 322 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { | 322 void StubCode::GenerateAllocateContextStub(Assembler* assembler) { |
| 323 __ Stop("GenerateAllocateContextStub"); | 323 __ Stop("GenerateAllocateContextStub"); |
| 324 } | 324 } |
| 325 | 325 |
| 326 | 326 |
| 327 DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate); |
| 328 |
| 329 // Helper stub to implement Assembler::StoreIntoObject. |
| 330 // Input parameters: |
| 331 // R0: Address being stored |
| 327 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { | 332 void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) { |
| 328 __ Stop("GenerateUpdateStoreBufferStub"); | 333 Label add_to_buffer; |
| 334 // Check whether this object has already been remembered. Skip adding to the |
| 335 // store buffer if the object is in the store buffer already. |
| 336 __ LoadFieldFromOffset(TMP, R0, Object::tags_offset()); |
| 337 __ tsti(TMP, 1 << RawObject::kRememberedBit); |
| 338 __ b(&add_to_buffer, EQ); |
| 339 __ ret(); |
| 340 |
| 341 __ Bind(&add_to_buffer); |
| 342 // Save values being destroyed. |
| 343 __ Push(R1); |
| 344 __ Push(R2); |
| 345 __ Push(R3); |
| 346 |
| 347 __ orri(R2, TMP, 1 << RawObject::kRememberedBit); |
| 348 __ StoreFieldToOffset(R2, R0, Object::tags_offset()); |
| 349 |
| 350 // Load the isolate out of the context. |
| 351 // Spilled: R1, R2, R3. |
| 352 // R0: address being stored. |
| 353 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset()); |
| 354 |
| 355 // Load the StoreBuffer block out of the isolate. Then load top_ out of the |
| 356 // StoreBufferBlock and add the address to the pointers_. |
| 357 // R1: isolate. |
| 358 __ LoadFromOffset(R1, R1, Isolate::store_buffer_offset()); |
| 359 __ LoadFromOffset(R2, R1, StoreBufferBlock::top_offset()); |
| 360 __ add(R3, R1, Operand(R2, LSL, 3)); |
| 361 __ StoreToOffset(R0, R3, StoreBufferBlock::pointers_offset()); |
| 362 |
| 363 // Increment top_ and check for overflow. |
| 364 // R2: top_. |
| 365 // R1: StoreBufferBlock. |
| 366 Label L; |
| 367 __ add(R2, R2, Operand(1)); |
| 368 __ StoreToOffset(R2, R1, StoreBufferBlock::top_offset()); |
| 369 __ CompareImmediate(R2, StoreBufferBlock::kSize, PP); |
| 370 // Restore values. |
| 371 __ Pop(R3); |
| 372 __ Pop(R2); |
| 373 __ Pop(R1); |
| 374 __ b(&L, EQ); |
| 375 __ ret(); |
| 376 |
| 377 // Handle overflow: Call the runtime leaf function. |
| 378 __ Bind(&L); |
| 379 // Setup frame, push callee-saved registers. |
| 380 |
| 381 __ EnterCallRuntimeFrame(0 * kWordSize); |
| 382 __ LoadFieldFromOffset(R0, CTX, Context::isolate_offset()); |
| 383 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); |
| 384 // Restore callee-saved registers, tear down frame. |
| 385 __ LeaveCallRuntimeFrame(); |
| 386 __ ret(); |
| 329 } | 387 } |
| 330 | 388 |
| 331 | 389 |
| 332 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, | 390 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
| 333 const Class& cls) { | 391 const Class& cls) { |
| 334 __ Stop("GenerateAllocationStubForClass"); | 392 __ Stop("GenerateAllocationStubForClass"); |
| 335 } | 393 } |
| 336 | 394 |
| 337 | 395 |
| 338 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { | 396 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 531 |
| 474 | 532 |
| 475 void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( | 533 void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( |
| 476 Assembler* assembler) { | 534 Assembler* assembler) { |
| 477 __ Stop("GenerateOptimizedIdenticalWithNumberCheckStub"); | 535 __ Stop("GenerateOptimizedIdenticalWithNumberCheckStub"); |
| 478 } | 536 } |
| 479 | 537 |
| 480 } // namespace dart | 538 } // namespace dart |
| 481 | 539 |
| 482 #endif // defined TARGET_ARCH_ARM64 | 540 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |