OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 5438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5449 // A test rax instruction following the call signals that the | 5449 // A test rax instruction following the call signals that the |
5450 // inobject property case was inlined. Ensure that there is not | 5450 // inobject property case was inlined. Ensure that there is not |
5451 // a test rax instruction here. | 5451 // a test rax instruction here. |
5452 __ nop(); | 5452 __ nop(); |
5453 cgen_->frame()->Push(&answer); | 5453 cgen_->frame()->Push(&answer); |
5454 } else { | 5454 } else { |
5455 // Inline the inobject property case. | 5455 // Inline the inobject property case. |
5456 Comment cmnt(masm, "[ Inlined named property load"); | 5456 Comment cmnt(masm, "[ Inlined named property load"); |
5457 Result receiver = cgen_->frame()->Pop(); | 5457 Result receiver = cgen_->frame()->Pop(); |
5458 receiver.ToRegister(); | 5458 receiver.ToRegister(); |
5459 | |
5460 Result value = cgen_->allocator()->Allocate(); | 5459 Result value = cgen_->allocator()->Allocate(); |
5461 ASSERT(value.is_valid()); | 5460 ASSERT(value.is_valid()); |
| 5461 // Cannot use r12 for receiver, because that changes |
| 5462 // the distance between a call and a fixup location, |
| 5463 // due to a special encoding of r12 as r/m in a ModR/M byte. |
| 5464 if (receiver.reg().is(r12)) { |
| 5465 // Swap receiver and value. |
| 5466 __ movq(value.reg(), receiver.reg()); |
| 5467 Result temp = receiver; |
| 5468 receiver = value; |
| 5469 value = temp; |
| 5470 cgen_->frame()->Spill(value.reg()); // r12 may have been shared. |
| 5471 } |
| 5472 |
5462 DeferredReferenceGetNamedValue* deferred = | 5473 DeferredReferenceGetNamedValue* deferred = |
5463 new DeferredReferenceGetNamedValue(value.reg(), | 5474 new DeferredReferenceGetNamedValue(value.reg(), |
5464 receiver.reg(), | 5475 receiver.reg(), |
5465 GetName()); | 5476 GetName()); |
5466 | 5477 |
5467 // Check that the receiver is a heap object. | 5478 // Check that the receiver is a heap object. |
5468 __ testl(receiver.reg(), Immediate(kSmiTagMask)); | 5479 __ testl(receiver.reg(), Immediate(kSmiTagMask)); |
5469 deferred->Branch(zero); | 5480 deferred->Branch(zero); |
5470 | 5481 |
5471 __ bind(deferred->patch_site()); | 5482 __ bind(deferred->patch_site()); |
(...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7355 int CompareStub::MinorKey() { | 7366 int CompareStub::MinorKey() { |
7356 // Encode the two parameters in a unique 16 bit value. | 7367 // Encode the two parameters in a unique 16 bit value. |
7357 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); | 7368 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); |
7358 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); | 7369 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); |
7359 } | 7370 } |
7360 | 7371 |
7361 | 7372 |
7362 #undef __ | 7373 #undef __ |
7363 | 7374 |
7364 } } // namespace v8::internal | 7375 } } // namespace v8::internal |
OLD | NEW |