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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 } | 414 } |
415 | 415 |
416 | 416 |
417 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name, | 417 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name, |
418 Handle<JSObject> receiver, | 418 Handle<JSObject> receiver, |
419 LookupResult* lookup, | 419 LookupResult* lookup, |
420 Handle<Map> transition, | 420 Handle<Map> transition, |
421 StrictModeFlag strict_mode) { | 421 StrictModeFlag strict_mode) { |
422 Handle<Code> stub = FindIC( | 422 Handle<Code> stub = FindIC( |
423 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode); | 423 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode); |
424 if (!stub.is_null()) return stub; | 424 if (!stub.is_null()) { |
425 MapHandleList embedded_maps; | |
426 stub->FindAllMaps(&embedded_maps); | |
427 for (int i = 0; i < embedded_maps.length(); i++) { | |
428 if (embedded_maps.at(i).is_identical_to(transition)) { | |
429 return stub; | |
430 } | |
431 } | |
432 } | |
425 | 433 |
426 StoreStubCompiler compiler(isolate_, strict_mode); | 434 StoreStubCompiler compiler(isolate_, strict_mode); |
427 Handle<Code> code = | 435 Handle<Code> code = |
428 compiler.CompileStoreTransition(receiver, lookup, transition, name); | 436 compiler.CompileStoreTransition(receiver, lookup, transition, name); |
429 JSObject::UpdateMapCodeCache(receiver, name, code); | 437 JSObject::UpdateMapCodeCache(receiver, name, code); |
430 return code; | 438 return code; |
431 } | 439 } |
432 | 440 |
433 | 441 |
434 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) { | 442 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
563 | 571 |
564 | 572 |
565 Handle<Code> StubCache::ComputeKeyedStoreTransition( | 573 Handle<Code> StubCache::ComputeKeyedStoreTransition( |
566 Handle<Name> name, | 574 Handle<Name> name, |
567 Handle<JSObject> receiver, | 575 Handle<JSObject> receiver, |
568 LookupResult* lookup, | 576 LookupResult* lookup, |
569 Handle<Map> transition, | 577 Handle<Map> transition, |
570 StrictModeFlag strict_mode) { | 578 StrictModeFlag strict_mode) { |
571 Handle<Code> stub = FindIC( | 579 Handle<Code> stub = FindIC( |
572 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode); | 580 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode); |
573 if (!stub.is_null()) return stub; | 581 if (!stub.is_null()) { |
582 MapHandleList embedded_maps; | |
583 stub->FindAllMaps(&embedded_maps); | |
584 for (int i = 0; i < embedded_maps.length(); i++) { | |
585 if (embedded_maps.at(i).is_identical_to(transition)) { | |
586 return stub; | |
587 } | |
588 } | |
589 } | |
574 | 590 |
575 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE); | 591 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE); |
576 Handle<Code> code = | 592 Handle<Code> code = |
577 compiler.CompileStoreTransition(receiver, lookup, transition, name); | 593 compiler.CompileStoreTransition(receiver, lookup, transition, name); |
578 JSObject::UpdateMapCodeCache(receiver, name, code); | 594 JSObject::UpdateMapCodeCache(receiver, name, code); |
579 return code; | 595 return code; |
580 } | 596 } |
581 | 597 |
582 | 598 |
583 #define CALL_LOGGER_TAG(kind, type) \ | 599 #define CALL_LOGGER_TAG(kind, type) \ |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
910 | 926 |
911 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); | 927 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); |
912 | 928 |
913 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code); | 929 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code); |
914 return code; | 930 return code; |
915 } | 931 } |
916 | 932 |
917 | 933 |
918 Handle<Code> StubCache::ComputePolymorphicIC(MapHandleList* receiver_maps, | 934 Handle<Code> StubCache::ComputePolymorphicIC(MapHandleList* receiver_maps, |
919 CodeHandleList* handlers, | 935 CodeHandleList* handlers, |
936 int number_of_valid_maps, | |
920 Handle<Name> name) { | 937 Handle<Name> name) { |
921 LoadStubCompiler ic_compiler(isolate_); | 938 LoadStubCompiler ic_compiler(isolate_); |
922 Code::StubType type = handlers->length() == 1 ? handlers->at(0)->type() | 939 Code::StubType type = handlers->at(0)->type(); |
danno
2013/04/25 13:33:48
Use number_of_valid_maps
Toon Verwaest
2013/04/25 14:49:10
Done.
| |
923 : Code::NORMAL; | |
924 Handle<Code> ic = ic_compiler.CompilePolymorphicIC( | 940 Handle<Code> ic = ic_compiler.CompilePolymorphicIC( |
925 receiver_maps, handlers, name, type, PROPERTY); | 941 receiver_maps, handlers, name, type, PROPERTY); |
926 return ic; | 942 return ic; |
927 } | 943 } |
928 | 944 |
929 | 945 |
930 Handle<Code> StubCache::ComputeStoreElementPolymorphic( | 946 Handle<Code> StubCache::ComputeStoreElementPolymorphic( |
931 MapHandleList* receiver_maps, | 947 MapHandleList* receiver_maps, |
932 KeyedAccessStoreMode store_mode, | 948 KeyedAccessStoreMode store_mode, |
933 StrictModeFlag strict_mode) { | 949 StrictModeFlag strict_mode) { |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2062 Handle<FunctionTemplateInfo>( | 2078 Handle<FunctionTemplateInfo>( |
2063 FunctionTemplateInfo::cast(signature->receiver())); | 2079 FunctionTemplateInfo::cast(signature->receiver())); |
2064 } | 2080 } |
2065 } | 2081 } |
2066 | 2082 |
2067 is_simple_api_call_ = true; | 2083 is_simple_api_call_ = true; |
2068 } | 2084 } |
2069 | 2085 |
2070 | 2086 |
2071 } } // namespace v8::internal | 2087 } } // namespace v8::internal |
OLD | NEW |