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

Side by Side Diff: src/ic/x64/handler-compiler-x64.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/mips/handler-compiler-mips.cc ('k') | src/ic/x87/handler-compiler-x87.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_X64 7 #if V8_TARGET_ARCH_X64
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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( 705 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
706 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { 706 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
707 Label miss; 707 Label miss;
708 if (IC::ICUseVector(kind())) { 708 if (IC::ICUseVector(kind())) {
709 PushVectorAndSlot(); 709 PushVectorAndSlot();
710 } 710 }
711 FrontendHeader(receiver(), name, &miss); 711 FrontendHeader(receiver(), name, &miss);
712 712
713 // Get the value from the cell. 713 // Get the value from the cell.
714 Register result = StoreDescriptor::ValueRegister(); 714 Register result = StoreDescriptor::ValueRegister();
715 __ Move(result, cell); 715 Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
716 __ LoadWeakValue(result, weak_cell, &miss);
716 __ movp(result, FieldOperand(result, PropertyCell::kValueOffset)); 717 __ movp(result, FieldOperand(result, PropertyCell::kValueOffset));
717 718
718 // Check for deleted property if property can actually be deleted. 719 // Check for deleted property if property can actually be deleted.
719 if (is_configurable) { 720 if (is_configurable) {
720 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 721 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
721 __ j(equal, &miss); 722 __ j(equal, &miss);
722 } else if (FLAG_debug_code) { 723 } else if (FLAG_debug_code) {
723 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); 724 __ CompareRoot(result, Heap::kTheHoleValueRootIndex);
724 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole); 725 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
725 } 726 }
(...skipping 10 matching lines...) Expand all
736 // Return the generated code. 737 // Return the generated code.
737 return GetCode(kind(), Code::NORMAL, name); 738 return GetCode(kind(), Code::NORMAL, name);
738 } 739 }
739 740
740 741
741 #undef __ 742 #undef __
742 } 743 }
743 } // namespace v8::internal 744 } // namespace v8::internal
744 745
745 #endif // V8_TARGET_ARCH_X64 746 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/x87/handler-compiler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698