Changeset 220352 in webkit for trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
- Timestamp:
- Aug 7, 2017, 2:31:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r220219 r220352 3236 3236 LValue butterfly = m_out.loadPtr(lowCell(m_node->child1()), m_heaps.JSObject_butterfly); 3237 3237 if (m_node->op() != GetButterflyWithoutCaging) 3238 butterfly = caged( butterfly);3238 butterfly = caged(Gigacage::JSValue, butterfly); 3239 3239 setStorage(butterfly); 3240 3240 } … … 3273 3273 3274 3274 DFG_ASSERT(m_graph, m_node, isTypedView(m_node->arrayMode().typedArrayType())); 3275 setStorage(caged( m_out.loadPtr(cell, m_heaps.JSArrayBufferView_vector)));3275 setStorage(caged(Gigacage::Primitive, m_out.loadPtr(cell, m_heaps.JSArrayBufferView_vector))); 3276 3276 } 3277 3277 … … 5041 5041 } 5042 5042 5043 LValue allocator = allocatorForSize(vm(). auxiliarySpace, byteSize, slowCase);5043 LValue allocator = allocatorForSize(vm().primitiveGigacageAuxiliarySpace, byteSize, slowCase); 5044 5044 LValue storage = allocateHeapCell(allocator, slowCase); 5045 5045 … … 8870 8870 int32_t offsetOfFirstProperty = static_cast<int32_t>(offsetInButterfly(firstOutOfLineOffset)) * sizeof(EncodedJSValue); 8871 8871 ValueFromBlock outOfLineResult = m_out.anchor( 8872 m_out.load64(m_out.baseIndex(m_heaps.properties.atAnyNumber(), caged( storage), realIndex, ScaleEight, offsetOfFirstProperty)));8872 m_out.load64(m_out.baseIndex(m_heaps.properties.atAnyNumber(), caged(Gigacage::JSValue, storage), realIndex, ScaleEight, offsetOfFirstProperty))); 8873 8873 m_out.jump(continuation); 8874 8874 … … 9050 9050 9051 9051 LValue startOfStorage = allocateHeapCell( 9052 allocatorForSize(vm(). auxiliarySpace, butterflySize, slowPath),9052 allocatorForSize(vm().jsValueGigacageAuxiliarySpace, butterflySize, slowPath), 9053 9053 slowPath); 9054 9054 … … 10006 10006 10007 10007 size_t sizeInBytes = sizeInValues * sizeof(JSValue); 10008 MarkedAllocator* allocator = vm(). auxiliarySpace.allocatorFor(sizeInBytes);10008 MarkedAllocator* allocator = vm().jsValueGigacageAuxiliarySpace.allocatorFor(sizeInBytes); 10009 10009 LValue startOfStorage = allocateHeapCell(m_out.constIntPtr(allocator), slowPath); 10010 10010 ValueFromBlock fastButterfly = m_out.anchor( … … 11234 11234 payloadSize, m_out.constIntPtr(sizeof(IndexingHeader))); 11235 11235 11236 LValue allocator = allocatorForSize(vm(). auxiliarySpace, butterflySize, failCase);11236 LValue allocator = allocatorForSize(vm().jsValueGigacageAuxiliarySpace, butterflySize, failCase); 11237 11237 LValue startOfStorage = allocateHeapCell(allocator, failCase); 11238 11238 … … 11615 11615 } 11616 11616 11617 LValue caged(LValue ptr) 11618 { 11619 if (vm().gigacageEnabled().isStillValid()) { 11620 m_graph.watchpoints().addLazily(vm().gigacageEnabled()); 11621 11622 LValue basePtr = m_out.constIntPtr(g_gigacageBasePtr); 11623 LValue mask = m_out.constIntPtr(GIGACAGE_MASK); 11624 11625 // We don't have to worry about B3 messing up the bitAnd. Also, we want to get B3's excellent 11626 // codegen for 2-operand andq on x86-64. 11627 LValue masked = m_out.bitAnd(ptr, mask); 11628 11629 // But B3 will currently mess up the code generation of this add. Basically, any offset from what we 11630 // compute here will get reassociated and folded with g_gigacageBasePtr. There's a world in which 11631 // moveConstants() observes that it needs to reassociate in order to hoist the big constants. But 11632 // it's much easier to just block B3's badness here. That's what we do for now. 11633 PatchpointValue* patchpoint = m_out.patchpoint(pointerType()); 11634 patchpoint->appendSomeRegister(basePtr); 11635 patchpoint->appendSomeRegister(masked); 11636 patchpoint->setGenerator( 11637 [] (CCallHelpers& jit, const StackmapGenerationParams& params) { 11638 jit.addPtr(params[1].gpr(), params[2].gpr(), params[0].gpr()); 11639 }); 11640 patchpoint->effects = Effects::none(); 11641 return patchpoint; 11642 } 11643 11644 return ptr; 11617 LValue caged(Gigacage::Kind kind, LValue ptr) 11618 { 11619 if (kind == Gigacage::Primitive) { 11620 if (vm().primitiveGigacageEnabled().isStillValid()) 11621 m_graph.watchpoints().addLazily(vm().primitiveGigacageEnabled()); 11622 else 11623 return ptr; 11624 } 11625 11626 LValue basePtr = m_out.constIntPtr(Gigacage::basePtr(kind)); 11627 LValue mask = m_out.constIntPtr(GIGACAGE_MASK); 11628 11629 // We don't have to worry about B3 messing up the bitAnd. Also, we want to get B3's excellent 11630 // codegen for 2-operand andq on x86-64. 11631 LValue masked = m_out.bitAnd(ptr, mask); 11632 11633 // But B3 will currently mess up the code generation of this add. Basically, any offset from what we 11634 // compute here will get reassociated and folded with Gigacage::basePtr. There's a world in which 11635 // moveConstants() observes that it needs to reassociate in order to hoist the big constants. But 11636 // it's much easier to just block B3's badness here. That's what we do for now. 11637 PatchpointValue* patchpoint = m_out.patchpoint(pointerType()); 11638 patchpoint->appendSomeRegister(basePtr); 11639 patchpoint->appendSomeRegister(masked); 11640 patchpoint->setGenerator( 11641 [] (CCallHelpers& jit, const StackmapGenerationParams& params) { 11642 jit.addPtr(params[1].gpr(), params[2].gpr(), params[0].gpr()); 11643 }); 11644 patchpoint->effects = Effects::none(); 11645 return patchpoint; 11645 11646 } 11646 11647
Note:
See TracChangeset
for help on using the changeset viewer.