| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 8199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8210 DeferredReferenceGetNamedValue* deferred = | 8210 DeferredReferenceGetNamedValue* deferred = |
| 8211 new DeferredReferenceGetNamedValue(result.reg(), receiver.reg(), name); | 8211 new DeferredReferenceGetNamedValue(result.reg(), receiver.reg(), name); |
| 8212 | 8212 |
| 8213 // Check that the receiver is a heap object. | 8213 // Check that the receiver is a heap object. |
| 8214 __ JumpIfSmi(receiver.reg(), deferred->entry_label()); | 8214 __ JumpIfSmi(receiver.reg(), deferred->entry_label()); |
| 8215 | 8215 |
| 8216 __ bind(deferred->patch_site()); | 8216 __ bind(deferred->patch_site()); |
| 8217 // This is the map check instruction that will be patched (so we can't | 8217 // This is the map check instruction that will be patched (so we can't |
| 8218 // use the double underscore macro that may insert instructions). | 8218 // use the double underscore macro that may insert instructions). |
| 8219 // Initially use an invalid map to force a failure. | 8219 // Initially use an invalid map to force a failure. |
| 8220 masm()->Move(kScratchRegister, Factory::null_value()); | 8220 masm()->movq(kScratchRegister, Factory::null_value(), |
| 8221 RelocInfo::EMBEDDED_OBJECT); |
| 8221 masm()->cmpq(FieldOperand(receiver.reg(), HeapObject::kMapOffset), | 8222 masm()->cmpq(FieldOperand(receiver.reg(), HeapObject::kMapOffset), |
| 8222 kScratchRegister); | 8223 kScratchRegister); |
| 8223 // This branch is always a forwards branch so it's always a fixed | 8224 // This branch is always a forwards branch so it's always a fixed |
| 8224 // size which allows the assert below to succeed and patching to work. | 8225 // size which allows the assert below to succeed and patching to work. |
| 8225 // Don't use deferred->Branch(...), since that might add coverage code. | 8226 // Don't use deferred->Branch(...), since that might add coverage code. |
| 8226 masm()->j(not_equal, deferred->entry_label()); | 8227 masm()->j(not_equal, deferred->entry_label()); |
| 8227 | 8228 |
| 8228 // The delta from the patch label to the load offset must be | 8229 // The delta from the patch label to the load offset must be |
| 8229 // statically known. | 8230 // statically known. |
| 8230 ASSERT(masm()->SizeOfCodeGeneratedSince(deferred->patch_site()) == | 8231 ASSERT(masm()->SizeOfCodeGeneratedSince(deferred->patch_site()) == |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8286 Condition is_smi = masm()->CheckSmi(receiver.reg()); | 8287 Condition is_smi = masm()->CheckSmi(receiver.reg()); |
| 8287 slow.Branch(is_smi, &value, &receiver); | 8288 slow.Branch(is_smi, &value, &receiver); |
| 8288 | 8289 |
| 8289 // This is the map check instruction that will be patched. | 8290 // This is the map check instruction that will be patched. |
| 8290 // Initially use an invalid map to force a failure. The exact | 8291 // Initially use an invalid map to force a failure. The exact |
| 8291 // instruction sequence is important because we use the | 8292 // instruction sequence is important because we use the |
| 8292 // kOffsetToStoreInstruction constant for patching. We avoid using | 8293 // kOffsetToStoreInstruction constant for patching. We avoid using |
| 8293 // the __ macro for the following two instructions because it | 8294 // the __ macro for the following two instructions because it |
| 8294 // might introduce extra instructions. | 8295 // might introduce extra instructions. |
| 8295 __ bind(&patch_site); | 8296 __ bind(&patch_site); |
| 8296 masm()->Move(kScratchRegister, Factory::null_value()); | 8297 masm()->movq(kScratchRegister, Factory::null_value(), |
| 8298 RelocInfo::EMBEDDED_OBJECT); |
| 8297 masm()->cmpq(FieldOperand(receiver.reg(), HeapObject::kMapOffset), | 8299 masm()->cmpq(FieldOperand(receiver.reg(), HeapObject::kMapOffset), |
| 8298 kScratchRegister); | 8300 kScratchRegister); |
| 8299 // This branch is always a forwards branch so it's always a fixed size | 8301 // This branch is always a forwards branch so it's always a fixed size |
| 8300 // which allows the assert below to succeed and patching to work. | 8302 // which allows the assert below to succeed and patching to work. |
| 8301 slow.Branch(not_equal, &value, &receiver); | 8303 slow.Branch(not_equal, &value, &receiver); |
| 8302 | 8304 |
| 8303 // The delta from the patch label to the store offset must be | 8305 // The delta from the patch label to the store offset must be |
| 8304 // statically known. | 8306 // statically known. |
| 8305 ASSERT(masm()->SizeOfCodeGeneratedSince(&patch_site) == | 8307 ASSERT(masm()->SizeOfCodeGeneratedSince(&patch_site) == |
| 8306 StoreIC::kOffsetToStoreInstruction); | 8308 StoreIC::kOffsetToStoreInstruction); |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8826 } | 8828 } |
| 8827 | 8829 |
| 8828 #endif | 8830 #endif |
| 8829 | 8831 |
| 8830 | 8832 |
| 8831 #undef __ | 8833 #undef __ |
| 8832 | 8834 |
| 8833 } } // namespace v8::internal | 8835 } } // namespace v8::internal |
| 8834 | 8836 |
| 8835 #endif // V8_TARGET_ARCH_X64 | 8837 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |