Chromium Code Reviews| Index: src/stub-cache.cc |
| diff --git a/src/stub-cache.cc b/src/stub-cache.cc |
| index 396e92ce39a6601295a6632de73088a0e05fec2f..882fe301acc721cc32bb3cb9fa65c231d6e49fcc 100644 |
| --- a/src/stub-cache.cc |
| +++ b/src/stub-cache.cc |
| @@ -421,7 +421,15 @@ Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name, |
| StrictModeFlag strict_mode) { |
| Handle<Code> stub = FindIC( |
| name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode); |
| - if (!stub.is_null()) return stub; |
| + if (!stub.is_null()) { |
| + MapHandleList embedded_maps; |
| + stub->FindAllMaps(&embedded_maps); |
| + for (int i = 0; i < embedded_maps.length(); i++) { |
| + if (embedded_maps.at(i).is_identical_to(transition)) { |
| + return stub; |
| + } |
| + } |
| + } |
| StoreStubCompiler compiler(isolate_, strict_mode); |
| Handle<Code> code = |
| @@ -570,7 +578,15 @@ Handle<Code> StubCache::ComputeKeyedStoreTransition( |
| StrictModeFlag strict_mode) { |
| Handle<Code> stub = FindIC( |
| name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode); |
| - if (!stub.is_null()) return stub; |
| + if (!stub.is_null()) { |
| + MapHandleList embedded_maps; |
| + stub->FindAllMaps(&embedded_maps); |
| + for (int i = 0; i < embedded_maps.length(); i++) { |
| + if (embedded_maps.at(i).is_identical_to(transition)) { |
| + return stub; |
| + } |
| + } |
| + } |
| KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE); |
| Handle<Code> code = |
| @@ -917,10 +933,10 @@ Handle<Code> StubCache::ComputeLoadElementPolymorphic( |
| Handle<Code> StubCache::ComputePolymorphicIC(MapHandleList* receiver_maps, |
| CodeHandleList* handlers, |
| + int number_of_valid_maps, |
| Handle<Name> name) { |
| LoadStubCompiler ic_compiler(isolate_); |
| - Code::StubType type = handlers->length() == 1 ? handlers->at(0)->type() |
| - : Code::NORMAL; |
| + 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.
|
| Handle<Code> ic = ic_compiler.CompilePolymorphicIC( |
| receiver_maps, handlers, name, type, PROPERTY); |
| return ic; |