Chromium Code Reviews| 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 // Save values being destroyed. |
| 334 __ Push(R1); | |
| 335 __ Push(R2); | |
| 336 __ Push(R3); | |
| 337 | |
| 338 Label add_to_buffer; | |
| 339 // Check whether this object has already been remembered. Skip adding to the | |
| 340 // store buffer if the object is in the store buffer already. | |
| 341 // Spilled: R1, R2, R3 | |
| 342 // R0: Address being stored | |
| 343 __ LoadFieldFromOffset(R2, R0, Object::tags_offset()); | |
| 344 | |
| 345 __ tsti(R2, 1 << RawObject::kRememberedBit); | |
| 346 __ b(&add_to_buffer, EQ); | |
| 347 __ Pop(R3); | |
| 348 __ Pop(R2); | |
| 349 __ Pop(R1); | |
| 350 __ ret(); | |
|
regis
2014/04/22 18:45:32
How frequent is this ret()?
If we return frequentl
zra
2014/04/22 19:44:02
Done.
| |
| 351 | |
| 352 __ Bind(&add_to_buffer); | |
| 353 __ orri(R2, R2, 1 << RawObject::kRememberedBit); | |
| 354 __ StoreFieldToOffset(R2, R0, Object::tags_offset()); | |
| 355 | |
| 356 // Load the isolate out of the context. | |
| 357 // Spilled: R1, R2, R3. | |
| 358 // R0: address being stored. | |
| 359 __ LoadFieldFromOffset(R1, CTX, Context::isolate_offset()); | |
| 360 | |
| 361 // Load the StoreBuffer block out of the isolate. Then load top_ out of the | |
| 362 // StoreBufferBlock and add the address to the pointers_. | |
| 363 // R1: isolate. | |
| 364 __ LoadFromOffset(R1, R1, Isolate::store_buffer_offset()); | |
| 365 __ LoadFromOffset(R2, R1, StoreBufferBlock::top_offset()); | |
| 366 __ add(R3, R1, Operand(R2, LSL, 3)); | |
| 367 __ StoreToOffset(R0, R3, StoreBufferBlock::pointers_offset()); | |
| 368 | |
| 369 // Increment top_ and check for overflow. | |
| 370 // R2: top_. | |
| 371 // R1: StoreBufferBlock. | |
| 372 Label L; | |
| 373 __ add(R2, R2, Operand(1)); | |
| 374 __ StoreToOffset(R2, R1, StoreBufferBlock::top_offset()); | |
| 375 __ CompareImmediate(R2, StoreBufferBlock::kSize, PP); | |
| 376 // Restore values. | |
| 377 __ Pop(R3); | |
| 378 __ Pop(R2); | |
| 379 __ Pop(R1); | |
| 380 __ b(&L, EQ); | |
| 381 __ ret(); | |
| 382 | |
| 383 // Handle overflow: Call the runtime leaf function. | |
| 384 __ Bind(&L); | |
| 385 // Setup frame, push callee-saved registers. | |
| 386 | |
| 387 __ EnterCallRuntimeFrame(0 * kWordSize); | |
| 388 __ LoadFieldFromOffset(R0, CTX, Context::isolate_offset()); | |
| 389 __ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1); | |
| 390 // Restore callee-saved registers, tear down frame. | |
| 391 __ LeaveCallRuntimeFrame(); | |
| 392 __ ret(); | |
| 329 } | 393 } |
| 330 | 394 |
| 331 | 395 |
| 332 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, | 396 void StubCode::GenerateAllocationStubForClass(Assembler* assembler, |
| 333 const Class& cls) { | 397 const Class& cls) { |
| 334 __ Stop("GenerateAllocationStubForClass"); | 398 __ Stop("GenerateAllocationStubForClass"); |
| 335 } | 399 } |
| 336 | 400 |
| 337 | 401 |
| 338 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { | 402 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 473 | 537 |
| 474 | 538 |
| 475 void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( | 539 void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( |
| 476 Assembler* assembler) { | 540 Assembler* assembler) { |
| 477 __ Stop("GenerateOptimizedIdenticalWithNumberCheckStub"); | 541 __ Stop("GenerateOptimizedIdenticalWithNumberCheckStub"); |
| 478 } | 542 } |
| 479 | 543 |
| 480 } // namespace dart | 544 } // namespace dart |
| 481 | 545 |
| 482 #endif // defined TARGET_ARCH_ARM64 | 546 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |