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

Side by Side Diff: src/ic/handler-compiler.cc

Issue 1330153003: Adding template parameter to PrototypeIterator GetCurrent for casting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplifications Created 5 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/isolate.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/handler-compiler.h" 5 #include "src/ic/handler-compiler.h"
6 6
7 #include "src/cpu-profiler.h" 7 #include "src/cpu-profiler.h"
8 #include "src/ic/call-optimization.h" 8 #include "src/ic/call-optimization.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/ic-inl.h" 10 #include "src/ic/ic-inl.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 bool lost_holder_register = false; 323 bool lost_holder_register = false;
324 auto holder_orig = holder(); 324 auto holder_orig = holder();
325 // non masking interceptors must check the entire chain, so temporarily reset 325 // non masking interceptors must check the entire chain, so temporarily reset
326 // the holder to be that last element for the FrontendHeader call. 326 // the holder to be that last element for the FrontendHeader call.
327 if (holder()->GetNamedInterceptor()->non_masking()) { 327 if (holder()->GetNamedInterceptor()->non_masking()) {
328 DCHECK(!inline_followup); 328 DCHECK(!inline_followup);
329 JSObject* last = *holder(); 329 JSObject* last = *holder();
330 PrototypeIterator iter(isolate(), last); 330 PrototypeIterator iter(isolate(), last);
331 while (!iter.IsAtEnd()) { 331 while (!iter.IsAtEnd()) {
332 lost_holder_register = true; 332 lost_holder_register = true;
333 last = JSObject::cast(iter.GetCurrent()); 333 last = iter.GetCurrent<JSObject>();
334 iter.Advance(); 334 iter.Advance();
335 } 335 }
336 auto last_handle = handle(last); 336 auto last_handle = handle(last);
337 set_holder(last_handle); 337 set_holder(last_handle);
338 } 338 }
339 Register reg = FrontendHeader(receiver(), it->name(), &miss, RETURN_HOLDER); 339 Register reg = FrontendHeader(receiver(), it->name(), &miss, RETURN_HOLDER);
340 // Reset the holder so further calculations are correct. 340 // Reset the holder so further calculations are correct.
341 set_holder(holder_orig); 341 set_holder(holder_orig);
342 if (lost_holder_register) { 342 if (lost_holder_register) {
343 if (*it->GetReceiver() == *holder()) { 343 if (*it->GetReceiver() == *holder()) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 // Check that we are allowed to write this. 429 // Check that we are allowed to write this.
430 bool is_nonexistent = holder()->map() == transition->GetBackPointer(); 430 bool is_nonexistent = holder()->map() == transition->GetBackPointer();
431 if (is_nonexistent) { 431 if (is_nonexistent) {
432 // Find the top object. 432 // Find the top object.
433 Handle<JSObject> last; 433 Handle<JSObject> last;
434 PrototypeIterator::WhereToEnd end = 434 PrototypeIterator::WhereToEnd end =
435 name->IsPrivate() ? PrototypeIterator::END_AT_NON_HIDDEN 435 name->IsPrivate() ? PrototypeIterator::END_AT_NON_HIDDEN
436 : PrototypeIterator::END_AT_NULL; 436 : PrototypeIterator::END_AT_NULL;
437 PrototypeIterator iter(isolate(), holder()); 437 PrototypeIterator iter(isolate(), holder());
438 while (!iter.IsAtEnd(end)) { 438 while (!iter.IsAtEnd(end)) {
439 last = Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)); 439 last = PrototypeIterator::GetCurrent<JSObject>(iter);
440 iter.Advance(); 440 iter.Advance();
441 } 441 }
442 if (!last.is_null()) set_holder(last); 442 if (!last.is_null()) set_holder(last);
443 NonexistentFrontendHeader(name, &miss, scratch1(), scratch2()); 443 NonexistentFrontendHeader(name, &miss, scratch1(), scratch2());
444 } else { 444 } else {
445 FrontendHeader(receiver(), name, &miss, DONT_RETURN_ANYTHING); 445 FrontendHeader(receiver(), name, &miss, DONT_RETURN_ANYTHING);
446 DCHECK(holder()->HasFastProperties()); 446 DCHECK(holder()->HasFastProperties());
447 } 447 }
448 448
449 int descriptor = transition->LastAdded(); 449 int descriptor = transition->LastAdded();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 : kNoExtraICState); 600 : kNoExtraICState);
601 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); 601 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode();
602 } 602 }
603 } 603 }
604 604
605 handlers->Add(cached_stub); 605 handlers->Add(cached_stub);
606 } 606 }
607 } 607 }
608 } // namespace internal 608 } // namespace internal
609 } // namespace v8 609 } // namespace v8
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698