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

Side by Side Diff: src/ic/ic.cc

Issue 587363002: Fix IC cache confusion on String.prototype.length (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-416416.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 if (megamorphic_cached_code != *code) return code; 922 if (megamorphic_cached_code != *code) return code;
923 } else { 923 } else {
924 return code; 924 return code;
925 } 925 }
926 } 926 }
927 } 927 }
928 928
929 code = CompileHandler(lookup, value, flag); 929 code = CompileHandler(lookup, value, flag);
930 DCHECK(code->is_handler()); 930 DCHECK(code->is_handler());
931 931
932 if (code->type() != Code::NORMAL) { 932 // TODO(mvstanton): we'd only like to cache code on the map when it's custom
933 // code compiled for this map, otherwise it's already cached in the global
934 // code
935 // cache. We are also guarding against installing code with flags that don't
936 // match the desired CacheHolderFlag computed above, which would lead to
937 // invalid lookups later.
938 if (code->type() != Code::NORMAL &&
939 Code::ExtractCacheHolderFromFlags(code->flags()) == flag) {
933 Map::UpdateCodeCache(stub_holder_map, lookup->name(), code); 940 Map::UpdateCodeCache(stub_holder_map, lookup->name(), code);
934 } 941 }
935 942
936 return code; 943 return code;
937 } 944 }
938 945
939 946
940 Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup, 947 Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
941 Handle<Object> unused, 948 Handle<Object> unused,
942 CacheHolderFlag cache_holder) { 949 CacheHolderFlag cache_holder) {
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 static const Address IC_utilities[] = { 2651 static const Address IC_utilities[] = {
2645 #define ADDR(name) FUNCTION_ADDR(name), 2652 #define ADDR(name) FUNCTION_ADDR(name),
2646 IC_UTIL_LIST(ADDR) NULL 2653 IC_UTIL_LIST(ADDR) NULL
2647 #undef ADDR 2654 #undef ADDR
2648 }; 2655 };
2649 2656
2650 2657
2651 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 2658 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
2652 } 2659 }
2653 } // namespace v8::internal 2660 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-416416.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698