OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 4775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4786 __ j(not_equal, &second_loop); | 4786 __ j(not_equal, &second_loop); |
4787 | 4787 |
4788 __ Integer32ToSmi(scratch_, dst_); | 4788 __ Integer32ToSmi(scratch_, dst_); |
4789 __ movq(FieldOperand(cache_, JSFunctionResultCache::kFingerOffset), scratch_); | 4789 __ movq(FieldOperand(cache_, JSFunctionResultCache::kFingerOffset), scratch_); |
4790 __ movq(dst_, ArrayElement(cache_, dst_, 1)); | 4790 __ movq(dst_, ArrayElement(cache_, dst_, 1)); |
4791 __ jmp(exit_label()); | 4791 __ jmp(exit_label()); |
4792 | 4792 |
4793 __ bind(&cache_miss); | 4793 __ bind(&cache_miss); |
4794 __ push(cache_); // store a reference to cache | 4794 __ push(cache_); // store a reference to cache |
4795 __ push(key_); // store a key | 4795 __ push(key_); // store a key |
4796 Handle<Object> receiver(Top::global_context()->global()); | 4796 __ push(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); |
4797 __ Push(receiver); | |
4798 __ push(key_); | 4797 __ push(key_); |
4799 // On x64 function must be in rdi. | 4798 // On x64 function must be in rdi. |
4800 __ movq(rdi, FieldOperand(cache_, JSFunctionResultCache::kFactoryOffset)); | 4799 __ movq(rdi, FieldOperand(cache_, JSFunctionResultCache::kFactoryOffset)); |
4801 ParameterCount expected(1); | 4800 ParameterCount expected(1); |
4802 __ InvokeFunction(rdi, expected, CALL_FUNCTION); | 4801 __ InvokeFunction(rdi, expected, CALL_FUNCTION); |
4803 | 4802 |
4804 // Find a place to put new cached value into. | 4803 // Find a place to put new cached value into. |
4805 Label add_new_entry, update_cache; | 4804 Label add_new_entry, update_cache; |
4806 __ movq(rcx, Operand(rsp, kPointerSize)); // restore the cache | 4805 __ movq(rcx, Operand(rsp, kPointerSize)); // restore the cache |
4807 // Possible optimization: cache size is constant for the given cache | 4806 // Possible optimization: cache size is constant for the given cache |
(...skipping 7138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11946 } | 11945 } |
11947 | 11946 |
11948 #endif | 11947 #endif |
11949 | 11948 |
11950 | 11949 |
11951 #undef __ | 11950 #undef __ |
11952 | 11951 |
11953 } } // namespace v8::internal | 11952 } } // namespace v8::internal |
11954 | 11953 |
11955 #endif // V8_TARGET_ARCH_X64 | 11954 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |