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

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

Issue 2040393003: Only mark 'recompute' after fetching the handler from the nexus (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | 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/ic/ic.h" 5 #include "src/ic/ic.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-arguments-inl.h" 8 #include "src/api-arguments-inl.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 case LookupIterator::ACCESSOR: 255 case LookupIterator::ACCESSOR:
256 case LookupIterator::INTEGER_INDEXED_EXOTIC: 256 case LookupIterator::INTEGER_INDEXED_EXOTIC:
257 case LookupIterator::DATA: 257 case LookupIterator::DATA:
258 return; 258 return;
259 } 259 }
260 } 260 }
261 } 261 }
262 262
263 bool IC::ShouldRecomputeHandler(Handle<Object> receiver, Handle<String> name) { 263 bool IC::ShouldRecomputeHandler(Handle<Object> receiver, Handle<String> name) {
264 if (!RecomputeHandlerForName(name)) return false; 264 if (!RecomputeHandlerForName(name)) return false;
265
266 DCHECK(UseVector());
267 maybe_handler_ = nexus()->FindHandlerForMap(receiver_map());
268
265 // This is a contextual access, always just update the handler and stay 269 // This is a contextual access, always just update the handler and stay
266 // monomorphic. 270 // monomorphic.
267 if (receiver->IsJSGlobalObject()) return true; 271 if (receiver->IsJSGlobalObject()) return true;
268 272
269 DCHECK(UseVector());
270 maybe_handler_ = nexus()->FindHandlerForMap(receiver_map());
271
272 // The current map wasn't handled yet. There's no reason to stay monomorphic, 273 // The current map wasn't handled yet. There's no reason to stay monomorphic,
273 // *unless* we're moving from a deprecated map to its replacement, or 274 // *unless* we're moving from a deprecated map to its replacement, or
274 // to a more general elements kind. 275 // to a more general elements kind.
275 // TODO(verwaest): Check if the current map is actually what the old map 276 // TODO(verwaest): Check if the current map is actually what the old map
276 // would transition to. 277 // would transition to.
277 if (maybe_handler_.is_null()) { 278 if (maybe_handler_.is_null()) {
278 if (!receiver_map()->IsJSObjectMap()) return false; 279 if (!receiver_map()->IsJSObjectMap()) return false;
279 Map* first_map = FirstTargetMap(); 280 Map* first_map = FirstTargetMap();
280 if (first_map == NULL) return false; 281 if (first_map == NULL) return false;
281 Handle<Map> old_map(first_map); 282 Handle<Map> old_map(first_map);
(...skipping 2655 matching lines...) Expand 10 before | Expand all | Expand 10 after
2937 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, 2938 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC,
2938 vector->GetKind(vector_slot)); 2939 vector->GetKind(vector_slot));
2939 KeyedLoadICNexus nexus(vector, vector_slot); 2940 KeyedLoadICNexus nexus(vector, vector_slot);
2940 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 2941 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2941 ic.UpdateState(receiver, key); 2942 ic.UpdateState(receiver, key);
2942 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); 2943 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key));
2943 } 2944 }
2944 } 2945 }
2945 } // namespace internal 2946 } // namespace internal
2946 } // namespace v8 2947 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698