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 4858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4869 __ pop(rcx); | 4869 __ pop(rcx); |
4870 __ pop(rax); | 4870 __ pop(rax); |
4871 __ pop(rdx); | 4871 __ pop(rdx); |
4872 __ push(rcx); | 4872 __ push(rcx); |
4873 | 4873 |
4874 // Do a tail call to the rewritten stub. | 4874 // Do a tail call to the rewritten stub. |
4875 __ jmp(rdi); | 4875 __ jmp(rdi); |
4876 } | 4876 } |
4877 | 4877 |
4878 | 4878 |
4879 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, | 4879 MaybeObject* StringDictionaryLookupStub::GenerateNegativeLookup( |
4880 Label* miss, | 4880 MacroAssembler* masm, |
4881 Label* done, | 4881 Label* miss, |
4882 Register properties, | 4882 Label* done, |
4883 String* name, | 4883 Register properties, |
4884 Register r0) { | 4884 String* name, |
| 4885 Register r0) { |
4885 // If names of slots in range from 1 to kProbes - 1 for the hash value are | 4886 // If names of slots in range from 1 to kProbes - 1 for the hash value are |
4886 // not equal to the name and kProbes-th slot is not used (its name is the | 4887 // not equal to the name and kProbes-th slot is not used (its name is the |
4887 // undefined value), it guarantees the hash table doesn't contain the | 4888 // undefined value), it guarantees the hash table doesn't contain the |
4888 // property. It's true even if some slots represent deleted properties | 4889 // property. It's true even if some slots represent deleted properties |
4889 // (their names are the null value). | 4890 // (their names are the null value). |
4890 for (int i = 0; i < kInlinedProbes; i++) { | 4891 for (int i = 0; i < kInlinedProbes; i++) { |
4891 // r0 points to properties hash. | 4892 // r0 points to properties hash. |
4892 // Compute the masked index: (hash + i + i * i) & mask. | 4893 // Compute the masked index: (hash + i + i * i) & mask. |
4893 Register index = r0; | 4894 Register index = r0; |
4894 // Capacity is smi 2^n. | 4895 // Capacity is smi 2^n. |
(...skipping 26 matching lines...) Expand all Loading... |
4921 Immediate(kIsSymbolMask)); | 4922 Immediate(kIsSymbolMask)); |
4922 __ j(zero, miss); | 4923 __ j(zero, miss); |
4923 } | 4924 } |
4924 | 4925 |
4925 StringDictionaryLookupStub stub(properties, | 4926 StringDictionaryLookupStub stub(properties, |
4926 r0, | 4927 r0, |
4927 r0, | 4928 r0, |
4928 StringDictionaryLookupStub::NEGATIVE_LOOKUP); | 4929 StringDictionaryLookupStub::NEGATIVE_LOOKUP); |
4929 __ Push(Handle<Object>(name)); | 4930 __ Push(Handle<Object>(name)); |
4930 __ push(Immediate(name->Hash())); | 4931 __ push(Immediate(name->Hash())); |
4931 __ CallStub(&stub); | 4932 MaybeObject* result = masm->TryCallStub(&stub); |
| 4933 if (result->IsFailure()) return result; |
4932 __ testq(r0, r0); | 4934 __ testq(r0, r0); |
4933 __ j(not_zero, miss); | 4935 __ j(not_zero, miss); |
4934 __ jmp(done); | 4936 __ jmp(done); |
| 4937 return result; |
4935 } | 4938 } |
4936 | 4939 |
4937 | 4940 |
4938 // Probe the string dictionary in the |elements| register. Jump to the | 4941 // Probe the string dictionary in the |elements| register. Jump to the |
4939 // |done| label if a property with the given name is found leaving the | 4942 // |done| label if a property with the given name is found leaving the |
4940 // index into the dictionary in |r1|. Jump to the |miss| label | 4943 // index into the dictionary in |r1|. Jump to the |miss| label |
4941 // otherwise. | 4944 // otherwise. |
4942 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, | 4945 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, |
4943 Label* miss, | 4946 Label* miss, |
4944 Label* done, | 4947 Label* done, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5071 __ Drop(1); | 5074 __ Drop(1); |
5072 __ ret(2 * kPointerSize); | 5075 __ ret(2 * kPointerSize); |
5073 } | 5076 } |
5074 | 5077 |
5075 | 5078 |
5076 #undef __ | 5079 #undef __ |
5077 | 5080 |
5078 } } // namespace v8::internal | 5081 } } // namespace v8::internal |
5079 | 5082 |
5080 #endif // V8_TARGET_ARCH_X64 | 5083 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |