Changeset 139145 in webkit
- Timestamp:
- Jan 8, 2013, 6:37:29 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r139136 r139145 1 2013-01-08 Oliver Hunt <oliver@apple.com> 2 3 Support op_typeof in the DFG 4 https://bugs.webkit.org/show_bug.cgi?id=98898 5 6 Reviewed by Filip Pizlo. 7 8 Adds a TypeOf node to the DFG to support op_typeof. 9 10 To avoid adding too much GC horror, this also makes the 11 common strings portion of the SmallString cache strongly 12 referenced. 13 14 * dfg/DFGAbstractState.cpp: 15 (JSC::DFG::AbstractState::execute): 16 We try to determine the result early here, and substitute in a constant. 17 Otherwise we leave the node intact, and set the result type to SpecString. 18 * dfg/DFGByteCodeParser.cpp: 19 (JSC::DFG::ByteCodeParser::parseBlock): 20 Parse op_typeof 21 * dfg/DFGCSEPhase.cpp: 22 (JSC::DFG::CSEPhase::performNodeCSE): 23 TypeOf nodes can be subjected to pure CSE 24 * dfg/DFGCapabilities.h: 25 (JSC::DFG::canCompileOpcode): 26 We can handle typeof. 27 * dfg/DFGNodeType.h: 28 (DFG): 29 Define the node. 30 * dfg/DFGOperations.cpp: 31 * dfg/DFGOperations.h: 32 Add operationTypeOf to support the non-trivial cases. 33 * dfg/DFGPredictionPropagationPhase.cpp: 34 (JSC::DFG::PredictionPropagationPhase::propagate): 35 * dfg/DFGSpeculativeJIT32_64.cpp: 36 (JSC::DFG::SpeculativeJIT::compile): 37 * dfg/DFGSpeculativeJIT64.cpp: 38 (JSC::DFG::SpeculativeJIT::compile): 39 Actual codegen 40 * runtime/Operations.cpp: 41 (JSC::jsTypeStringForValue): 42 (JSC): 43 * runtime/Operations.h: 44 (JSC): 45 Some refactoring to allow us to get the type string for an 46 object without needing a callframe. 47 48 1 49 2013-01-08 Filip Pizlo <fpizlo@apple.com> 2 50 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
r138921 r139145 32 32 #include "DFGBasicBlock.h" 33 33 #include "GetByIdStatus.h" 34 #include "Operations.h" 34 35 #include "PutByIdStatus.h" 35 36 … … 708 709 constantWasSet = trySetConstant(nodeIndex, jsBoolean(isJSString(child))); 709 710 break; 711 case IsObject: 712 if (child.isNull() || !child.isObject()) { 713 constantWasSet = trySetConstant(nodeIndex, jsBoolean(child.isNull())); 714 break; 715 } 710 716 default: 711 717 constantWasSet = false; … … 717 723 } 718 724 } 725 719 726 forNode(nodeIndex).set(SpecBoolean); 727 break; 728 } 729 730 case TypeOf: { 731 JSGlobalData* globalData = m_codeBlock->globalData(); 732 JSValue child = forNode(node.child1()).value(); 733 AbstractValue& abstractChild = forNode(node.child1()); 734 if (child) { 735 JSValue typeString = jsTypeStringForValue(*globalData, m_codeBlock->globalObjectFor(node.codeOrigin), child); 736 if (trySetConstant(nodeIndex, typeString)) { 737 m_foundConstants = true; 738 break; 739 } 740 } else if (isNumberSpeculation(abstractChild.m_type)) { 741 if (trySetConstant(nodeIndex, globalData->smallStrings.numberString())) { 742 forNode(node.child1()).filter(SpecNumber); 743 m_foundConstants = true; 744 break; 745 } 746 } else if (isStringSpeculation(abstractChild.m_type)) { 747 if (trySetConstant(nodeIndex, globalData->smallStrings.stringString())) { 748 forNode(node.child1()).filter(SpecString); 749 m_foundConstants = true; 750 break; 751 } 752 } else if (isFinalObjectSpeculation(abstractChild.m_type) || isArraySpeculation(abstractChild.m_type) || isArgumentsSpeculation(abstractChild.m_type)) { 753 if (trySetConstant(nodeIndex, globalData->smallStrings.objectString())) { 754 forNode(node.child1()).filter(SpecFinalObject | SpecArray | SpecArguments); 755 m_foundConstants = true; 756 break; 757 } 758 } else if (isFunctionSpeculation(abstractChild.m_type)) { 759 if (trySetConstant(nodeIndex, globalData->smallStrings.functionString())) { 760 forNode(node.child1()).filter(SpecFunction); 761 m_foundConstants = true; 762 break; 763 } 764 } else if (isBooleanSpeculation(abstractChild.m_type)) { 765 if (trySetConstant(nodeIndex, globalData->smallStrings.booleanString())) { 766 forNode(node.child1()).filter(SpecBoolean); 767 m_foundConstants = true; 768 break; 769 } 770 } else { 771 Node& childNode = m_graph[node.child1()]; 772 if (isCellSpeculation(childNode.prediction())) { 773 if (isStringSpeculation(childNode.prediction())) 774 forNode(node.child1()).filter(SpecString); 775 else 776 forNode(node.child1()).filter(SpecCell); 777 node.setCanExit(true); 778 } 779 } 780 forNode(nodeIndex).set(SpecString); 720 781 break; 721 782 } -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r139098 r139145 3224 3224 } 3225 3225 3226 case op_typeof: { 3227 set(currentInstruction[1].u.operand, 3228 addToGraph(TypeOf, get(currentInstruction[2].u.operand))); 3229 NEXT_OPCODE(op_typeof); 3230 } 3231 3226 3232 default: 3227 3233 // Parse failed! This should not happen because the capabilities checker -
trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
r138921 r139145 598 598 case AllocatePropertyStorage: 599 599 case ReallocatePropertyStorage: 600 case TypeOf: 600 601 return NoNode; 601 602 … … 1167 1168 case GetScopeRegisters: 1168 1169 case GetScope: 1170 case TypeOf: 1169 1171 setReplacement(pureCSE(node)); 1170 1172 break; -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h
r138921 r139145 199 199 case op_put_to_base_variable: 200 200 case op_put_to_base: 201 case op_typeof: 201 202 return CanCompile; 202 203 -
trunk/Source/JavaScriptCore/dfg/DFGNodeType.h
r138921 r139145 215 215 macro(IsObject, NodeResultBoolean) \ 216 216 macro(IsFunction, NodeResultBoolean) \ 217 macro(TypeOf, NodeResultJS) \ 217 218 macro(LogicalNot, NodeResultBoolean) \ 218 219 macro(ToPrimitive, NodeResultJS | NodeMustGenerate | NodeClobbersWorld) \ -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r138970 r139145 1427 1427 { 1428 1428 return jsIsFunctionType(JSValue::decode(value)); 1429 } 1430 1431 JSCell* DFG_OPERATION operationTypeOf(ExecState* exec, JSCell* value) 1432 { 1433 return jsTypeStringForValue(exec, JSValue(value)).asCell(); 1429 1434 } 1430 1435 -
trunk/Source/JavaScriptCore/dfg/DFGOperations.h
r138201 r139145 200 200 size_t DFG_OPERATION operationIsObject(ExecState*, EncodedJSValue) WTF_INTERNAL; 201 201 size_t DFG_OPERATION operationIsFunction(EncodedJSValue) WTF_INTERNAL; 202 JSCell* DFG_OPERATION operationTypeOf(ExecState*, JSCell*) WTF_INTERNAL; 202 203 void DFG_OPERATION operationReallocateStorageAndFinishPut(ExecState*, JSObject*, Structure*, PropertyOffset, EncodedJSValue) WTF_INTERNAL; 203 204 char* DFG_OPERATION operationAllocatePropertyStorageWithInitialCapacity(ExecState*) WTF_INTERNAL; -
trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r139068 r139145 519 519 break; 520 520 } 521 521 522 case TypeOf: { 523 changed |= setPrediction(SpecString); 524 changed |= mergeDefaultFlags(node); 525 break; 526 } 527 522 528 case GetById: { 523 529 changed |= mergePrediction(node.getHeapPrediction()); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r138921 r139145 4585 4585 break; 4586 4586 } 4587 case TypeOf: { 4588 JSValueOperand value(this, node.child1()); 4589 GPRReg tagGPR = value.tagGPR(); 4590 GPRReg payloadGPR = value.payloadGPR(); 4591 GPRTemporary temp(this); 4592 GPRReg tempGPR = temp.gpr(); 4593 GPRResult result(this); 4594 GPRReg resultGPR = result.gpr(); 4595 JITCompiler::JumpList doneJumps; 4596 4597 flushRegisters(); 4598 4599 JITCompiler::Jump isNotCell = m_jit.branch32(JITCompiler::NotEqual, tagGPR, JITCompiler::TrustedImm32(JSValue::CellTag)); 4600 Node& child = m_jit.graph()[node.child1()]; 4601 if (child.shouldSpeculateCell()) 4602 speculationCheck(BadType, JSValueRegs(tagGPR, payloadGPR), node.child1(), isNotCell); 4603 4604 if (!child.shouldSpeculateNonStringCell()) { 4605 m_jit.loadPtr(JITCompiler::Address(payloadGPR, JSCell::structureOffset()), tempGPR); 4606 JITCompiler::Jump notString = m_jit.branch8(JITCompiler::NotEqual, JITCompiler::Address(tempGPR, Structure::typeInfoTypeOffset()), TrustedImm32(StringType)); 4607 if (child.shouldSpeculateString()) 4608 speculationCheck(BadType, JSValueRegs(tagGPR, payloadGPR), node.child1(), notString); 4609 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.stringString()), resultGPR); 4610 doneJumps.append(m_jit.jump()); 4611 if (!child.shouldSpeculateString()) { 4612 notString.link(&m_jit); 4613 callOperation(operationTypeOf, resultGPR, payloadGPR); 4614 doneJumps.append(m_jit.jump()); 4615 } 4616 } else { 4617 callOperation(operationTypeOf, resultGPR, payloadGPR); 4618 doneJumps.append(m_jit.jump()); 4619 } 4620 4621 if (!child.shouldSpeculateCell()) { 4622 isNotCell.link(&m_jit); 4623 4624 m_jit.add32(TrustedImm32(1), tagGPR, tempGPR); 4625 JITCompiler::Jump notNumber = m_jit.branch32(JITCompiler::AboveOrEqual, tempGPR, JITCompiler::TrustedImm32(JSValue::LowestTag + 1)); 4626 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.numberString()), resultGPR); 4627 doneJumps.append(m_jit.jump()); 4628 notNumber.link(&m_jit); 4629 4630 JITCompiler::Jump notUndefined = m_jit.branch32(JITCompiler::NotEqual, tagGPR, TrustedImm32(JSValue::UndefinedTag)); 4631 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.undefinedString()), resultGPR); 4632 doneJumps.append(m_jit.jump()); 4633 notUndefined.link(&m_jit); 4634 4635 JITCompiler::Jump notNull = m_jit.branch32(JITCompiler::NotEqual, tagGPR, TrustedImm32(JSValue::NullTag)); 4636 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.objectString()), resultGPR); 4637 doneJumps.append(m_jit.jump()); 4638 notNull.link(&m_jit); 4639 4640 // Only boolean left 4641 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.booleanString()), resultGPR); 4642 } 4643 doneJumps.link(&m_jit); 4644 cellResult(resultGPR, m_compileIndex); 4645 break; 4646 } 4587 4647 4588 4648 case Phi: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r138921 r139145 4089 4089 4090 4090 jsValueResult(resultGPR, m_compileIndex, UseChildrenCalledExplicitly); 4091 4091 4092 4092 break; 4093 4093 } … … 4509 4509 m_jit.or32(TrustedImm32(ValueFalse), resultGPR); 4510 4510 jsValueResult(result.gpr(), m_compileIndex, DataFormatJSBoolean); 4511 break; 4512 } 4513 4514 case TypeOf: { 4515 JSValueOperand value(this, node.child1()); 4516 GPRReg valueGPR = value.gpr(); 4517 GPRTemporary temp(this); 4518 GPRReg tempGPR = temp.gpr(); 4519 GPRResult result(this); 4520 GPRReg resultGPR = result.gpr(); 4521 JITCompiler::JumpList doneJumps; 4522 4523 flushRegisters(); 4524 4525 JITCompiler::Jump isNotCell = m_jit.branchTest64(JITCompiler::NonZero, valueGPR, GPRInfo::tagMaskRegister); 4526 Node& child = m_jit.graph()[node.child1()]; 4527 if (child.shouldSpeculateCell()) 4528 speculationCheck(BadType, JSValueSource(valueGPR), node.child1(), isNotCell); 4529 4530 if (!child.shouldSpeculateNonStringCell()) { 4531 m_jit.loadPtr(JITCompiler::Address(valueGPR, JSCell::structureOffset()), tempGPR); 4532 JITCompiler::Jump notString = m_jit.branch8(JITCompiler::NotEqual, JITCompiler::Address(tempGPR, Structure::typeInfoTypeOffset()), TrustedImm32(StringType)); 4533 if (child.shouldSpeculateString()) 4534 speculationCheck(BadType, JSValueSource(valueGPR), node.child1(), notString); 4535 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.stringString()), resultGPR); 4536 doneJumps.append(m_jit.jump()); 4537 if (!child.shouldSpeculateString()) { 4538 notString.link(&m_jit); 4539 callOperation(operationTypeOf, resultGPR, valueGPR); 4540 doneJumps.append(m_jit.jump()); 4541 } 4542 } else { 4543 callOperation(operationTypeOf, resultGPR, valueGPR); 4544 doneJumps.append(m_jit.jump()); 4545 } 4546 4547 if (!child.shouldSpeculateCell()) { 4548 isNotCell.link(&m_jit); 4549 JITCompiler::Jump notNumber = m_jit.branchTest64(JITCompiler::Zero, valueGPR, GPRInfo::tagTypeNumberRegister); 4550 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.numberString()), resultGPR); 4551 doneJumps.append(m_jit.jump()); 4552 notNumber.link(&m_jit); 4553 4554 JITCompiler::Jump notUndefined = m_jit.branch64(JITCompiler::NotEqual, valueGPR, JITCompiler::TrustedImm64(ValueUndefined)); 4555 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.undefinedString()), resultGPR); 4556 doneJumps.append(m_jit.jump()); 4557 notUndefined.link(&m_jit); 4558 4559 JITCompiler::Jump notNull = m_jit.branch64(JITCompiler::NotEqual, valueGPR, JITCompiler::TrustedImm64(ValueNull)); 4560 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.objectString()), resultGPR); 4561 doneJumps.append(m_jit.jump()); 4562 notNull.link(&m_jit); 4563 4564 // Only boolean left 4565 m_jit.move(TrustedImmPtr(m_jit.globalData()->smallStrings.booleanString()), resultGPR); 4566 } 4567 doneJumps.link(&m_jit); 4568 cellResult(resultGPR, m_compileIndex); 4511 4569 break; 4512 4570 } -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r135469 r139145 493 493 } 494 494 495 m_globalData->smallStrings.visitStrongReferences(visitor); 496 495 497 { 496 498 GCPHASE(VisitMachineRoots); -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r131088 r139145 80 80 JSValue thisValue = exec->hostThisValue(); 81 81 if (thisValue == jsBoolean(false)) 82 return JSValue::encode(globalData->smallStrings.falseString( globalData));82 return JSValue::encode(globalData->smallStrings.falseString()); 83 83 84 84 if (thisValue == jsBoolean(true)) 85 return JSValue::encode(globalData->smallStrings.trueString( globalData));85 return JSValue::encode(globalData->smallStrings.trueString()); 86 86 87 87 if (!thisValue.inherits(&BooleanObject::s_info)) … … 89 89 90 90 if (asBooleanObject(thisValue)->internalValue() == jsBoolean(false)) 91 return JSValue::encode(globalData->smallStrings.falseString( globalData));91 return JSValue::encode(globalData->smallStrings.falseString()); 92 92 93 93 ASSERT(asBooleanObject(thisValue)->internalValue() == jsBoolean(true)); 94 return JSValue::encode(globalData->smallStrings.trueString( globalData));94 return JSValue::encode(globalData->smallStrings.trueString()); 95 95 } 96 96 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r139004 r139145 231 231 unlinkedEvalCodeBlockStructure.set(*this, UnlinkedEvalCodeBlock::createStructure(*this, 0, jsNull())); 232 232 unlinkedFunctionCodeBlockStructure.set(*this, UnlinkedFunctionCodeBlock::createStructure(*this, 0, jsNull())); 233 smallStrings.initializeCommonStrings(*this); 233 234 234 235 wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable); … … 246 247 247 248 heap.notifyIsSafeToCollect(); 248 249 249 250 LLInt::Data::performAssertions(*this); 250 251 -
trunk/Source/JavaScriptCore/runtime/JSString.h
r130303 r139145 334 334 inline JSString* jsEmptyString(JSGlobalData* globalData) 335 335 { 336 return globalData->smallStrings.emptyString( globalData);336 return globalData->smallStrings.emptyString(); 337 337 } 338 338 … … 387 387 int size = s.length(); 388 388 if (!size) 389 return globalData->smallStrings.emptyString( globalData);389 return globalData->smallStrings.emptyString(); 390 390 if (size == 1) { 391 391 UChar c = s.characterAt(0); … … 403 403 JSGlobalData* globalData = &exec->globalData(); 404 404 if (!length) 405 return globalData->smallStrings.emptyString( globalData);405 return globalData->smallStrings.emptyString(); 406 406 return jsSubstring(globalData, s->value(exec), offset, length); 407 407 } … … 413 413 ASSERT(offset + length <= static_cast<unsigned>(s.length())); 414 414 if (!length) 415 return globalData->smallStrings.emptyString( globalData);415 return globalData->smallStrings.emptyString(); 416 416 if (length == 1) { 417 417 UChar c = s.characterAt(offset); … … 428 428 ASSERT(offset + length <= static_cast<unsigned>(s.length())); 429 429 if (!length) 430 return globalData->smallStrings.emptyString( globalData);430 return globalData->smallStrings.emptyString(); 431 431 if (length == 1) { 432 432 UChar c = s.characterAt(offset); … … 441 441 int size = s.length(); 442 442 if (!size) 443 return globalData->smallStrings.emptyString( globalData);443 return globalData->smallStrings.emptyString(); 444 444 if (size == 1) { 445 445 UChar c = s.characterAt(0); -
trunk/Source/JavaScriptCore/runtime/JSValue.cpp
r138073 r139145 296 296 return jsString(&globalData, globalData.numericStrings.add(asDouble())); 297 297 if (isTrue()) 298 return globalData.smallStrings.trueString( &globalData);298 return globalData.smallStrings.trueString(); 299 299 if (isFalse()) 300 return globalData.smallStrings.falseString( &globalData);300 return globalData.smallStrings.falseString(); 301 301 if (isNull()) 302 return globalData.smallStrings.nullString( &globalData);302 return globalData.smallStrings.nullString(); 303 303 if (isUndefined()) 304 return globalData.smallStrings.undefinedString( &globalData);304 return globalData.smallStrings.undefinedString(); 305 305 306 306 ASSERT(isCell()); -
trunk/Source/JavaScriptCore/runtime/Operations.cpp
r137699 r139145 57 57 } 58 58 59 JSValue jsTypeStringForValue( CallFrame* callFrame, JSValue v)59 JSValue jsTypeStringForValue(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue v) 60 60 { 61 JSGlobalData& globalData = callFrame->globalData();62 61 if (v.isUndefined()) 63 return globalData.smallStrings.undefinedString( &globalData);62 return globalData.smallStrings.undefinedString(); 64 63 if (v.isBoolean()) 65 return globalData.smallStrings.booleanString( &globalData);64 return globalData.smallStrings.booleanString(); 66 65 if (v.isNumber()) 67 return globalData.smallStrings.numberString( &globalData);66 return globalData.smallStrings.numberString(); 68 67 if (v.isString()) 69 return globalData.smallStrings.stringString( &globalData);68 return globalData.smallStrings.stringString(); 70 69 if (v.isObject()) { 71 70 // Return "undefined" for objects that should be treated 72 71 // as null when doing comparisons. 73 if (asObject(v)->structure()->masqueradesAsUndefined( callFrame->lexicalGlobalObject()))74 return globalData.smallStrings.undefinedString( &globalData);72 if (asObject(v)->structure()->masqueradesAsUndefined(globalObject)) 73 return globalData.smallStrings.undefinedString(); 75 74 CallData callData; 76 75 JSObject* object = asObject(v); 77 76 if (object->methodTable()->getCallData(object, callData) != CallTypeNone) 78 return globalData.smallStrings.functionString( &globalData);77 return globalData.smallStrings.functionString(); 79 78 } 80 return globalData.smallStrings.objectString(&globalData); 79 return globalData.smallStrings.objectString(); 80 } 81 82 JSValue jsTypeStringForValue(CallFrame* callFrame, JSValue v) 83 { 84 return jsTypeStringForValue(callFrame->globalData(), callFrame->lexicalGlobalObject(), v); 81 85 } 82 86 -
trunk/Source/JavaScriptCore/runtime/Operations.h
r137700 r139145 33 33 NEVER_INLINE JSValue jsAddSlowCase(CallFrame*, JSValue, JSValue); 34 34 JSValue jsTypeStringForValue(CallFrame*, JSValue); 35 JSValue jsTypeStringForValue(JSGlobalData&, JSGlobalObject*, JSValue); 35 36 bool jsIsObjectType(CallFrame*, JSValue); 36 37 bool jsIsFunctionType(JSValue); -
trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp
r127191 r139145 81 81 } 82 82 83 void SmallStrings::initializeCommonStrings(JSGlobalData& globalData) 84 { 85 createEmptyString(&globalData); 86 #define JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE(name) initialize(&globalData, m_##name, #name); 87 JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE) 88 #undef JSC_COMMON_STRINGS_ATTRIBUTE_INITIALIZE 89 } 90 91 void SmallStrings::visitStrongReferences(SlotVisitor& visitor) 92 { 93 visitor.appendUnbarrieredPointer(&m_emptyString); 94 #define JSC_COMMON_STRINGS_ATTRIBUTE_VISIT(name) visitor.appendUnbarrieredPointer(&m_##name); 95 JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_VISIT) 96 #undef JSC_COMMON_STRINGS_ATTRIBUTE_VISIT 97 } 98 83 99 SmallStrings::~SmallStrings() 84 100 { … … 90 106 for (unsigned i = 0; i < singleCharacterStringCount; ++i) 91 107 finalize(m_singleCharacterStrings[i]); 92 #define JSC_COMMON_STRINGS_ATTRIBUTE_FINALIZE(name) finalize(m_##name);93 JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_FINALIZE)94 #undef JSC_COMMON_STRINGS_ATTRIBUTE_FINALIZE95 108 } 96 109 -
trunk/Source/JavaScriptCore/runtime/SmallStrings.h
r127191 r139145 26 26 #ifndef SmallStrings_h 27 27 #define SmallStrings_h 28 29 #include "WriteBarrier.h" 28 30 29 31 #include <wtf/FixedArray.h> … … 62 64 ~SmallStrings(); 63 65 64 JSString* emptyString( JSGlobalData* globalData)66 JSString* emptyString() 65 67 { 66 if (!m_emptyString)67 createEmptyString(globalData);68 68 return m_emptyString; 69 69 } … … 82 82 JSString** singleCharacterStrings() { return &m_singleCharacterStrings[0]; } 83 83 84 void initializeCommonStrings(JSGlobalData&); 85 void visitStrongReferences(SlotVisitor&); 86 84 87 #define JSC_COMMON_STRINGS_ACCESSOR_DEFINITION(name) \ 85 JSString* name##String( JSGlobalData* globalData) const \88 JSString* name##String() const \ 86 89 { \ 87 if (!m_##name) \88 initialize(globalData, m_##name, #name); \89 90 return m_##name; \ 90 91 } … … 101 102 102 103 JSString* m_emptyString; 103 #define JSC_COMMON_STRINGS_ATTRIBUTE_DECLARATION(name) mutableJSString* m_##name;104 #define JSC_COMMON_STRINGS_ATTRIBUTE_DECLARATION(name) JSString* m_##name; 104 105 JSC_COMMON_STRINGS_EACH_NAME(JSC_COMMON_STRINGS_ATTRIBUTE_DECLARATION) 105 106 #undef JSC_COMMON_STRINGS_ATTRIBUTE_DECLARATION
Note:
See TracChangeset
for help on using the changeset viewer.