|
Lines 334-346
struct SymbolTableIndexHashTraits : Hash
Source/JavaScriptCore/runtime/SymbolTable.h_sec1
|
| 334 |
static const bool needsDestruction = true; |
334 |
static const bool needsDestruction = true; |
| 335 |
}; |
335 |
}; |
| 336 |
|
336 |
|
| 337 |
class SymbolTable { |
337 |
class SymbolTable : public JSCell { |
| 338 |
public: |
338 |
public: |
|
|
339 |
typedef JSCell Base; |
| 340 |
|
| 339 |
typedef HashMap<RefPtr<StringImpl>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<StringImpl>>, SymbolTableIndexHashTraits> Map; |
341 |
typedef HashMap<RefPtr<StringImpl>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<StringImpl>>, SymbolTableIndexHashTraits> Map; |
| 340 |
|
342 |
|
| 341 |
JS_EXPORT_PRIVATE SymbolTable(); |
343 |
static SymbolTable* create(VM& vm) |
| 342 |
JS_EXPORT_PRIVATE ~SymbolTable(); |
344 |
{ |
| 343 |
|
345 |
SymbolTable* symbolTable = new (NotNull, allocateCell<SymbolTable>(vm.heap)) SymbolTable(vm); |
|
|
346 |
symbolTable->finishCreation(vm); |
| 347 |
return symbolTable; |
| 348 |
} |
| 349 |
static const bool needsDestruction = true; |
| 350 |
static const bool hasImmortalStructure = true; |
| 351 |
static void destroy(JSCell*); |
| 352 |
|
| 353 |
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) |
| 354 |
{ |
| 355 |
return Structure::create(vm, globalObject, prototype, TypeInfo(LeafType, StructureFlags), info()); |
| 356 |
} |
| 357 |
|
| 344 |
// You must hold the lock until after you're done with the iterator. |
358 |
// You must hold the lock until after you're done with the iterator. |
| 345 |
Map::iterator find(const ConcurrentJITLocker&, StringImpl* key) |
359 |
Map::iterator find(const ConcurrentJITLocker&, StringImpl* key) |
| 346 |
{ |
360 |
{ |
|
Lines 433-464
public:
Source/JavaScriptCore/runtime/SymbolTable.h_sec2
|
| 433 |
return contains(locker, key); |
447 |
return contains(locker, key); |
| 434 |
} |
448 |
} |
| 435 |
|
449 |
|
| 436 |
private: |
|
|
| 437 |
Map m_map; |
| 438 |
public: |
| 439 |
mutable ConcurrentJITLock m_lock; |
| 440 |
}; |
| 441 |
|
| 442 |
|
| 443 |
class SharedSymbolTable : public JSCell, public SymbolTable { |
| 444 |
public: |
| 445 |
typedef JSCell Base; |
| 446 |
|
| 447 |
static SharedSymbolTable* create(VM& vm) |
| 448 |
{ |
| 449 |
SharedSymbolTable* sharedSymbolTable = new (NotNull, allocateCell<SharedSymbolTable>(vm.heap)) SharedSymbolTable(vm); |
| 450 |
sharedSymbolTable->finishCreation(vm); |
| 451 |
return sharedSymbolTable; |
| 452 |
} |
| 453 |
static const bool needsDestruction = true; |
| 454 |
static const bool hasImmortalStructure = true; |
| 455 |
static void destroy(JSCell*); |
| 456 |
|
| 457 |
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) |
| 458 |
{ |
| 459 |
return Structure::create(vm, globalObject, prototype, TypeInfo(LeafType, StructureFlags), info()); |
| 460 |
} |
| 461 |
|
| 462 |
bool usesNonStrictEval() { return m_usesNonStrictEval; } |
450 |
bool usesNonStrictEval() { return m_usesNonStrictEval; } |
| 463 |
void setUsesNonStrictEval(bool usesNonStrictEval) { m_usesNonStrictEval = usesNonStrictEval; } |
451 |
void setUsesNonStrictEval(bool usesNonStrictEval) { m_usesNonStrictEval = usesNonStrictEval; } |
| 464 |
|
452 |
|
|
Lines 481-495
public:
Source/JavaScriptCore/runtime/SymbolTable.h_sec3
|
| 481 |
DECLARE_EXPORT_INFO; |
469 |
DECLARE_EXPORT_INFO; |
| 482 |
|
470 |
|
| 483 |
private: |
471 |
private: |
| 484 |
SharedSymbolTable(VM& vm) |
472 |
JS_EXPORT_PRIVATE SymbolTable(VM&); |
| 485 |
: JSCell(vm, vm.sharedSymbolTableStructure.get()) |
473 |
~SymbolTable(); |
| 486 |
, m_parameterCountIncludingThis(0) |
|
|
| 487 |
, m_usesNonStrictEval(false) |
| 488 |
, m_captureStart(0) |
| 489 |
, m_captureEnd(0) |
| 490 |
{ |
| 491 |
} |
| 492 |
|
474 |
|
|
|
475 |
Map m_map; |
| 476 |
|
| 493 |
int m_parameterCountIncludingThis; |
477 |
int m_parameterCountIncludingThis; |
| 494 |
bool m_usesNonStrictEval; |
478 |
bool m_usesNonStrictEval; |
| 495 |
|
479 |
|
|
Lines 497-502
private:
Source/JavaScriptCore/runtime/SymbolTable.h_sec4
|
| 497 |
int m_captureEnd; |
481 |
int m_captureEnd; |
| 498 |
|
482 |
|
| 499 |
std::unique_ptr<SlowArgument[]> m_slowArguments; |
483 |
std::unique_ptr<SlowArgument[]> m_slowArguments; |
|
|
484 |
|
| 485 |
public: |
| 486 |
mutable ConcurrentJITLock m_lock; |
| 500 |
}; |
487 |
}; |
| 501 |
|
488 |
|
| 502 |
} // namespace JSC |
489 |
} // namespace JSC |