Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1140)

Unified Diff: src/stub-cache.cc

Issue 14146005: Track representations of fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test for tracking fields Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/stub-cache.h ('k') | src/transitions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 396e92ce39a6601295a6632de73088a0e05fec2f..ae427ee8c9316b332986c8bc08ee28d305a58a95 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,11 @@ 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 = number_of_valid_maps == 1 ? handlers->at(0)->type()
+ : Code::NORMAL;
Handle<Code> ic = ic_compiler.CompilePolymorphicIC(
receiver_maps, handlers, name, type, PROPERTY);
return ic;
« no previous file with comments | « src/stub-cache.h ('k') | src/transitions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698