Changeset 11213 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Nov 15, 2005, 5:45:12 PM (20 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r10713 r11213 404 404 } while (scr != InterpreterImp::s_hook); 405 405 } 406 ConstantValues::mark(); 406 407 407 408 // MARK: first mark all referenced objects recursively starting out from the set of root objects -
trunk/JavaScriptCore/kjs/internal.cpp
r10713 r11213 435 435 InterpreterImp* InterpreterImp::s_hook = 0L; 436 436 437 void InterpreterImp::globalInit()438 {439 ConstantValues::init();440 }441 442 void InterpreterImp::globalClear()443 {444 ConstantValues::clear();445 }446 447 437 typedef HashMap<ObjectImp *, InterpreterImp *, PointerHash<ObjectImp *> > InterpreterMap; 448 438 … … 470 460 // This is the first interpreter 471 461 s_hook = next = prev = this; 472 globalInit();473 462 } 474 463 … … 488 477 { 489 478 lockInterpreter(); 479 480 // FIXME: Hack-o-rama. To prevent construction of a global object with a null prototype (4342216), 481 // we need to intialize our constants before the first object is constructed. InterpreterImp::lock() 482 // is a good place to do this because you have to call it before doing any allocations. Once we change our 483 // implementation to use immediate values, we should remove this code. 484 ConstantValues::initIfNeeded(); 490 485 } 491 486 … … 639 634 // This was the last interpreter 640 635 s_hook = 0L; 641 globalClear();642 636 } 643 637 interpreterMap().remove(global); … … 646 640 void InterpreterImp::mark() 647 641 { 648 ConstantValues::mark();649 642 if (m_interpreter) 650 643 m_interpreter->mark(); -
trunk/JavaScriptCore/kjs/internal.h
r10757 r11213 247 247 friend class Collector; 248 248 public: 249 static void globalInit();250 static void globalClear();251 252 249 InterpreterImp(Interpreter *interp, ObjectImp *glob); 253 250 ~InterpreterImp(); -
trunk/JavaScriptCore/kjs/value.cpp
r10757 r11213 188 188 } 189 189 190 void ConstantValues::init() 191 { 190 void ConstantValues::initIfNeeded() 191 { 192 if (undefined) 193 return; 194 192 195 undefined = new UndefinedImp(); 193 196 null = new NullImp(); … … 196 199 } 197 200 198 void ConstantValues::clear()199 {200 undefined = NULL;201 null = NULL;202 jsTrue = NULL;203 jsFalse = NULL;204 }205 206 201 void ConstantValues::mark() 207 202 { -
trunk/JavaScriptCore/kjs/value.h
r10757 r11213 197 197 static AllocatedValueImp *jsTrue; 198 198 199 static void init(); 200 static void clear(); 199 static void initIfNeeded(); 201 200 static void mark(); 202 201 };
Note:
See TracChangeset
for help on using the changeset viewer.