OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 // the caller. | 369 // the caller. |
370 class RegisterAllocation { | 370 class RegisterAllocation { |
371 public: | 371 public: |
372 RegisterAllocation(Register object, | 372 RegisterAllocation(Register object, |
373 Register address, | 373 Register address, |
374 Register scratch0) | 374 Register scratch0) |
375 : object_(object), | 375 : object_(object), |
376 address_(address), | 376 address_(address), |
377 scratch0_(scratch0) { | 377 scratch0_(scratch0) { |
378 ASSERT(!AreAliased(scratch0, object, address, no_reg)); | 378 ASSERT(!AreAliased(scratch0, object, address, no_reg)); |
379 scratch1_ = GetRegThatIsNotOneOf(object_, address_, scratch0_); | 379 scratch1_ = GetRegisterThatIsNotOneOf(object_, address_, scratch0_); |
380 } | 380 } |
381 | 381 |
382 void Save(MacroAssembler* masm) { | 382 void Save(MacroAssembler* masm) { |
383 ASSERT(!AreAliased(object_, address_, scratch1_, scratch0_)); | 383 ASSERT(!AreAliased(object_, address_, scratch1_, scratch0_)); |
384 // We don't have to save scratch0_ because it was given to us as | 384 // We don't have to save scratch0_ because it was given to us as |
385 // a scratch register. | 385 // a scratch register. |
386 masm->push(scratch1_); | 386 masm->push(scratch1_); |
387 } | 387 } |
388 | 388 |
389 void Restore(MacroAssembler* masm) { | 389 void Restore(MacroAssembler* masm) { |
(...skipping 22 matching lines...) Expand all Loading... |
412 inline Register address() { return address_; } | 412 inline Register address() { return address_; } |
413 inline Register scratch0() { return scratch0_; } | 413 inline Register scratch0() { return scratch0_; } |
414 inline Register scratch1() { return scratch1_; } | 414 inline Register scratch1() { return scratch1_; } |
415 | 415 |
416 private: | 416 private: |
417 Register object_; | 417 Register object_; |
418 Register address_; | 418 Register address_; |
419 Register scratch0_; | 419 Register scratch0_; |
420 Register scratch1_; | 420 Register scratch1_; |
421 | 421 |
422 Register GetRegThatIsNotOneOf(Register r1, | |
423 Register r2, | |
424 Register r3) { | |
425 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { | |
426 Register candidate = Register::FromAllocationIndex(i); | |
427 if (candidate.is(r1)) continue; | |
428 if (candidate.is(r2)) continue; | |
429 if (candidate.is(r3)) continue; | |
430 return candidate; | |
431 } | |
432 UNREACHABLE(); | |
433 return no_reg; | |
434 } | |
435 friend class RecordWriteStub; | 422 friend class RecordWriteStub; |
436 }; | 423 }; |
437 | 424 |
438 enum OnNoNeedToInformIncrementalMarker { | 425 enum OnNoNeedToInformIncrementalMarker { |
439 kReturnOnNoNeedToInformIncrementalMarker, | 426 kReturnOnNoNeedToInformIncrementalMarker, |
440 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker | 427 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
441 }; | 428 }; |
442 | 429 |
443 void Generate(MacroAssembler* masm); | 430 void Generate(MacroAssembler* masm); |
444 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 431 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 547 |
561 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 548 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
562 | 549 |
563 LookupMode mode_; | 550 LookupMode mode_; |
564 }; | 551 }; |
565 | 552 |
566 | 553 |
567 } } // namespace v8::internal | 554 } } // namespace v8::internal |
568 | 555 |
569 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 556 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |