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

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

Issue 816923004: Use weak cell in LoadGlobal handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/x64/handler-compiler-x64.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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { 694 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
695 Label miss; 695 Label miss;
696 if (IC::ICUseVector(kind())) { 696 if (IC::ICUseVector(kind())) {
697 PushVectorAndSlot(); 697 PushVectorAndSlot();
698 } 698 }
699 699
700 FrontendHeader(receiver(), name, &miss); 700 FrontendHeader(receiver(), name, &miss);
701 701
702 // Get the value from the cell. 702 // Get the value from the cell.
703 Register result = StoreDescriptor::ValueRegister(); 703 Register result = StoreDescriptor::ValueRegister();
704 __ li(result, Operand(cell)); 704 Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
705 __ LoadWeakValue(result, weak_cell, &miss);
705 __ lw(result, FieldMemOperand(result, Cell::kValueOffset)); 706 __ lw(result, FieldMemOperand(result, Cell::kValueOffset));
706 707
707 // Check for deleted property if property can actually be deleted. 708 // Check for deleted property if property can actually be deleted.
708 if (is_configurable) { 709 if (is_configurable) {
709 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 710 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
710 __ Branch(&miss, eq, result, Operand(at)); 711 __ Branch(&miss, eq, result, Operand(at));
711 } 712 }
712 713
713 Counters* counters = isolate()->counters(); 714 Counters* counters = isolate()->counters();
714 __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3); 715 __ IncrementCounter(counters->named_load_global_stub(), 1, a1, a3);
715 if (IC::ICUseVector(kind())) { 716 if (IC::ICUseVector(kind())) {
716 DiscardVectorAndSlot(); 717 DiscardVectorAndSlot();
717 } 718 }
718 __ Ret(USE_DELAY_SLOT); 719 __ Ret(USE_DELAY_SLOT);
719 __ mov(v0, result); 720 __ mov(v0, result);
720 721
721 FrontendFooter(name, &miss); 722 FrontendFooter(name, &miss);
722 723
723 // Return the generated code. 724 // Return the generated code.
724 return GetCode(kind(), Code::NORMAL, name); 725 return GetCode(kind(), Code::NORMAL, name);
725 } 726 }
726 727
727 728
728 #undef __ 729 #undef __
729 } 730 }
730 } // namespace v8::internal 731 } // namespace v8::internal
731 732
732 #endif // V8_TARGET_ARCH_MIPS 733 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698