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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 893073006: Add map-based read barrier to WeakCell Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge Created 5 years, 10 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-instructions.h ('k') | src/ia32/lithium-codegen-ia32.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 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_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 // or an AllocationSite, but the memory is safe to examine. 2252 // or an AllocationSite, but the memory is safe to examine.
2253 // AllocationSite::kTransitionInfoOffset - contains a Smi or pointer to 2253 // AllocationSite::kTransitionInfoOffset - contains a Smi or pointer to
2254 // FixedArray. 2254 // FixedArray.
2255 // WeakCell::kValueOffset - contains a JSFunction or Smi(0) 2255 // WeakCell::kValueOffset - contains a JSFunction or Smi(0)
2256 // Symbol::kHashFieldSlot - if the low bit is 1, then the hash is not 2256 // Symbol::kHashFieldSlot - if the low bit is 1, then the hash is not
2257 // computed, meaning that it can't appear to be a pointer. If the low bit is 2257 // computed, meaning that it can't appear to be a pointer. If the low bit is
2258 // 0, then hash is computed, but the 0 bit prevents the field from appearing 2258 // 0, then hash is computed, but the 0 bit prevents the field from appearing
2259 // to be a pointer. 2259 // to be a pointer.
2260 STATIC_ASSERT(WeakCell::kSize >= kPointerSize); 2260 STATIC_ASSERT(WeakCell::kSize >= kPointerSize);
2261 STATIC_ASSERT(AllocationSite::kTransitionInfoOffset == 2261 STATIC_ASSERT(AllocationSite::kTransitionInfoOffset ==
2262 WeakCell::kValueOffset && 2262 WeakCell::kValueOffsetDontForgetTheReadBarrier &&
2263 WeakCell::kValueOffset == Symbol::kHashFieldSlot); 2263 AllocationSite::kTransitionInfoOffset ==
2264 Symbol::kHashFieldSlot);
2264 2265
2265 __ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); 2266 __ cmp(edi,
2267 FieldOperand(ecx, WeakCell::kValueOffsetDontForgetTheReadBarrier));
2266 __ j(not_equal, &extra_checks_or_miss); 2268 __ j(not_equal, &extra_checks_or_miss);
2267 2269
2268 // The compare above could have been a SMI/SMI comparison. Guard against this 2270 // The compare above could have been a SMI/SMI comparison. Guard against this
2269 // convincing us that we have a monomorphic JSFunction. 2271 // convincing us that we have a monomorphic JSFunction.
2270 __ JumpIfSmi(edi, &extra_checks_or_miss); 2272 __ JumpIfSmi(edi, &extra_checks_or_miss);
2271 2273
2272 __ bind(&have_js_function); 2274 __ bind(&have_js_function);
2273 if (CallAsMethod()) { 2275 if (CallAsMethod()) {
2274 EmitContinueIfStrictOrNative(masm, &cont); 2276 EmitContinueIfStrictOrNative(masm, &cont);
2275 2277
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after
3785 __ ret(0); 3787 __ ret(0);
3786 3788
3787 __ bind(&miss); 3789 __ bind(&miss);
3788 GenerateMiss(masm); 3790 GenerateMiss(masm);
3789 } 3791 }
3790 3792
3791 3793
3792 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) { 3794 void CompareICStub::GenerateKnownObjects(MacroAssembler* masm) {
3793 Label miss; 3795 Label miss;
3794 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_); 3796 Handle<WeakCell> cell = Map::WeakCellForMap(known_map_);
3797 // Combine two Smi tests into one with bitwise and.
3795 __ mov(ecx, edx); 3798 __ mov(ecx, edx);
3796 __ and_(ecx, eax); 3799 __ and_(ecx, eax);
3797 __ JumpIfSmi(ecx, &miss, Label::kNear); 3800 __ JumpIfSmi(ecx, &miss, Label::kNear);
3798 3801
3799 __ GetWeakValue(edi, cell); 3802 __ GetWeakValueNoReadBarrier(edi, cell);
3800 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); 3803 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset));
3801 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); 3804 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset));
3802 __ cmp(ecx, edi); 3805 __ cmp(ecx, edi);
3803 __ j(not_equal, &miss, Label::kNear); 3806 __ j(not_equal, &miss, Label::kNear);
3804 __ cmp(ebx, edi); 3807 __ cmp(ebx, edi);
3805 __ j(not_equal, &miss, Label::kNear); 3808 __ j(not_equal, &miss, Label::kNear);
3806 3809
3807 __ sub(eax, edx); 3810 __ sub(eax, edx);
3808 __ ret(0); 3811 __ ret(0);
3809 3812
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
5098 ApiParameterOperand(2), kStackSpace, nullptr, 5101 ApiParameterOperand(2), kStackSpace, nullptr,
5099 Operand(ebp, 7 * kPointerSize), NULL); 5102 Operand(ebp, 7 * kPointerSize), NULL);
5100 } 5103 }
5101 5104
5102 5105
5103 #undef __ 5106 #undef __
5104 5107
5105 } } // namespace v8::internal 5108 } } // namespace v8::internal
5106 5109
5107 #endif // V8_TARGET_ARCH_IA32 5110 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698