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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 | 832 |
833 Handle<Code> IC::ComputeHandler(LookupResult* lookup, | 833 Handle<Code> IC::ComputeHandler(LookupResult* lookup, |
834 Handle<Object> object, | 834 Handle<Object> object, |
835 Handle<String> name, | 835 Handle<String> name, |
836 Handle<Object> value) { | 836 Handle<Object> value) { |
837 InlineCacheHolderFlag cache_holder = GetCodeCacheForObject(*object); | 837 InlineCacheHolderFlag cache_holder = GetCodeCacheForObject(*object); |
838 Handle<HeapObject> stub_holder(GetCodeCacheHolder( | 838 Handle<HeapObject> stub_holder(GetCodeCacheHolder( |
839 isolate(), *object, cache_holder)); | 839 isolate(), *object, cache_holder)); |
840 | 840 |
841 Handle<Code> code = isolate()->stub_cache()->FindHandler( | 841 Handle<Code> code = isolate()->stub_cache()->FindHandler( |
842 name, handle(stub_holder->map()), kind(), cache_holder); | 842 name, handle(stub_holder->map()), kind(), cache_holder, |
843 if (!code.is_null()) return code; | 843 lookup->IsNormal() ? Code::NORMAL : Code::FAST); |
| 844 if (!code.is_null()) { |
| 845 #ifdef DEBUG |
| 846 Handle<Code> compiled = CompileHandler( |
| 847 lookup, object, name, value, cache_holder); |
| 848 ASSERT(compiled->major_key() == code->major_key()); |
| 849 ASSERT(compiled->flags() == code->flags()); |
| 850 #endif |
| 851 return code; |
| 852 } |
844 | 853 |
845 code = CompileHandler(lookup, object, name, value, cache_holder); | 854 code = CompileHandler(lookup, object, name, value, cache_holder); |
846 ASSERT(code->is_handler()); | 855 ASSERT(code->is_handler()); |
847 | 856 |
848 if (code->type() != Code::NORMAL) { | 857 if (code->type() != Code::NORMAL) { |
849 HeapObject::UpdateMapCodeCache(stub_holder, name, code); | 858 HeapObject::UpdateMapCodeCache(stub_holder, name, code); |
850 } | 859 } |
851 | 860 |
852 return code; | 861 return code; |
853 } | 862 } |
(...skipping 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 #undef ADDR | 2802 #undef ADDR |
2794 }; | 2803 }; |
2795 | 2804 |
2796 | 2805 |
2797 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2806 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2798 return IC_utilities[id]; | 2807 return IC_utilities[id]; |
2799 } | 2808 } |
2800 | 2809 |
2801 | 2810 |
2802 } } // namespace v8::internal | 2811 } } // namespace v8::internal |
OLD | NEW |