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

Side by Side Diff: src/ic/x87/handler-compiler-x87.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/x64/handler-compiler-x64.cc ('k') | 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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 717
718 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal( 718 Handle<Code> NamedLoadHandlerCompiler::CompileLoadGlobal(
719 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) { 719 Handle<PropertyCell> cell, Handle<Name> name, bool is_configurable) {
720 Label miss; 720 Label miss;
721 if (IC::ICUseVector(kind())) { 721 if (IC::ICUseVector(kind())) {
722 PushVectorAndSlot(); 722 PushVectorAndSlot();
723 } 723 }
724 FrontendHeader(receiver(), name, &miss); 724 FrontendHeader(receiver(), name, &miss);
725 // Get the value from the cell. 725 // Get the value from the cell.
726 Register result = StoreDescriptor::ValueRegister(); 726 Register result = StoreDescriptor::ValueRegister();
727 if (masm()->serializer_enabled()) { 727 Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
728 __ mov(result, Immediate(cell)); 728 __ LoadWeakValue(result, weak_cell, &miss);
729 __ mov(result, FieldOperand(result, PropertyCell::kValueOffset)); 729 __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
730 } else {
731 __ mov(result, Operand::ForCell(cell));
732 }
733 730
734 // Check for deleted property if property can actually be deleted. 731 // Check for deleted property if property can actually be deleted.
735 if (is_configurable) { 732 if (is_configurable) {
736 __ cmp(result, factory()->the_hole_value()); 733 __ cmp(result, factory()->the_hole_value());
737 __ j(equal, &miss); 734 __ j(equal, &miss);
738 } else if (FLAG_debug_code) { 735 } else if (FLAG_debug_code) {
739 __ cmp(result, factory()->the_hole_value()); 736 __ cmp(result, factory()->the_hole_value());
740 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole); 737 __ Check(not_equal, kDontDeleteCellsCannotContainTheHole);
741 } 738 }
742 739
(...skipping 10 matching lines...) Expand all
753 // Return the generated code. 750 // Return the generated code.
754 return GetCode(kind(), Code::NORMAL, name); 751 return GetCode(kind(), Code::NORMAL, name);
755 } 752 }
756 753
757 754
758 #undef __ 755 #undef __
759 } 756 }
760 } // namespace v8::internal 757 } // namespace v8::internal
761 758
762 #endif // V8_TARGET_ARCH_X87 759 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698