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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 Handle<Code> StubCache::ComputeLoadElementPolymorphic( | 644 Handle<Code> StubCache::ComputeLoadElementPolymorphic( |
645 MapHandleList* receiver_maps) { | 645 MapHandleList* receiver_maps) { |
646 Code::Flags flags = Code::ComputeFlags(Code::KEYED_LOAD_IC, POLYMORPHIC); | 646 Code::Flags flags = Code::ComputeFlags(Code::KEYED_LOAD_IC, POLYMORPHIC); |
647 Handle<PolymorphicCodeCache> cache = | 647 Handle<PolymorphicCodeCache> cache = |
648 isolate_->factory()->polymorphic_code_cache(); | 648 isolate_->factory()->polymorphic_code_cache(); |
649 Handle<Object> probe = cache->Lookup(receiver_maps, flags); | 649 Handle<Object> probe = cache->Lookup(receiver_maps, flags); |
650 if (probe->IsCode()) return Handle<Code>::cast(probe); | 650 if (probe->IsCode()) return Handle<Code>::cast(probe); |
651 | 651 |
652 TypeHandleList types(receiver_maps->length()); | 652 TypeHandleList types(receiver_maps->length()); |
653 for (int i = 0; i < receiver_maps->length(); i++) { | 653 for (int i = 0; i < receiver_maps->length(); i++) { |
654 types.Add(Type::Class(receiver_maps->at(i), isolate())); | 654 types.Add(handle(Type::Class(receiver_maps->at(i)), isolate())); |
655 } | 655 } |
656 CodeHandleList handlers(receiver_maps->length()); | 656 CodeHandleList handlers(receiver_maps->length()); |
657 KeyedLoadStubCompiler compiler(isolate_); | 657 KeyedLoadStubCompiler compiler(isolate_); |
658 compiler.CompileElementHandlers(receiver_maps, &handlers); | 658 compiler.CompileElementHandlers(receiver_maps, &handlers); |
659 Handle<Code> code = compiler.CompilePolymorphicIC( | 659 Handle<Code> code = compiler.CompilePolymorphicIC( |
660 &types, &handlers, factory()->empty_string(), Code::NORMAL, ELEMENT); | 660 &types, &handlers, factory()->empty_string(), Code::NORMAL, ELEMENT); |
661 | 661 |
662 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); | 662 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); |
663 | 663 |
664 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code); | 664 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code); |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2041 Handle<FunctionTemplateInfo>( | 2041 Handle<FunctionTemplateInfo>( |
2042 FunctionTemplateInfo::cast(signature->receiver())); | 2042 FunctionTemplateInfo::cast(signature->receiver())); |
2043 } | 2043 } |
2044 } | 2044 } |
2045 | 2045 |
2046 is_simple_api_call_ = true; | 2046 is_simple_api_call_ = true; |
2047 } | 2047 } |
2048 | 2048 |
2049 | 2049 |
2050 } } // namespace v8::internal | 2050 } } // namespace v8::internal |
OLD | NEW |