ChangeLog-2007-10-14 982 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222
  1. === Start merge of feature-branch 2007-10-12 ===
  2. 2007-10-11 Andrew Wellington <proton@wiretapped.net>
  3. Reviewed by Eric Seidel.
  4. Fix for http://bugs.webkit.org/show_bug.cgi?id=15076
  5. "deg2rad has multiple definitions"
  6. Define deg2rad, rad2deg, deg2grad, grad2deg, rad2grad, grad2rad
  7. These are used through WebKit.
  8. Change based on original patch by Rob Buis.
  9. * wtf/MathExtras.h:
  10. (deg2rad):
  11. (rad2deg):
  12. (deg2grad):
  13. (grad2deg):
  14. (rad2grad):
  15. (grad2rad):
  16. 2007-10-10 Maciej Stachowiak <mjs@apple.com>
  17. Reviewed by Eric.
  18. - fix assertion failures on quit.
  19. * kjs/array_object.cpp:
  20. (ArrayProtoFunc::callAsFunction): Dynamically alocate function-scope static
  21. UStrings to avoid the static destructor getting called later.
  22. * kjs/lookup.h: Dynamically alocate function-scope static
  23. Identifiers to avoid the static destructor getting called later.
  24. 2007-10-07 Ed Schouten <ed@fxq.nl>
  25. Reviewed and landed by Alexey Proskuryakov.
  26. Add PLATFORM(FREEBSD), so we can fix the build on FreeBSD-like
  27. systems by including <pthread_np.h>. Also fix some (disabled)
  28. regcomp()/regexec() code; it seems some variable names have
  29. changed.
  30. * kjs/config.h:
  31. * kjs/regexp.cpp:
  32. (KJS::RegExp::RegExp):
  33. * wtf/Platform.h:
  34. 2007-10-02 Alexey Proskuryakov <ap@webkit.org>
  35. Reviewed by Darin.
  36. http://bugs.webkit.org/show_bug.cgi?id=10370
  37. RegExp fails to match non-ASCII characters against [\S\s]
  38. Test: fast/js/regexp-negative-special-characters.html
  39. * pcre/pcre_compile.c:
  40. (compile_branch): Adjust opcode and bitmap as necessary to include (or exclude)
  41. character codes >255. Fix suggested by Philip Hazel.
  42. * pcre/pcre_exec.c:
  43. (match): Merged fix for PCRE bug 580 (\S\S vs. \S{2}).
  44. * tests/mozilla/expected.html: One test was fixed.
  45. * pcre/MERGING: Added information about this fix.
  46. 2007-10-02 Maciej Stachowiak <mjs@apple.com>
  47. Reviewed by Oliver.
  48. - skip extra hash lookup and avoid converting char* to UString for 19% speedup on CK JS array test
  49. http://bugs.webkit.org/show_bug.cgi?id=15350
  50. * kjs/array_object.cpp:
  51. (ArrayProtoFunc::callAsFunction): Implement the two mentioned optimizations.
  52. 2007-10-02 Maciej Stachowiak <mjs@apple.com>
  53. Reviewed by Mark.
  54. - Efficiently handle regexp property identifiers for 19% speedup on Celtic Kane regexp test
  55. http://bugs.webkit.org/show_bug.cgi?id=15337
  56. * kjs/CommonIdentifiers.h:
  57. * kjs/regexp_object.cpp:
  58. (RegExpProtoFunc::callAsFunction):
  59. (RegExpObjectImp::arrayOfMatches):
  60. (RegExpObjectImp::construct):
  61. 2007-10-02 Maciej Stachowiak <mjs@apple.com>
  62. Reviewed by Mark.
  63. - Cache global prorotypes more efficiently for 10% speedup on CK AJAX benchmark
  64. http://bugs.webkit.org/show_bug.cgi?id=15335
  65. * kjs/lookup.h:
  66. 2007-10-01 Oliver Hunt <oliver@apple.com>
  67. Reviewed by Mark.
  68. Enable Experimental SVG features by default when building from Xcode
  69. * Configurations/JavaScriptCore.xcconfig:
  70. 2007-09-29 Rob Buis <buis@kde.org>
  71. Reviewed by Adam.
  72. http://bugs.webkit.org/show_bug.cgi?id=13472
  73. Misparsing date in javascript leads to year value of -1
  74. http://bugs.webkit.org/show_bug.cgi?id=14176
  75. Some date values not handled consistently with IE/Firefox
  76. Allow an optional comma between month and year, and year and time.
  77. * kjs/date_object.cpp:
  78. (KJS::parseDate):
  79. 2007-07-11 Nikolas Zimmermann <zimmermann@kde.org>
  80. Reviewed by Mark.
  81. Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
  82. Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
  83. * kjs/create_hash_table:
  84. 2007-06-25 Antti Koivisto <antti@apple.com>
  85. Reviewed by Maciej.
  86. Use intHash to hash floats and doubles too.
  87. * ChangeLog:
  88. * wtf/HashFunctions.h:
  89. (WTF::FloatHash::hash):
  90. (WTF::FloatHash::equal):
  91. (WTF::):
  92. * wtf/HashTraits.h:
  93. (WTF::FloatHashTraits::emptyValue):
  94. (WTF::FloatHashTraits::deletedValue):
  95. (WTF::):
  96. === End merge of feature-branch 2007-10-12 ===
  97. 2007-10-11 Mark Rowe <mrowe@apple.com>
  98. Reviewed by Tim Hatcher.
  99. Fix for <rdar://problem/5488678>. Disable debugging symbols in production builds for 10.4
  100. PowerPC to prevent a huge STABS section from being generated.
  101. * Configurations/Base.xcconfig:
  102. 2007-10-08 George Staikos <staikos@kde.org>
  103. Reviewed by Adam Roben.
  104. Fix Qt build on Win32.
  105. * kjs/testkjs.cpp:
  106. (main):
  107. 2007-10-10 Simon Hausmann <hausmann@kde.org>
  108. Reviewed by Lars.
  109. Fix compilation using gcc 4.3. Header files have been reorganized and as a result some extra
  110. includes are needed for INT_MAX, std::auto_ptr and the like.
  111. * kjs/collector.cpp:
  112. * kjs/collector.h:
  113. * kjs/lexer.cpp:
  114. * kjs/scope_chain.cpp:
  115. * kjs/ustring.cpp:
  116. * wtf/Vector.h:
  117. 2007-10-09 Lars Knoll <lars@trolltech.com>
  118. Reviewed by Simon.
  119. fix the invokation of slots with return types. Add a JSLock around the conversion from QVariant to JSValue.
  120. * bindings/qt/qt_instance.cpp:
  121. (KJS::Bindings::QtInstance::invokeMethod):
  122. * bindings/qt/qt_runtime.cpp:
  123. (KJS::Bindings::convertValueToQVariant):
  124. (KJS::Bindings::convertQVariantToValue):
  125. 2007-10-05 Geoffrey Garen <ggaren@apple.com>
  126. Reviewed by Sam Weinig.
  127. Added JSObject::removeDirect, to support the fix for
  128. <rdar://problem/5522487> REGRESSION: With JavaScript disabled, any
  129. page load causes a crash in PropertyMap::put
  130. * kjs/object.cpp:
  131. (KJS::JSObject::removeDirect):
  132. * kjs/object.h:
  133. 2007-10-04 Mark Rowe <mrowe@apple.com>
  134. Reviewed by Oliver.
  135. Switch to default level of debugging symbols to resolve <rdar://problem/5488678>.
  136. The "full" level appears to offer no observable benefits even though the documentation
  137. suggests it be used for dead code stripping. This should also decrease link times.
  138. * Configurations/Base.xcconfig:
  139. 2007-10-03 Lars Knoll <lars@trolltech.com>
  140. Reviewed by Rob.
  141. Fix a stupid bug in Unicode::toUpper/toLower.
  142. Fixes all three test failures in the JavaScriptCore test
  143. suite.
  144. * wtf/unicode/qt4/UnicodeQt4.h:
  145. (WTF::Unicode::toLower):
  146. (WTF::Unicode::toUpper):
  147. 2007-10-02 Darin Adler <darin@apple.com>
  148. Reviewed by Adam.
  149. - add support for GDI objects to OwnPtr; I plan to use this
  150. to fix some GDI handle leaks
  151. * kjs/grammar.y: Change parser to avoid macros that conflict
  152. with macros defined in Windows system headers: THIS, DELETE,
  153. VOID, IN, and CONST. This is needed because OwnPtr.h will now
  154. include <windows.h>.
  155. * kjs/keywords.table: Ditto.
  156. * wtf/OwnPtr.h: For PLATFORM(WIN), add support so that OwnPtr can be
  157. a GDI handle, and it will call DeleteObject. Also change to use the
  158. RemovePointer technique used by RetainPtr, so you can say OwnPtr<HBITMAP>
  159. rather than having to pass in the type pointed to by HBITMAP.
  160. * wtf/OwnPtrWin.cpp: Added.
  161. (WebCore::deleteOwnedPtr): Put this in a separate file so that we
  162. don't have to include <windows.h> in OwnPtr.h.
  163. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added OwnPtrWin.cpp.
  164. 2007-09-29 Holger Hans Peter Freyther <zecke@selfish.org>
  165. Reviewed by Mark.
  166. -Fix http://bugs.webkit.org/show_bug.cgi?id=13226.
  167. Remove Bakefiles from svn.
  168. * JavaScriptCoreSources.bkl: Removed.
  169. * jscore.bkl: Removed.
  170. 2007-09-27 Kevin Decker <kdecker@apple.com>
  171. Rubber stamped by John Sullivan.
  172. <rdar://problem/5493093>
  173. * JavaScriptCore.order: Added.
  174. * JavaScriptCore.xcodeproj/project.pbxproj: We're changing from using an order file built by
  175. another team to using one we actually check into our project repository. Linker settings for
  176. Symbol Ordering Flags have been updated accordingly.
  177. 2007-09-26 Adam Roben <aroben@apple.com>
  178. Make testkjs delay-load WebKit.dll so WebKitInitializer can work its magic
  179. Rubberstamped by Anders.
  180. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  181. 2007-09-25 Adam Roben <aroben@apple.com>
  182. Make testkjs delay-load its dependencies
  183. This lets WebKitInitializer re-route the dependencies to be loaded out
  184. of the Safari installation directory.
  185. Rubberstamped by Sam.
  186. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  187. 2007-09-25 David Kilzer <ddkilzer@webkit.org>
  188. Reviewed by Adam.
  189. - Fix http://bugs.webkit.org/show_bug.cgi?id=14885
  190. LGPL'ed files contain incorrect FSF address
  191. * COPYING.LIB:
  192. * bindings/testbindings.cpp:
  193. * kjs/AllInOneFile.cpp:
  194. * kjs/DateMath.cpp:
  195. * kjs/PropertyNameArray.cpp:
  196. * kjs/PropertyNameArray.h:
  197. * kjs/config.h:
  198. 2007-09-25 Sam Weinig <sam@webkit.org>
  199. Fix location for build products for Debug_Internal.
  200. Reviewed by Adam Roben.
  201. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  202. 2007-09-25 Adam Roben <aroben@apple.com>
  203. Make testkjs use WebKitInitializer
  204. Reviewed by Sam.
  205. * JavaScriptCore.vcproj/JavaScriptCore.sln: Add WebKitInitializer and
  206. make testkjs depend on it.
  207. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Link against
  208. WebKitInitializer.lib.
  209. * kjs/testkjs.cpp:
  210. (main): Call initializeWebKit.
  211. 2007-09-24 Kevin McCullough <kmccullough@apple.com>
  212. Reviewed by Sam.
  213. - Continued to update project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
  214. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  215. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  216. 2007-09-21 Kevin McCullough <kmccullough@apple.com>
  217. Reviewed by Sam.
  218. - Updated project files to not use Edit and Continue for Debug Information since it doesn't work and breaks some functionality.
  219. * JavaScriptCore.vcproj/dftables/dftables.vcproj:
  220. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  221. 2007-09-20 Holger Hans Peter Freyther <zecke@selfish.org>
  222. Rubber stamped by Adam.
  223. Renamed files from *Gdk to *Gtk (see #14732) using the
  224. work of Juan A. Suarez Romero as a base.
  225. GDK -> GTK
  226. * JavaScriptCore.pri:
  227. * kjs/testkjs.pro:
  228. * pcre/dftables.pro:
  229. * wtf/Platform.h: PLATFORM(GDK) to PLATFORM(GTK)
  230. 2007-09-21 Mark Rowe <mrowe@apple.com>
  231. Reviewed by Antti Koivisto.
  232. http://bugs.webkit.org/show_bug.cgi?id=15250
  233. <rdar://problem/5496942> REGRESSION: Reproducible crash in Safari when evaluating script in Drosera console (15250)
  234. * kjs/function.cpp:
  235. (KJS::GlobalFuncImp::callAsFunction): Null-check thisObj before passing it to interpreterForGlobalObject.
  236. 2007-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
  237. Rubber stamped by Adam.
  238. Make the guard/#if use the same name (ENABLE_FTPDIR) as the #define. This follows
  239. the ENABLE_ICONDATABASE example from a couple of lines above.
  240. * wtf/Platform.h:
  241. 2007-09-19 Mark Rowe <mrowe@apple.com>
  242. Reviewed by Maciej.
  243. <rdar://problem/5487107> NULL dereference crash in FastMallocZone::enumerate when running leaks against Safari
  244. Storing remote pointers to their local equivalents in mapped memory was leading to the local pointer being
  245. interpreted as a remote pointer. This caused a crash when using the result of mapping this invalid remote pointer.
  246. The fix is to follow the pattern used elsewhere in FastMallocZone by always doing the mapping after reading and
  247. never storing the mapped pointer.
  248. * wtf/FastMalloc.cpp:
  249. (WTF::FastMallocZone::enumerate):
  250. 2007-09-15 Darin Adler <darin@apple.com>
  251. - fix Mac build
  252. * JavaScriptCore.exp: Export WTFLogVerbose.
  253. 2007-09-14 Kevin McCullough <kmccullough@apple.com>
  254. Reviewed by Sam.
  255. - Copy JSRetainPtr to include folder.
  256. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  257. 2007-09-13 Geoffrey Garen <ggaren@apple.com>
  258. Try to fix GDK build.
  259. * wtf/MathExtras.h:
  260. (wtf_random_init):
  261. 2007-09-12 Geoff Garen <ggaren@apple.com>
  262. Reviewed by Sam Weinig.
  263. Fixed <rdar://problem/5429064> 141885 Safari JavaScript: Math.random() slightly less randomly distributed than on Safari / Mac
  264. Math.random was skewed slightly upward because it assumed that RAND_MAX was outside the range of
  265. values that rand() might return. This problem was particularly pronounced on Windows because
  266. the range of values returned by rand() on Windows is 2^16 smaller than the range of values
  267. return by rand() on Mac.
  268. Fixed by accounting for RAND_MAX return values. Also, switched Windows over to rand_s, which has
  269. a range that's equal to rand()'s range on Mac.
  270. * kjs/config.h:
  271. * kjs/math_object.cpp:
  272. (MathFuncImp::callAsFunction): Use the new new thing.
  273. * wtf/MathExtras.h: Platform abstraction for random numbers, to cover over differences on Windows.
  274. (wtf_random_init):
  275. (wtf_random):
  276. 2007-09-13 Antti Koivisto <antti@apple.com>
  277. Reviewed by Maciej.
  278. Small addition to previous path to cover
  279. http://bugs.webkit.org/show_bug.cgi?id=11399
  280. window.eval runs in the global scope of the calling window
  281. Switch variable scope as well.
  282. * kjs/function.cpp:
  283. (KJS::GlobalFuncImp::callAsFunction):
  284. 2007-09-12 Antti Koivisto <antti@apple.com>
  285. Reviewed by Geoff, Maciej.
  286. Fix <rdar://problem/5445058>
  287. REGRESSION: Unable to upload picture to eBay auction due to domain security check
  288. eBay uses window.eval() between windows. In Firefox window.eval() switches execution
  289. and security context to the target window, something WebKit did not do. With WebKit
  290. security tightening in r24781, this broke picture uploads.
  291. Fix by making WebKit switch context in window.eval().
  292. * kjs/Context.cpp:
  293. (KJS::Context::Context):
  294. (KJS::Context::~Context):
  295. * kjs/context.h:
  296. Save and restore interpreter context independently from calling context.
  297. * kjs/function.cpp:
  298. (KJS::GlobalFuncImp::callAsFunction):
  299. If eval is called for global object different than current one, switch execution context
  300. to that object and push it to scope.
  301. 2007-09-12 Sam Weinig <sam@webkit.org>
  302. Reviewed by Geoffrey Garen.
  303. <rdar://problem/5478717> JSStringCreateWithCFString leaks when passed a zero length CFStringRef
  304. * API/JSStringRefCF.cpp:
  305. (JSStringCreateWithCFString): Special case the zero length string and remove the
  306. UTF16 optimized path since it will always leak due to the fact that we won't be
  307. able to free the backing store that the CFStringRef provides.
  308. 2007-09-10 Timothy Hatcher <timothy@apple.com>
  309. Reviewed by Darin Adler.
  310. <rdar://problem/5456224> CrashTracer: [USER] 2 crashes in Toast Titanium at com.apple.CoreServices.CarbonCore: CSMemDisposePtr + 37
  311. Removed the implementation of these malloc zone functions. We do not have the ability to
  312. check if a pointer is valid or not, so we can't correctly implement them. The system free
  313. does not fail if you pass in a bad pointer.
  314. * wtf/FastMalloc.cpp:
  315. (WTF::FastMallocZone::size):
  316. (WTF::FastMallocZone::zoneMalloc):
  317. (WTF::FastMallocZone::zoneCalloc):
  318. (WTF::FastMallocZone::zoneFree):
  319. (WTF::FastMallocZone::zoneRealloc):
  320. 2007-09-07 Darin Adler <darin@apple.com>
  321. Reviewed by Steve Falkenburg.
  322. - fix crash seen on Windows release builds
  323. * wtf/FastMalloc.cpp: Change pthread_getspecific optimization to be done only
  324. on the DARWIN platform. Also correct a couple reinterpret_cast that should be
  325. static_cast instead.
  326. 2007-09-06 Kevin McCullough <kmccullough@apple.com>
  327. Reviewed by Maciej.
  328. - Moved JSRetainPtr to the API.
  329. * API/JSRetainPtr.h: Copied from kjs/JSRetainPtr.h.
  330. (JSRetain):
  331. (JSRelease):
  332. (JSRetainPtr::JSRetainPtr):
  333. (JSRetainPtr::~JSRetainPtr):
  334. (JSRetainPtr::get):
  335. (JSRetainPtr::releaseRef):
  336. (JSRetainPtr::operator->):
  337. (JSRetainPtr::operator!):
  338. (JSRetainPtr::operator UnspecifiedBoolType):
  339. (::operator):
  340. (::adopt):
  341. (::swap):
  342. (swap):
  343. (operator==):
  344. (operator!=):
  345. * JavaScriptCore.xcodeproj/project.pbxproj:
  346. * kjs/JSRetainPtr.h: Removed.
  347. 2007-09-05 Maciej Stachowiak <mjs@apple.com>
  348. Reviewed by Darin.
  349. - Remove single-threaded optimization for FastMalloc.
  350. It does not appear to help anywhere but Mac OS X on PPC, due to
  351. pthread_getspecific being slow there. On Intel, removing the
  352. optimization results in a ~1.5% PLT speedup, a ~1-5% JS iBench
  353. speedup, and a ~1.5% HTML iBench speedup. On PPC this change is a
  354. speedup on some benchmarks, a slight hit on others.
  355. * JavaScriptCore.xcodeproj/project.pbxproj:
  356. * kjs/collector.cpp:
  357. (KJS::Collector::registerThread):
  358. * wtf/FastMalloc.cpp:
  359. (WTF::TCMalloc_ThreadCache::GetCache):
  360. (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
  361. (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  362. (WTF::do_malloc):
  363. * wtf/FastMallocInternal.h: Removed.
  364. 2007-09-05 Kevin McCullough <kmccullough@apple.com>
  365. Reviewed by Adam, Sam, Darin.
  366. - Created a JSRetainPtr specifically for JSStringRefs so they can be automatically refed and derefed.
  367. * JavaScriptCore.xcodeproj/project.pbxproj:
  368. * kjs/JSRetainPtr.h: Copied from wtf/RetainPtr.h.
  369. (KJS::JSRetain):
  370. (KJS::JSRelease):
  371. (KJS::):
  372. (KJS::JSRetainPtr::JSRetainPtr):
  373. (KJS::JSRetainPtr::~JSRetainPtr):
  374. (KJS::JSRetainPtr::get):
  375. (KJS::JSRetainPtr::releaseRef):
  376. (KJS::JSRetainPtr::operator->):
  377. (KJS::JSRetainPtr::operator UnspecifiedBoolType):
  378. (KJS::::operator):
  379. (KJS::::adopt):
  380. (KJS::::swap):
  381. (KJS::swap):
  382. (KJS::operator==):
  383. (KJS::operator!=):
  384. 2007-09-05 Mark Rowe <mrowe@apple.com>
  385. Unreviewed Qt build fix.
  386. * wtf/unicode/qt4/UnicodeQt4.h: Fix the constness of the src argument to toUpper to prevent build failures.
  387. 2007-09-04 Maciej Stachowiak <mjs@apple.com>
  388. Back out accidentally committed change.
  389. * JavaScriptCore.xcodeproj/project.pbxproj:
  390. * kjs/collector.cpp:
  391. (KJS::Collector::registerThread):
  392. * wtf/FastMalloc.cpp:
  393. (WTF::fastMallocSetIsMultiThreaded):
  394. (WTF::TCMalloc_ThreadCache::GetCache):
  395. (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
  396. (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  397. (WTF::do_malloc):
  398. * wtf/FastMallocInternal.h: Added.
  399. 2007-09-04 Maciej Stachowiak <mjs@apple.com>
  400. Reviewed by Darin.
  401. - Added Vector::appendRange(), which appends to a vector based on a given start and end iterator
  402. - Added keys() and values() functions to HashMap iterators, which give keys-only and values-only iterators
  403. Together, these allow easy copying of a set, or the keys or values of a map, into a Vector. Examples:
  404. HashMap<int, int> map;
  405. HashSet<int> set;
  406. Vector<int> vec;
  407. // ...
  408. vec.appendRange(set.begin(), set.end());
  409. vec.appendRange(map.begin().keys(), map.end().keys());
  410. vec.appendRange(map.begin().values(), map.end().values());
  411. This also allows for a slightly nicer syntax when iterating a map. Instead of saying
  412. (*it)->first, you can say *it.values(). Similarly for keys. Example:
  413. HashMap<int, int>::const_iterator end = map.end();
  414. for (HashMap<int, int>::const_iterator it = map.begin(); it != end; ++it)
  415. printf(" [%d => %d]", *it.keys(), *it.values());
  416. * JavaScriptCore.xcodeproj/project.pbxproj:
  417. * wtf/HashIterators.h: Added.
  418. (WTF::):
  419. (WTF::HashTableConstKeysIterator::HashTableConstKeysIterator):
  420. (WTF::HashTableConstKeysIterator::get):
  421. (WTF::HashTableConstKeysIterator::operator*):
  422. (WTF::HashTableConstKeysIterator::operator->):
  423. (WTF::HashTableConstKeysIterator::operator++):
  424. (WTF::HashTableConstValuesIterator::HashTableConstValuesIterator):
  425. (WTF::HashTableConstValuesIterator::get):
  426. (WTF::HashTableConstValuesIterator::operator*):
  427. (WTF::HashTableConstValuesIterator::operator->):
  428. (WTF::HashTableConstValuesIterator::operator++):
  429. (WTF::HashTableKeysIterator::HashTableKeysIterator):
  430. (WTF::HashTableKeysIterator::get):
  431. (WTF::HashTableKeysIterator::operator*):
  432. (WTF::HashTableKeysIterator::operator->):
  433. (WTF::HashTableKeysIterator::operator++):
  434. (WTF::HashTableKeysIterator::operator HashTableConstKeysIterator<HashTableType, KeyType, MappedType>):
  435. (WTF::HashTableValuesIterator::HashTableValuesIterator):
  436. (WTF::HashTableValuesIterator::get):
  437. (WTF::HashTableValuesIterator::operator*):
  438. (WTF::HashTableValuesIterator::operator->):
  439. (WTF::HashTableValuesIterator::operator++):
  440. (WTF::HashTableValuesIterator::operator HashTableConstValuesIterator<HashTableType, KeyType, MappedType>):
  441. (WTF::operator==):
  442. (WTF::operator!=):
  443. * wtf/HashTable.h:
  444. * wtf/Vector.h:
  445. (WTF::::appendRange):
  446. 2007-09-04 Maciej Stachowiak <mjs@apple.com>
  447. Reviewed by Darin.
  448. - Remove single-threaded optimization for FastMalloc.
  449. It does not appear to help anywhere but Mac OS X on PPC, due to
  450. pthread_getspecific being slow there. On Intel, removing the
  451. optimization results in a 1% PLT speedup, a 2% JS iBench speedup,
  452. and no measurable effect on HTML iBench (maybe a slight speedup).
  453. * JavaScriptCore.xcodeproj/project.pbxproj:
  454. * kjs/collector.cpp:
  455. (KJS::Collector::registerThread):
  456. * wtf/FastMalloc.cpp:
  457. (WTF::TCMalloc_ThreadCache::GetCache):
  458. (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
  459. (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  460. (WTF::do_malloc):
  461. * wtf/FastMallocInternal.h: Removed.
  462. 2007-09-03 Mark Rowe <mrowe@apple.com>
  463. Reviewed by Tim Hatcher.
  464. <rdar://problem/5452164> Production build with in symbols directory has no debug info
  465. Enable debug symbol generation on all build configurations. Production builds are stripped
  466. of symbols by Xcode during deployment post-processing.
  467. * Configurations/Base.xcconfig:
  468. * JavaScriptCore.xcodeproj/project.pbxproj:
  469. 2007-08-30 Riku Voipio <riku.voipio@iki.fi>
  470. Reviewed by Dave Kilzer.
  471. Better ARM defines.
  472. * kjs/ustring.h: Update comments to reflect the change and update test
  473. to fit changes to Platform.h.
  474. * wtf/Platform.h: Forced packing is only needed on oldabi ARM.
  475. Set middle-endian floats only for little-endian oldabi ARM.
  476. Set big-endian define for big-endian ARM.
  477. 2007-08-29 Ryan Leavengood <leavengood@gmail.com>
  478. Reviewed by Maciej.
  479. http://bugs.webkit.org/show_bug.cgi?id=15043
  480. - posix_memalign takes a void** as its first parameter. My port makes use of this function call.
  481. * kjs/collector.cpp:
  482. (KJS::allocateBlock):
  483. 2007-08-26 Darin Adler <darin@apple.com>
  484. - quick follow on to that last check-in
  485. * API/JSCallbackObject.cpp: (KJS::JSCallbackObject::JSCallbackObject):
  486. Need to initialize m_class to 0.
  487. 2007-08-26 Mark Rowe <mrowe@apple.com>
  488. Reviewed by Darin Adler.
  489. <rdar://problem/4949002> JSGlobalContextCreate can cause crashes because it passes a NULL JSContextRef to the globalObjectClass's initialize callback
  490. JSCallbackObject now tracks whether it was constructed with a null ExecState. This will happen when the object is being used as the global object,
  491. as the Interpreter needs to be created after the global object. In this situation the initialization is deferred until after the Interpreter's
  492. ExecState is available to be passed down to the initialize callbacks.
  493. * API/JSCallbackObject.cpp:
  494. (KJS::JSCallbackObject::init): Track whether we successfully initialized.
  495. (KJS::JSCallbackObject::initializeIfNeeded): Attempt to initialize with the new ExecState.
  496. * API/JSCallbackObject.h:
  497. * API/JSContextRef.cpp:
  498. (JSGlobalContextCreate): Initialize the JSCallbackObject with the Interpreter's ExecState.
  499. * API/testapi.c:
  500. (testInitializeOfGlobalObjectClassHasNonNullContext):
  501. (main): Verify that the context passed to the initialize callback is non-null.
  502. 2007-08-26 Mark Rowe <mrowe@apple.com>
  503. Reviewed by Darin Adler.
  504. <rdar://problem/5438496> JSGlobalContextCreate crashes when passed a custom class
  505. * API/JSContextRef.cpp:
  506. (JSGlobalContextCreate): Specify jsNull() as the prototype and let Interpreter's constructor fix it up to point at builtinObjectPrototype().
  507. * API/testapi.c:
  508. (main): Use an instance of a custom class as the global object to ensure the code path is exercised in the test.
  509. 2007-08-26 Mike Hommey <glandium@debian.org>
  510. Reviewed by Mark Rowe and David Kilzer.
  511. Fix build failure on arm.
  512. * wtf/Platform.h: Also test if __arm__ is defined.
  513. 2007-08-25 Peter Kasting <pkasting@google.com>
  514. Reviewed by Maciej Stachowiak.
  515. Part 3 of http://bugs.webkit.org/show_bug.cgi?id=14967
  516. Bug 14967: Reduce wtf::Vector::operator[]() overloads
  517. * wtf/Vector.h:
  518. (WTF::Vector::operator[]): Only provide versions of operator[] that takes a size_t argument.
  519. 2007-08-25 Peter Kasting <pkasting@google.com>
  520. Reviewed by Sam Weinig.
  521. Part 2 of http://bugs.webkit.org/show_bug.cgi?id=14967.
  522. Eliminate all remaining implicit conversions of wtf::Vector<T> to T*. Where code was
  523. previously checking that the Vector's data pointer was non-NULL, check !Vector::isEmpty()
  524. instead.
  525. * wtf/Vector.h:
  526. (WTF::Vector::data):
  527. 2007-08-16 Kevin McCullough <kmccullough@apple.com>
  528. Reviewed by Geoff and Adam.
  529. - Changing stack depth to 500 (from 100 on mac and win) to help out some apps specifically gmail. <rdar://problem/3590522> JavaScript call stack limit of 99 is too small for some applications; needs to be closer to 500 (4045)
  530. * kjs/object.cpp:
  531. 2007-08-15 Peter Kasting <pkasting@google.com>
  532. Reviewed by Darin.
  533. http://bugs.webkit.org/show_bug.cgi?id=14967 part 1 - Eliminate most implicit
  534. conversions of wtf::Vector<T> to T* by explicitly calling .data()
  535. * API/JSCallbackConstructor.cpp:
  536. (KJS::JSCallbackConstructor::construct):
  537. * API/JSCallbackFunction.cpp:
  538. (KJS::JSCallbackFunction::callAsFunction):
  539. * API/JSCallbackObject.cpp:
  540. (KJS::JSCallbackObject::construct):
  541. (KJS::JSCallbackObject::callAsFunction):
  542. * bindings/c/c_instance.cpp:
  543. (KJS::Bindings::CInstance::invokeMethod):
  544. (KJS::Bindings::CInstance::invokeDefaultMethod):
  545. * kjs/number_object.cpp:
  546. (integer_part_noexp):
  547. (char_sequence):
  548. * kjs/ustring.cpp:
  549. (KJS::UString::UTF8String):
  550. 2007-08-14 Darin Adler <darin@apple.com>
  551. Reviewed by Sam.
  552. - fix <rdar://problem/5410570> Global initializer introduced by use of std::numeric_limits in r24919
  553. * kjs/ustring.cpp:
  554. (KJS::overflowIndicator): Turned into a function.
  555. (KJS::maxUChars): Ditto.
  556. (KJS::allocChars): Use the functions.
  557. (KJS::reallocChars): Ditto.
  558. (KJS::UString::expandedSize): Ditto.
  559. 2007-08-12 Darin Adler <darin@apple.com>
  560. Reviewed by Maciej.
  561. - fix http://bugs.webkit.org/show_bug.cgi?id=14931
  562. <rdar://problem/5403816> JavaScript regular expression non-participating capturing parentheses
  563. fail in 3 different ways
  564. Test: fast/js/regexp-non-capturing-groups.html
  565. * kjs/string_object.cpp:
  566. (KJS::replace): Add missing code to handle undefined backreferences; before we'd get the empty string
  567. instead of a JavaScript "undefined" value.
  568. (KJS::StringProtoFunc::callAsFunction): Implemented backreference support for split.
  569. * pcre/pcre_exec.c: (match): Made backreferences to undefined groups match the empty string instead
  570. of always failing. Only in JAVASCRIPT mode.
  571. * tests/mozilla/expected.html: Add a new expected test success, since this fixed one test result.
  572. 2007-08-10 Timothy Hatcher <timothy@apple.com>
  573. Reviewed by Adam.
  574. <rdar://problem/5394449> Stop using some Carbon UI APIs for 64 bit
  575. Disable the NPAPI for 64-bit on Mac OS X.
  576. * Configurations/JavaScriptCore.xcconfig: Use the 64-bit export file.
  577. * JavaScriptCore.xcodeproj/project.pbxproj: Create a 64-bit export file
  578. that filters out the NPN fnctions.
  579. * bindings/NP_jsobject.cpp: #ifdef out this for 64-bit on Mac OS X
  580. * bindings/NP_jsobject.h: Ditto.
  581. * bindings/c/c_class.cpp: Ditto.
  582. * bindings/c/c_class.h: Ditto.
  583. * bindings/c/c_instance.cpp: Ditto.
  584. * bindings/c/c_instance.h: Ditto.
  585. * bindings/c/c_runtime.cpp: Ditto.
  586. * bindings/c/c_runtime.h: Ditto.
  587. * bindings/c/c_utility.cpp: Ditto.
  588. * bindings/c/c_utility.h: Ditto.
  589. * bindings/npapi.h: Ditto.
  590. * bindings/npruntime.cpp: Ditto.
  591. * bindings/npruntime.h: Ditto.
  592. * bindings/npruntime_impl.h: Ditto.
  593. * bindings/npruntime_priv.h: Ditto.
  594. * bindings/runtime.cpp:
  595. (KJS::Bindings::Instance::createBindingForLanguageInstance):
  596. don't creat an NPObject on Mac OS X in 64-bit.
  597. 2007-08-09 Mark Rowe <mrowe@apple.com>
  598. Reviewed by Antti.
  599. <rdar://problem/5400709> Versioning in debug and release builds should include minor and tiny version before +
  600. * Configurations/Version.xcconfig:
  601. * JavaScriptCore.xcodeproj/project.pbxproj: Add a shell script phase to make to dependency between
  602. Version.xcconfig and Info.plist explicit to Xcode.
  603. 2007-08-08 George Staikos <staikos@kde.org>
  604. Make it compile with Qt again.
  605. * wtf/unicode/qt4/UnicodeQt4.h:
  606. (WTF::Unicode::toUpper):
  607. 2007-08-07 Sam Weinig <sam@webkit.org>
  608. Reviewed by Oliver.
  609. Fix for http://bugs.webkit.org/show_bug.cgi?id=14897
  610. Decompilation of double negation fails and produces invalid or incorrect code
  611. Test: fast/js/function-decompilation-operators.html
  612. * kjs/nodes2string.cpp:
  613. (UnaryPlusNode::streamTo): Put space after unary operator. Matches Firefox.
  614. (NegateNode::streamTo): Diito.
  615. (MultNode::streamTo): Put spaces around binary operator. Matches Firefox.
  616. (AddNode::streamTo): Ditto.
  617. 2007-08-07 Darin Adler <darin@apple.com>
  618. Reviewed by Adele.
  619. - fix <rdar://problem/5383104> REGRESSION: XHR.responseText is null instead of empty string
  620. in http/tests/xmlhttprequest/zero-length-response.html
  621. The new code to handle out of memory conditions was turning a "" into a null string.
  622. * kjs/ustring.h: Removed UCharReference, which has long been obsolete and unused.
  623. Removed copyForWriting, which was only used for the upper/lowercasing code and for
  624. UCharReference.
  625. * kjs/ustring.cpp:
  626. (KJS::allocChars): Removed special case that made this fail (return 0) when passed 0.
  627. Instead assert that we're not passed 0. Also added an overflow check for two reasons:
  628. 1) for sizes that aren't checked this prevents us from allocating a buffer that's too
  629. small, and 2) for sizes where we overflowed in the expandedSize function and returned
  630. overflowIndicator, it guarantees we fail.
  631. (KJS::reallocChars): Ditto.
  632. (KJS::UString::expandedSize): Return a large number, overflowIndicator, rather than 0
  633. for cases where we overflow.
  634. (KJS::UString::spliceSubstringsWithSeparators): Added a special case for empty string so
  635. we don't call allocChars with a length of 0.
  636. (KJS::UString::operator=): Added special characters for both 0 and empty string so we
  637. match the behavior of the constructor. This avoids calling allocChars with a length of 0
  638. and making a null string rather than an empty string in that case, and also matches the
  639. pattern used in the rest of the functions.
  640. (KJS::UString::operator[]): Made the return value const so code that tries to use the
  641. operator to modify the string will fail.
  642. * kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction): Rewrote uppercasing and
  643. lowercasing functions so they don't need copyForWriting any more -- it wasn't really doing
  644. any good for optimization purposes. Instead use a Vector and releaseBuffer.
  645. * wtf/unicode/icu/UnicodeIcu.h: Eliminate one of the versions of toLower/toUpper -- we now
  646. only need the version where both a source and destination buffer is passed in, not the one
  647. that works in place.
  648. * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
  649. 2007-08-06 Sam Weinig <sam@webkit.org>
  650. Reviewed by Oliver.
  651. Fix for http://bugs.webkit.org/show_bug.cgi?id=14891
  652. Decompilation of try block immediately following "else" fails
  653. Test: fast/js/toString-try-else.html
  654. * kjs/nodes2string.cpp:
  655. (TryNode::streamTo): Add newline before "try".
  656. 2007-08-07 Mark Rowe <mrowe@apple.com>
  657. Reviewed by Maciej.
  658. <rdar://problem/5388774> REGRESSION: Hang occurs after clicking "Attach a file " link in a new .Mac message
  659. Attempting to acquire the JSLock inside CollectorHeap::forceLock can lead to a deadlock if the thread currently
  660. holding the lock is waiting on the thread that is forking. It is not considered safe to use system frameworks
  661. after a fork without first execing[*] so it is not particularly important to ensure that the collector and
  662. fastMalloc allocators are unlocked in the child process. If the child process wishes to use JavaScriptCore it
  663. should exec after forking like it would to use any other system framework.
  664. [*]: <http://lists.apple.com/archives/Cocoa-dev/2005/Jan/msg00676.html>
  665. * kjs/CollectorHeapIntrospector.cpp: Remove forceLock and forceUnlock implementations.
  666. * kjs/CollectorHeapIntrospector.h: Stub out forceLock and forceUnlock methods.
  667. * wtf/FastMalloc.cpp: Ditto.
  668. 2007-08-06 Darin Adler <darin@apple.com>
  669. Rubber stamped by Geoff.
  670. * kjs/ustring.h: Added an assertion which would have helped us find the
  671. previous bug more easily.
  672. 2007-08-06 Darin Adler <darin@apple.com>
  673. Reviewed by Anders.
  674. - fix <rdar://problem/5387589> 9A514: Quartz Composer crash on launch in KJS::jsString
  675. * API/JSBase.cpp:
  676. (JSEvaluateScript): Turn NULL for sourceURL into UString::null(), just as JSObjectMakeFunction already does.
  677. (JSCheckScriptSyntax): Ditto.
  678. 2007-08-06 Matt Lilek <pewtermoose@gmail.com>
  679. Not reviewed, build fix.
  680. * kjs/string_object.cpp:
  681. (KJS::StringProtoFunc::callAsFunction):
  682. 2007-08-04 Darin Adler <darin@apple.com>
  683. Reviewed by Maciej.
  684. - fix <rdar://problem/5371862> crash in Dashcode due to Quartz Composer JavaScript garbage collector reentrancy
  685. * API/JSBase.cpp: (JSGarbageCollect): Don't call collector() if isBusy() returns true.
  686. * kjs/collector.h: Added isBusy(), removed the unused return value from collect()
  687. * kjs/collector.cpp: Added an "operation in progress" flag to the allocator.
  688. (KJS::Collector::allocate): Call abort() if an operation is already in progress. Set the new flag instead
  689. of using the debug-only GCLock.
  690. (KJS::Collector::collect): Ditto.
  691. (KJS::Collector::isBusy): Added.
  692. 2007-08-04 Maciej Stachowiak <mjs@apple.com>
  693. Reviewed by Darin and Adam.
  694. <rdar://problem/5368990> REGRESSION: newsgator.com sign-on 6x slower than Safari 3 beta due to GC changes (14808)
  695. * kjs/string_object.cpp:
  696. (KJS::replace): if the string didn't change (very common in some cases) reuse the original string value.
  697. (KJS::StringProtoFunc::callAsFunction): Pass in the StringImp* when replacing, not just the UString.
  698. * kjs/string_object.h:
  699. (KJS::StringInstance::internalValue): covariant override to return StringImp for convenience
  700. 2007-08-04 Mark Rowe <mrowe@apple.com>
  701. Reviewed by Oliver Hunt.
  702. <rdar://problem/5385145> r24843 introduces a crash on calling fork() (14878)
  703. http://bugs.webkit.org/show_bug.cgi?id=14878
  704. Provide no-op functions for all members of the malloc_zone_t and malloc_introspection_t structures that we
  705. register to avoid crashes in system code that assumes they will be non-null.
  706. * kjs/CollectorHeapIntrospector.cpp:
  707. (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector):
  708. (KJS::CollectorHeapIntrospector::forceLock): Grab the lock.
  709. (KJS::CollectorHeapIntrospector::forceUnlock): Release the lock.
  710. * kjs/CollectorHeapIntrospector.h:
  711. (KJS::CollectorHeapIntrospector::goodSize):
  712. (KJS::CollectorHeapIntrospector::check):
  713. (KJS::CollectorHeapIntrospector::print):
  714. (KJS::CollectorHeapIntrospector::log):
  715. (KJS::CollectorHeapIntrospector::statistics):
  716. (KJS::CollectorHeapIntrospector::size):
  717. (KJS::CollectorHeapIntrospector::zoneMalloc):
  718. (KJS::CollectorHeapIntrospector::zoneCalloc):
  719. (KJS::CollectorHeapIntrospector::zoneFree):
  720. * wtf/FastMalloc.cpp:
  721. (WTF::FastMallocZone::goodSize):
  722. (WTF::FastMallocZone::check):
  723. (WTF::FastMallocZone::print):
  724. (WTF::FastMallocZone::log):
  725. (WTF::FastMallocZone::forceLock): Grab the TCMalloc locks.
  726. (WTF::FastMallocZone::forceUnlock): Release the TCMalloc locks.
  727. (WTF::FastMallocZone::FastMallocZone):
  728. 2007-08-04 Mark Rowe <mrowe@apple.com>
  729. Rubber-stamped by Anders.
  730. * pcre/pcre_compile.c: Remove non-ASCII character from a comment.
  731. 2007-08-02 Mark Rowe <mrowe@apple.com>
  732. Reviewed by Geoff Garen.
  733. <rdar://problem/4212199> 'leaks' reports false leaks in WebKit (because the WTF allocator uses mmap?)
  734. Implement malloc zone introspection routines to allow leaks, heap, and friends to request information
  735. about specific memory regions that were allocated by FastMalloc or the JavaScriptCore collector.
  736. This requires tool-side support before the regions will be displayed. The addition of that support is
  737. tracked by <rdar://problems/5353057&5353060>.
  738. * JavaScriptCore.exp: Export the two variables that are used by leaks to introspect the allocators.
  739. * JavaScriptCore.xcodeproj/project.pbxproj:
  740. * kjs/AllInOneFile.cpp:
  741. * kjs/CollectorHeapIntrospector.cpp: Added.
  742. (KJS::):
  743. (KJS::CollectorHeapIntrospector::init):
  744. (KJS::CollectorHeapIntrospector::CollectorHeapIntrospector): Create and register our zone with the system.
  745. (KJS::CollectorHeapIntrospector::enumerate): Iterate over the CollectorBlocks that are in use and report them to the caller as being used.
  746. * kjs/CollectorHeapIntrospector.h: Added.
  747. (KJS::CollectorHeapIntrospector::size): Return zero to indicate the specified pointer does not belong to this zone.
  748. * kjs/collector.cpp:
  749. (KJS::Collector::registerThread): Register the CollectorHeapIntrospector with the system when the first thread is registered with the collector.
  750. * wtf/FastMalloc.cpp:
  751. (WTF::TCMalloc_PageHeap::GetDescriptorEnsureSafe):
  752. (WTF::TCMalloc_ThreadCache_FreeList::enumerateFreeObjects): Enumerate the objects on the free list.
  753. (WTF::TCMalloc_ThreadCache::enumerateFreeObjects): Ditto.
  754. (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Ditto.
  755. (WTF::TCMalloc_ThreadCache::InitModule): Register the FastMallocZone with the system when initializing TCMalloc.
  756. (WTF::FreeObjectFinder::FreeObjectFinder):
  757. (WTF::FreeObjectFinder::visit): Add an object to the free list.
  758. (WTF::FreeObjectFinder::isFreeObject):
  759. (WTF::FreeObjectFinder::freeObjectCount):
  760. (WTF::FreeObjectFinder::findFreeObjects): Find the free objects within a thread cache or free list.
  761. (WTF::PageMapFreeObjectFinder::PageMapFreeObjectFinder): Find the free objects within a TC_PageMap.
  762. (WTF::PageMapFreeObjectFinder::visit): Called once per allocated span. Record whether the span or any subobjects are free.
  763. (WTF::PageMapMemoryUsageRecorder::PageMapMemoryUsageRecorder):
  764. (WTF::PageMapMemoryUsageRecorder::visit): Called once per allocated span. Report the range of memory as being allocated, and the span or
  765. its subobjects as being used if they do not appear on the free list.
  766. (WTF::FastMallocZone::enumerate): Map the key remote TCMalloc data structures into our address space. We then locate all free memory ranges
  767. before reporting the other ranges as being in use.
  768. (WTF::FastMallocZone::size): Determine whether the given pointer originates from within our allocation zone. If so,
  769. we return its allocation size.
  770. (WTF::FastMallocZone::zoneMalloc):
  771. (WTF::FastMallocZone::zoneCalloc):
  772. (WTF::FastMallocZone::zoneFree):
  773. (WTF::FastMallocZone::zoneRealloc):
  774. (WTF::):
  775. (WTF::FastMallocZone::FastMallocZone): Create and register our zone with the system.
  776. (WTF::FastMallocZone::init):
  777. * wtf/MallocZoneSupport.h: Added.
  778. (WTF::RemoteMemoryReader::RemoteMemoryReader): A helper class to ease the process of mapping memory in a different process into
  779. our local address space
  780. (WTF::RemoteMemoryReader::operator()):
  781. * wtf/TCPageMap.h:
  782. (TCMalloc_PageMap2::visit): Walk over the heap and visit each allocated span.
  783. (TCMalloc_PageMap3::visit): Ditto.
  784. 2007-08-02 Mark Rowe <mrowe@apple.com>
  785. Build fix.
  786. * kjs/ustring.cpp:
  787. (KJS::UString::expandedSize): Use std::numeric_limits<size_t>::max() rather than the non-portable SIZE_T_MAX.
  788. 2007-08-02 Mark Rowe <mrowe@apple.com>
  789. Reviewed by Maciej.
  790. <rdar://problem/5352887> "Out of memory" error during repeated JS string concatenation leaks hundreds of MBs of RAM
  791. A call to fastRealloc was failing which lead to UString::expandCapacity leaking the buffer it was trying to reallocate.
  792. It also resulted in the underlying UString::rep having both a null baseString and buf field, which meant that attempting
  793. to access the contents of the string after the failed memory reallocation would crash.
  794. A third issue is that expandedSize size was calculating the new length in a way that led to an integer overflow occurring.
  795. Attempting to allocate a string more than 190,000,000 characters long would fail a the integer overflow would lead to a
  796. memory allocation of around 3.6GB being attempted rather than the expected 390MB. Sizes that would lead to an overflow
  797. are now returned as zero and callers are updated to treat this as though the memory allocation has failed.
  798. * kjs/array_object.cpp:
  799. (ArrayProtoFunc::callAsFunction): Check whether the append failed and raise an "Out of memory" exception if it did.
  800. * kjs/ustring.cpp:
  801. (KJS::allocChars): Wrapper around fastMalloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
  802. (KJS::reallocChars): Wrapper around fastRealloc that takes a length in characters. It will return 0 when asked to allocate a zero-length buffer.
  803. (KJS::UString::expandedSize): Split the size calculation in two and guard against overflow during each step.
  804. (KJS::UString::expandCapacity): Don't leak r->buf if reallocation fails. Instead free the memory and use the null representation.
  805. (KJS::UString::expandPreCapacity): If fastMalloc fails then use the null representation rather than crashing in memcpy.
  806. (KJS::UString::UString): If calls to expandCapacity, expandPreCapacity or fastMalloc fail then use the null representation rather than crashing in memcpy.
  807. (KJS::UString::append): Ditto.
  808. (KJS::UString::operator=): Ditto.
  809. * kjs/ustring.h: Change return type of expandedSize from int to size_t.
  810. 2007-08-01 Darin Adler <darin@apple.com>
  811. Reviewed by Kevin McCullough.
  812. - fix <rdar://problem/5375186> pointers to pieces of class definition passed to JSClassCreate should all be const
  813. * API/JSObjectRef.h: Added const.
  814. * API/JSClassRef.cpp:
  815. (OpaqueJSClass::OpaqueJSClass): Added const.
  816. (OpaqueJSClass::create): Added const.
  817. * API/JSObjectRef.cpp:
  818. (JSClassCreate): Added const.
  819. 2007-08-01 Steve Falkenburg <sfalken@apple.com>
  820. Build mod: Fix sln to match configs in vcproj.
  821. Reviewed by Adam.
  822. * JavaScriptCore.vcproj/JavaScriptCore.make:
  823. * JavaScriptCore.vcproj/JavaScriptCore.sln:
  824. 2007-07-30 Simon Hausmann <hausmann@kde.org>
  825. Done with and reviewed by Lars.
  826. Removed the __BUILDING_QT ifdef in JSStringRef.h and changed UChar for the Qt build to use wchar_t on Windows.
  827. * API/JSStringRef.h:
  828. * wtf/unicode/qt4/UnicodeQt4.h:
  829. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  830. Done with and reviewed by Lars and Zack.
  831. Always define JSChar to be unsigned short for the Qt builds, to ensure compatibility with UChar.
  832. * API/JSStringRef.h:
  833. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  834. Done with and reviewed by Lars and Zack.
  835. Fix compilation with Qt on Windows with MingW: Implemented currentThreadStackBase() for this platform.
  836. * kjs/collector.cpp:
  837. (KJS::currentThreadStackBase):
  838. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  839. Done with and reviewed by Lars and Zack.
  840. Fix compilation with Qt on Windows with MingW: The MingW headers do not provide a prototype for a reentrant version of localtime. But since we don't use multiple threads for the Qt build we can use the plain localtime() function.
  841. * kjs/DateMath.cpp:
  842. (KJS::getDSTOffsetSimple):
  843. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  844. Done with and reviewed by Lars and Zack.
  845. Use $(MOVE) instead of mv to eliminated the shell dependency and replaced the long shell line to call bison and modify the css grammar file with a few lines of portable perl code.
  846. * JavaScriptCore.pri:
  847. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  848. Done with and reviewed by Lars and Zack.
  849. Implemented currentTime() in the interpreter by using QDateTime, so that we don't need timeGetTime() on Windows and therefore also don't need to link against Winmm.dll.
  850. * kjs/interpreter.cpp:
  851. (KJS::getCurrentTime):
  852. * kjs/testkjs.cpp:
  853. (StopWatch::start):
  854. (StopWatch::stop):
  855. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  856. Done with and reviewed by Lars and Zack.
  857. Replace the use of snprintf with QByteArray to compile under msvc 2005 express.
  858. * bindings/qt/qt_instance.cpp:
  859. (KJS::Bindings::QtInstance::stringValue):
  860. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  861. Done with and reviewed by Lars and Zack.
  862. Don't use pthread.h unless thread support is enabled.
  863. * kjs/collector.cpp:
  864. (KJS::Collector::registerAsMainThread):
  865. (KJS::onMainThread):
  866. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  867. Done with and reviewed by Lars and Zack.
  868. Removed TCSystemMalloc from the Qt build, it's not necessary it seems.
  869. * JavaScriptCore.pri:
  870. 2007-07-27 Simon Hausmann <hausmann@kde.org>
  871. Done with and reviewed by Lars and Zack.
  872. Added os-win32 to the include search path for the Qt windows build in order to provide the fake stdint.h header file.
  873. * JavaScriptCore.pri:
  874. 2007-07-25 Maciej Stachowiak <mjs@apple.com>
  875. Reviewed by Mark.
  876. - follow-up to previous change
  877. * kjs/ustring.cpp:
  878. (KJS::UString::operator=): Make sure to reset the length when
  879. replacing the buffer contents for a single-owned string.
  880. 2007-07-25 Maciej Stachowiak <mjs@apple.com>
  881. Reviewed by Darin.
  882. - JavaScriptCore part of fix for <rdar://problem/5300291> Optimize GC to reclaim big, temporary objects (like XMLHttpRequest.responseXML) quickly
  883. Also, as a side effect of optimizations included in this patch:
  884. - 7% speedup on JavaScript iBench
  885. - 4% speedup on "Celtic Kane" JS benchmark
  886. The basic idea is explained in a big comment in collector.cpp. When unusually
  887. large objecs are allocated, we push the next GC closer on the assumption that
  888. most objects are short-lived.
  889. I also did the following two optimizations in the course of tuning
  890. this not to be a performance regression:
  891. 1) Change UString::Rep to hold a self-pointer as the baseString in
  892. the unshared case, instead of a null pointer; this removes a
  893. number of null checks in hot code because many places already
  894. wanted to use the rep itself or the baseString as appropriate.
  895. 2) Avoid creating duplicate StringImpls when creating a
  896. StringInstance (the object wrapper for a JS string) or calling
  897. their methods. Since a temporary wrapper object is made every time
  898. a string method is called, this resulted in two useless extra
  899. StringImpls being allocated for no reason whenever a String method
  900. was invoked on a string value. Now we bypass those.
  901. * kjs/collector.cpp:
  902. (KJS::):
  903. (KJS::Collector::recordExtraCost): Basics of the extra cost mechanism.
  904. (KJS::Collector::allocate): ditto
  905. (KJS::Collector::collect): ditto
  906. * kjs/collector.h:
  907. (KJS::Collector::reportExtraMemoryCost): ditto
  908. * kjs/array_object.cpp:
  909. (ArrayInstance::ArrayInstance): record extra cost
  910. * kjs/internal.cpp:
  911. (KJS::StringImp::toObject): don't create a whole new StringImpl just
  912. to be the internal value of a StringInstance! StringImpls are immutable
  913. so there's no point tot his.
  914. * kjs/internal.h:
  915. (KJS::StringImp::StringImp): report extra cost
  916. * kjs/string_object.cpp:
  917. (KJS::StringInstance::StringInstance): new version that takes a StringImp
  918. (KJS::StringProtoFunc::callAsFunction): don't create a whole new StringImpl
  919. just to convert self to string! we already have one in the internal value
  920. * kjs/string_object.h: report extra cost
  921. * kjs/ustring.cpp: All changes to handle baseString being self instead of null in the
  922. unshared case.
  923. (KJS::):
  924. (KJS::UString::Rep::create):
  925. (KJS::UString::Rep::destroy):
  926. (KJS::UString::usedCapacity):
  927. (KJS::UString::usedPreCapacity):
  928. (KJS::UString::expandCapacity):
  929. (KJS::UString::expandPreCapacity):
  930. (KJS::UString::UString):
  931. (KJS::UString::append):
  932. (KJS::UString::operator=):
  933. (KJS::UString::copyForWriting):
  934. * kjs/ustring.h:
  935. (KJS::UString::Rep::baseIsSelf): new method, now that baseString is
  936. self instead of null in the unshared case we can't just null check.
  937. (KJS::UString::Rep::data): adjusted as mentioned above
  938. (KJS::UString::cost): new method to compute the cost for a UString, for
  939. use by StringImpl.
  940. * kjs/value.cpp:
  941. (KJS::jsString): style fixups.
  942. (KJS::jsOwnedString): new method, use this for strings allocated from UStrings
  943. held by the parse tree. Tracking their cost as part of string cost is pointless,
  944. because garbage collecting them will not actually free the relevant string buffer.
  945. * kjs/value.h: prototyped jsOwnedString.
  946. * kjs/nodes.cpp:
  947. (StringNode::evaluate): use jsOwnedString as appropriate
  948. (RegExpNode::evaluate): ditto
  949. (PropertyNameNode::evaluate): ditto
  950. (ForInNode::execute): ditto
  951. * JavaScriptCore.exp: Exported some new symbols.
  952. 2007-07-23 Anders Carlsson <andersca@apple.com>
  953. Reviewed by Geoff.
  954. <rdar://problem/5121461> REGRESSION: Unable to load JigZone puzzle
  955. * bindings/jni/jni_jsobject.cpp:
  956. (JavaJSObject::createNative):
  957. Call RootObject::gcProtect on the global object, thereby putting it in the
  958. "protect count" set which is used for checking if a native handle is valid.
  959. 2007-07-23 Darin Adler <darin@apple.com>
  960. * pcre/pcre_compile.c: Roll back a tiny accidental change in the unused !JAVASCRIPT
  961. side of an #ifdef. This has no effect when using PCRE in JAVASCRIPT mode as we do,
  962. but seems worth rolling back.
  963. 2007-07-23 Maciej Stachowiak <mjs@apple.com>
  964. Reviewed by Oliver.
  965. - fix remaining problems with Window shadowing
  966. * kjs/nodes.cpp:
  967. (VarDeclNode::evaluate): Tweak the special case a little.
  968. 2007-07-23 Maciej Stachowiak <mjs@apple.com>
  969. Reviewed by Oliver.
  970. - fix Window shadowing regressions caused by the previous commit.
  971. * kjs/nodes.cpp:
  972. (VarDeclNode::evaluate): Handle the case of global scope specially.
  973. 2007-07-22 Maciej Stachowiak <mjs@apple.com>
  974. Reviewed by Darin.
  975. -fixed <rdar://problem/5353293> REGRESSION (r24287): 1% i-Bench JS slowdown from JavaScript compatibility fix (14719)
  976. http://bugs.webkit.org/show_bug.cgi?id=14719
  977. My fix for this actually resulted in JS iBench being 1% faster than before the regression
  978. and the Celtic Kane benchmark being 5% faster than before the regression.
  979. * kjs/nodes.cpp:
  980. (VarDeclNode::handleSlowCase): factored out the slow code path to be out of line.
  981. (VarDeclNode::evaluate): I did a couple of things:
  982. (1) Don't check if the variable is already declared by looking for the property in
  983. the variable object, that code path was dead code.
  984. (2) Special-case the common case where the top of the scope and the variable object
  985. are the same; in that case the variable must always be in the variable object.
  986. (3) Don't return a jsString() of the variable name, nothing uses the return value
  987. from this node types evaluate method.
  988. * kjs/nodes.h:
  989. 2007-07-22 Darin Adler <darin@apple.com>
  990. Reviewed by Kevin Decker.
  991. - fix <rdar://problem/5126394> REGRESSION: Crash after clicking back button in test application (13250)
  992. http://bugs.webkit.org/show_bug.cgi?id=13250
  993. * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
  994. If the object returns 0 for _imp, convert that to "undefined", since callers
  995. can't cope with a JSValue of 0.
  996. 2007-07-19 Geoffrey Garen <ggaren@apple.com>
  997. Reviewed by Darin Adler.
  998. Fixed http://bugs.webkit.org/show_bug.cgi?id=10880 | <rdar://problem/5335694>
  999. REGRESSION: JavaScript menu doesn't appear on pricepoint.com (14595)
  1000. Though the ECMA spec says auto-semicolon insertion should not occur
  1001. without a newline or '}', Firefox treats do-while specially, and the
  1002. library used by pricepoint.com requires that special treatment.
  1003. * JavaScriptCore.xcodeproj/project.pbxproj:
  1004. * kjs/grammar.y:
  1005. 2007-07-19 Darin Adler <darin@apple.com>
  1006. Reviewed by Geoff.
  1007. - fix <rdar://problem/5345440> PCRE computes wrong length for expressions with quantifiers
  1008. on named recursion or subexpressions
  1009. It's challenging to implement proper preflighting for compiling these advanced features.
  1010. But we don't want them in the JavaScript engine anyway.
  1011. Turned off the following features of PCRE (some of these are simply parsed and not implemented):
  1012. \C \E \G \L \N \P \Q \U \X \Z
  1013. \e \l \p \u \z
  1014. [::] [..] [==]
  1015. (?#) (?<=) (?<!) (?>)
  1016. (?C) (?P) (?R)
  1017. (?0) (and 1-9)
  1018. (?imsxUX)
  1019. Added the following:
  1020. \u \v
  1021. Because of \v, the js1_2/regexp/special_characters.js test now passes.
  1022. To be conservative, I left some features that JavaScript doesn't want, such as
  1023. \012 and \x{2013}, in place. We can revisit these later; they're not directly-enough
  1024. related to avoiding the incorrect preflighting.
  1025. I also didn't try to remove unused opcodes and remove code from the execution engine.
  1026. That could save code size and speed things up a bit, but it would require more changes.
  1027. * kjs/regexp.h:
  1028. * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the sanitizePattern workaround for
  1029. lack of \u support, since the PCRE code now has \u support.
  1030. * pcre/pcre-config.h: Set JAVASCRIPT to 1.
  1031. * pcre/pcre_internal.h: Added ESC_v.
  1032. * pcre/pcre_compile.c: Added a different escape table for when JAVASCRIPT is set that
  1033. omits all the escapes we don't want interpreted and includes '\v'.
  1034. (check_escape): Put !JAVASCRIPT around the code for '\l', '\L', '\N', '\u', and '\U',
  1035. and added code to handle '\u2013' inside JAVASCRIPT.
  1036. (compile_branch): Put !JAVASCRIPT if around all the code implementing the features we
  1037. don't want.
  1038. (pcre_compile2): Ditto.
  1039. * tests/mozilla/expected.html: Updated since js1_2/regexp/special_characters.js now
  1040. passes.
  1041. 2007-07-18 Darin Adler <darin@apple.com>
  1042. Reviewed by Oliver Hunt.
  1043. - fix <rdar://problem/5345432> PCRE computes length wrong for expressions such as "[**]"
  1044. Test: fast/js/regexp-charclass-crash.html
  1045. * pcre/pcre_compile.c: (pcre_compile2): Fix the preflight code that calls
  1046. check_posix_syntax to match the actual regular expression compilation code;
  1047. before it was missing the check of the first character.
  1048. 2007-07-19 Holger Hans Peter Freyther <zecke@selfish.org>
  1049. Reviewed by Mark.
  1050. Define __BUILDING_GDK when building for Gdk to fix building testkjs on OSX.
  1051. * JavaScriptCore.pri:
  1052. 2007-07-18 Simon Hausmann <hausmann@kde.org>
  1053. * Fix the Qt build, call dftables from the right directory.
  1054. Reviewed by Adam Treat.
  1055. * pcre/pcre.pri:
  1056. 2007-07-18 Simon Hausmann <hausmann@kde.org>
  1057. Reviewed by Zack.
  1058. Don't call gcc directly when building the dftables tool but use a separate .pro file for the Qt build.
  1059. * pcre/dftables.pro: Added.
  1060. * pcre/pcre.pri:
  1061. 2007-07-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  1062. Reviewed by Darin, Maciej, and Adam.
  1063. Fixes <http://bugs.webkit.org/show_bug.cgi?id=9697>,
  1064. the failure of ecma/GlobalObject/15.1.2.2-2.js,
  1065. the failure of ecma/LexicalConventions/7.7.3-1.js,
  1066. and most of the failures of tests in ecma/TypeConversion/9.3.1-3.js.
  1067. Bug 9697: parseInt results may be inaccurate for numbers greater than 2^53
  1068. This patch also fixes similar issues in the lexer and UString::toDouble().
  1069. * kjs/function.cpp:
  1070. (KJS::parseIntOverflow):
  1071. (KJS::parseInt):
  1072. * kjs/function.h:
  1073. * kjs/lexer.cpp:
  1074. (KJS::Lexer::lex):
  1075. * kjs/ustring.cpp:
  1076. (KJS::UString::toDouble):
  1077. * tests/mozilla/expected.html:
  1078. 2007-07-16 Sam Weinig <sam@webkit.org>
  1079. Reviewed by Oliver.
  1080. Turn off -Wshorten-64-to-32 warning for 64-bit builds.
  1081. * Configurations/Base.xcconfig:
  1082. 2007-07-14 Brady Eidson <beidson@apple.com>
  1083. Reviewed by Sam Weinig
  1084. Initial check-in for <rdar://problem/3154486> - Supporting FTP directory listings in the browser
  1085. * wtf/Platform.h: Add ENABLE_FTPDIR feature to handle building on platforms that don't have the
  1086. proper network-layer support
  1087. 2007-07-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  1088. Reviewed by Darin.
  1089. Fixes http://bugs.webkit.org/show_bug.cgi?id=13517,
  1090. http://bugs.webkit.org/show_bug.cgi?id=14237, and
  1091. the failure of test js1_5/Scope/regress-185485.js
  1092. Bug 13517: DOM Exception 8 in finance.aol.com sub-page
  1093. Bug 14237: Javascript "var" statement interprets initialization in the topmost function scope
  1094. * kjs/nodes.cpp:
  1095. (VarDeclNode::evaluate):
  1096. * tests/mozilla/expected.html:
  1097. 2007-07-12 Alexey Proskuryakov <ap@webkit.org>
  1098. Reviewed by Mitz.
  1099. http://bugs.webkit.org/show_bug.cgi?id=14596
  1100. Fix JSC compilation with KJS_VERBOSE.
  1101. * kjs/function.cpp:
  1102. (KJS::FunctionImp::passInParameters):
  1103. 2007-07-11 George Staikos <staikos@kde.org>
  1104. Make it compile.
  1105. * ForwardingHeaders: Added.
  1106. * ForwardingHeaders/JavaScriptCore: Added.
  1107. * ForwardingHeaders/JavaScriptCore/APICast.h: Added.
  1108. * ForwardingHeaders/JavaScriptCore/JSBase.h: Added.
  1109. * ForwardingHeaders/JavaScriptCore/JSContextRef.h: Added.
  1110. * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
  1111. * ForwardingHeaders/JavaScriptCore/JSObjectRef.h: Added.
  1112. * ForwardingHeaders/JavaScriptCore/JSStringRef.h: Added.
  1113. * ForwardingHeaders/JavaScriptCore/JSStringRefCF.h: Added.
  1114. * ForwardingHeaders/JavaScriptCore/JSValueRef.h: Added.
  1115. * ForwardingHeaders/JavaScriptCore/JavaScriptCore.h: Added.
  1116. 2007-07-11 Holger Hans Peter Freyther <zecke@selfish.org>
  1117. Reviewed by Darin.
  1118. As of http://bugs.webkit.org/show_bug.cgi?id=14527 move the
  1119. WebCore/ForwardingHeader/JavaScriptCore to JavaScriptCore
  1120. * ForwardingHeaders: Added.
  1121. * ForwardingHeaders/JavaScriptCore: Copied from WebCore/ForwardingHeaders/JavaScriptCore.
  1122. 2007-07-11 Nikolas Zimmermann <zimmermann@kde.org>
  1123. Reviewed by Mark.
  1124. Forwardport the hash table fix from CodeGeneratorJS.pm to create_hash_table.
  1125. Reran run-jsc-tests, couldn't find any regressions. Suggested by Darin.
  1126. * kjs/create_hash_table:
  1127. 2007-07-09 Maciej Stachowiak <mjs@apple.com>
  1128. Reviewed by Oliver.
  1129. - JavaScriptCore part of fix for: <rdar://problem/5295734> Repro crash closing tab/window @ maps.google.com in WTF::HashSet<KJS::RuntimeObjectImp*, WTF::PtrHash<KJS::RuntimeObjectImp*>, WTF::HashTraits<KJS::RuntimeObjectImp*> >::add + 11
  1130. * JavaScriptCore.exp: Added needed export.
  1131. 2007-07-06 Maciej Stachowiak <mjs@apple.com>
  1132. Reviewed by Antti.
  1133. - <rdar://problem/5311093> JavaScriptCore fails to build with strict-aliasing warnings
  1134. * Configurations/Base.xcconfig: Re-enable -Wstrict-aliasing
  1135. * bindings/jni/jni_utility.cpp:
  1136. (KJS::Bindings::getJNIEnv): Type-pun via a union instead of a pointer cast.
  1137. * wtf/HashMap.h:
  1138. (WTF::): Instead of doing type-punned assignments via pointer cast, do one of three things:
  1139. (1) assign directly w/o cast if storage type matches real type; (2) assign using cast
  1140. via union if type does not need reffing; (3) copy with memcpy and ref/deref manually if type
  1141. needs reffing. This is ok peref-wise because memcpy of a constant length gets optomized.
  1142. HashTraits are now expected to make ref()/deref() take the storage type, not the true type.
  1143. * wtf/HashSet.h:
  1144. (WTF::): Same basic idea.
  1145. * wtf/HashTable.h:
  1146. (WTF::): Added Assigner template for use by HashMap/HashSet. Change RefCounter to call ref()
  1147. and deref() via storage type, avoiding the need to
  1148. type-pun.
  1149. (WTF::RefCounter::ref): ditto
  1150. (WTF::RefCounter::deref): ditto
  1151. * wtf/HashTraits.h:
  1152. (WTF::): Change ref() and deref() for RefPtr HashTraits to take the storage type; cast
  1153. via union to pointer type.
  1154. * wtf/FastMalloc.cpp:
  1155. (WTF::TCMalloc_PageHeap::init): Changed from constructor to init function so this can go in a union.
  1156. (WTF::): redefine pageheap macro in terms of getPageHeap().
  1157. (WTF::getPageHeap): new inline function, helper for pageheap macro. This hides the cast in a union.
  1158. (WTF::TCMalloc_ThreadCache::InitModule): Call init() instead of using placement new to initialize page
  1159. heap.
  1160. * wtf/TCPageMap.h:
  1161. (TCMalloc_PageMap1::init): Changed from constructor to init function.
  1162. (TCMalloc_PageMap2::init): ditto
  1163. (TCMalloc_PageMap3::init): ditto
  1164. 2007-07-06 George Staikos <staikos@kde.org>
  1165. Reviewed by Maciej.
  1166. Switch USE(ICONDATABASE) to ENABLE(ICONDATABASE)
  1167. * wtf/Platform.h:
  1168. 2007-07-03 Sam Weinig <sam@webkit.org>
  1169. Reviewed by Darin.
  1170. Eleventh round of fixes for implicit 64-32 bit conversion errors.
  1171. <rdar://problem/5292262>
  1172. - Fixes a real bug where where we were setting long long and unsigned long long
  1173. values to a long field.
  1174. * bindings/objc/objc_utility.mm:
  1175. (KJS::Bindings::convertValueToObjcValue):
  1176. 2007-07-03 Sam Weinig <sam@webkit.org>
  1177. Reviewed by Brady Eidson.
  1178. Tenth round of fixes for implicit 64-32 bit conversion errors.
  1179. <rdar://problem/5292262>
  1180. - Add explicit casts.
  1181. * kjs/dtoa.cpp:
  1182. (Bigint::):
  1183. 2007-07-02 Sam Weinig <sam@webkit.org>
  1184. Reviewed by Kevin McCullough.
  1185. Fourth round of fixes for implicit 64-32 bit conversion errors.
  1186. <rdar://problem/5292262>
  1187. Add custom piDouble and piFloat constants to use instead of M_PI.
  1188. * kjs/math_object.cpp:
  1189. (MathObjectImp::getValueProperty):
  1190. * wtf/MathExtras.h:
  1191. (wtf_atan2):
  1192. 2007-06-29 Sam Weinig <sam@webkit.org>
  1193. Reviewed by Darin.
  1194. Second pass at fixing implicit 64-32 bit conversion errors.
  1195. <rdar://problem/5292262>
  1196. - Add a toFloat() method to JSValue for float conversion.
  1197. * JavaScriptCore.exp:
  1198. * kjs/value.cpp:
  1199. (KJS::JSValue::toFloat):
  1200. * kjs/value.h:
  1201. 2007-06-27 Kevin McCullough <kmccullough@apple.com>
  1202. Reviewed by Darin.
  1203. - <rdar://problem/5271937> REGRESSION: Apparent WebKit JavaScript memory smasher when submitting comment to iWeb site (crashes in kjs_pcre_compile2)
  1204. - Correctly evaluate the return value of _pcre_ucp_findchar.
  1205. * pcre/pcre_compile.c:
  1206. (compile_branch):
  1207. * pcre/pcre_exec.c:
  1208. (match):
  1209. 2007-06-27 Sam Weinig <sam@webkit.org>
  1210. Reviewed by Darin.
  1211. First pass at fixing implicit 64-32 bit conversion errors.
  1212. <rdar://problem/5292262>
  1213. - Add 'f' suffix where necessary.
  1214. * kjs/testkjs.cpp:
  1215. (StopWatch::getElapsedMS):
  1216. 2007-06-26 Geoffrey Garen <ggaren@apple.com>
  1217. Reviewed by Maciej Stachowiak.
  1218. Fixed <rdar://problem/5296627> JSGarbageCollect headerdoc suggests that
  1219. using JavaScriptCore requires leaking memory
  1220. * API/JSBase.h: Changed documentation to explain that you can pass NULL
  1221. to JSGarbageCollect.
  1222. 2007-06-26 Adam Treat <adam@staikos.net>
  1223. Reviewed by Adam Roben.
  1224. Make the SQLite icon database optional.
  1225. * wtf/Platform.h:
  1226. 2007-06-15 George Staikos <staikos@kde.org>
  1227. More missing files for Qt.
  1228. * JavaScriptCore.pri:
  1229. * kjs/testkjs.pro:
  1230. 2007-06-15 George Staikos <staikos@kde.org>
  1231. Another Qt build fix.
  1232. * JavaScriptCore.pri:
  1233. * kjs/testkjs.pro:
  1234. 2007-06-15 George Staikos <staikos@kde.org>
  1235. Fixing Qt build.
  1236. * JavaScriptCore.pri:
  1237. 2007-06-20 Mark Rowe <mrowe@apple.com>
  1238. Reviewed by Mitz.
  1239. Fix http://bugs.webkit.org/show_bug.cgi?id=14244
  1240. Bug 14244: Data corruption when using a replace() callback function with data containing "$"
  1241. * kjs/string_object.cpp:
  1242. (KJS::replace): When 'replacement' is a function, do not replace $n placeholders in its return value.
  1243. This matches the behaviour described in ECMA 262 3rd Ed section 15.5.4.1, and as implemented in Firefox.
  1244. 2007-06-14 Anders Carlsson <andersca@apple.com>
  1245. Fix Windows build.
  1246. * bindings/runtime_object.cpp:
  1247. (RuntimeObjectImp::canPut):
  1248. 2007-06-14 Anders Carlsson <andersca@apple.com>
  1249. Reviewed by Darin.
  1250. <rdar://problem/5103077>
  1251. Crash at _NPN_ReleaseObject when quitting page at http://eshop.macsales.com/shop/ModBook
  1252. <rdar://problem/5183692>
  1253. http://bugs.webkit.org/show_bug.cgi?id=13547
  1254. REGRESSION: Crash in _NPN_ReleaseObject when closing Safari on nba.com (13547)
  1255. <rdar://problem/5261499>
  1256. CrashTracer: [USER] 75 crashes in Safari at com.apple.JavaScriptCore: KJS::Bindings::CInstance::~CInstance + 40
  1257. Have the root object track all live instances of RuntimeObjectImp. When invalidating
  1258. the root object, also invalidate all live runtime objects by zeroing out their instance ivar.
  1259. This prevents instances from outliving their plug-ins which lead to crashes.
  1260. * bindings/c/c_utility.cpp:
  1261. (KJS::Bindings::convertValueToNPVariant):
  1262. * bindings/jni/jni_jsobject.cpp:
  1263. (JavaJSObject::convertValueToJObject):
  1264. * bindings/jni/jni_utility.cpp:
  1265. (KJS::Bindings::convertValueToJValue):
  1266. * bindings/objc/objc_runtime.mm:
  1267. (ObjcFallbackObjectImp::callAsFunction):
  1268. * bindings/runtime_array.cpp:
  1269. (RuntimeArray::RuntimeArray):
  1270. * bindings/runtime_array.h:
  1271. (KJS::RuntimeArray::getConcreteArray):
  1272. * bindings/runtime_method.cpp:
  1273. (RuntimeMethod::callAsFunction):
  1274. * bindings/runtime_method.h:
  1275. * bindings/runtime_object.cpp:
  1276. (RuntimeObjectImp::RuntimeObjectImp):
  1277. (RuntimeObjectImp::~RuntimeObjectImp):
  1278. (RuntimeObjectImp::invalidate):
  1279. (RuntimeObjectImp::fallbackObjectGetter):
  1280. (RuntimeObjectImp::fieldGetter):
  1281. (RuntimeObjectImp::methodGetter):
  1282. (RuntimeObjectImp::getOwnPropertySlot):
  1283. (RuntimeObjectImp::put):
  1284. (RuntimeObjectImp::canPut):
  1285. (RuntimeObjectImp::defaultValue):
  1286. (RuntimeObjectImp::implementsCall):
  1287. (RuntimeObjectImp::callAsFunction):
  1288. (RuntimeObjectImp::getPropertyNames):
  1289. (RuntimeObjectImp::throwInvalidAccessError):
  1290. * bindings/runtime_object.h:
  1291. * bindings/runtime_root.cpp:
  1292. (KJS::Bindings::RootObject::invalidate):
  1293. (KJS::Bindings::RootObject::addRuntimeObject):
  1294. (KJS::Bindings::RootObject::removeRuntimeObject):
  1295. * bindings/runtime_root.h:
  1296. 2007-06-14 Anders Carlsson <andersca@apple.com>
  1297. Reviewed by Mitz.
  1298. <rdar://problem/5244948>
  1299. Safari keeps on complaining about slow script playing NBC TV video (14133)
  1300. http://bugs.webkit.org/show_bug.cgi?id=14133
  1301. Runaway JavaScript timer fires when spinning around in Google Maps street view
  1302. Make sure to start and stop the timeout checker around calls to JS.
  1303. * bindings/NP_jsobject.cpp:
  1304. (_NPN_InvokeDefault):
  1305. (_NPN_Invoke):
  1306. (_NPN_Evaluate):
  1307. * bindings/jni/jni_jsobject.cpp:
  1308. (JavaJSObject::call):
  1309. (JavaJSObject::eval):
  1310. 2007-06-13 Darin Adler <darin@apple.com>
  1311. Reviewed by Mark Rowe.
  1312. - fix http://bugs.webkit.org/show_bug.cgi?id=14132
  1313. array sort with > 10000 elements sets elements > 10000 undefined
  1314. Test: fast/js/sort-large-array.html
  1315. * kjs/array_instance.h: Replaced pushUndefinedObjectsToEnd with
  1316. compactForSorting, and removed ExecState parameters.
  1317. * kjs/array_object.cpp:
  1318. (ArrayInstance::sort): Changed to call compactForSorting.
  1319. (ArrayInstance::compactForSorting): Do the get and delete of the
  1320. properties directly on the property map instead of using public
  1321. calls from JSObject. The public calls would just read the undefined
  1322. values from the compacted sort results array!
  1323. 2007-06-13 George Staikos <staikos@kde.org>
  1324. Reviewed by Lars.
  1325. Fix Mac OS X build after last checkin.
  1326. * wtf/FastMalloc.h:
  1327. 2007-06-14 Lars Knoll <lars@trolltech.com>
  1328. Reviewed by Maciej.
  1329. Disable FastMalloc for the Qt build and make sure we
  1330. don't reimplement the global new/delete operators
  1331. when using the system malloc.
  1332. * wtf/FastMalloc.cpp:
  1333. * wtf/FastMalloc.h:
  1334. * wtf/Platform.h:
  1335. 2007-06-13 Anders Carlsson <andersca@apple.com>
  1336. Reviewed by Geoff.
  1337. Make sure that bindings instances get correct root objects.
  1338. * JavaScriptCore.exp:
  1339. * bindings/NP_jsobject.cpp:
  1340. (listFromVariantArgs):
  1341. (_NPN_InvokeDefault):
  1342. (_NPN_Invoke):
  1343. (_NPN_SetProperty):
  1344. * bindings/c/c_instance.cpp:
  1345. (KJS::Bindings::CInstance::invokeMethod):
  1346. (KJS::Bindings::CInstance::invokeDefaultMethod):
  1347. * bindings/c/c_runtime.cpp:
  1348. (KJS::Bindings::CField::valueFromInstance):
  1349. * bindings/c/c_utility.cpp:
  1350. (KJS::Bindings::convertNPVariantToValue):
  1351. * bindings/c/c_utility.h:
  1352. * bindings/objc/objc_instance.mm:
  1353. (ObjcInstance::invokeMethod):
  1354. (ObjcInstance::invokeDefaultMethod):
  1355. (ObjcInstance::getValueOfUndefinedField):
  1356. * bindings/objc/objc_runtime.mm:
  1357. (ObjcField::valueFromInstance):
  1358. (ObjcArray::valueAt):
  1359. * bindings/objc/objc_utility.h:
  1360. * bindings/objc/objc_utility.mm:
  1361. (KJS::Bindings::convertObjcValueToValue):
  1362. * bindings/runtime.h:
  1363. 2007-06-13 Simon Hausmann <hausmann@kde.org>
  1364. Reviewed by Lars.
  1365. * kjs/testkjs.pro: WebKitQt is now called QtWebKit.
  1366. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1367. Another build fix.
  1368. * bindings/qt/qt_instance.cpp:
  1369. (KJS::Bindings::QtInstance::invokeMethod):
  1370. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1371. Reviewed by Geoff.
  1372. Move the notion of field type to the JNI runtime since that's the only
  1373. one that was actually using it.
  1374. * bindings/c/c_runtime.h:
  1375. (KJS::Bindings::CField::CField):
  1376. * bindings/jni/jni_runtime.h:
  1377. * bindings/objc/objc_runtime.h:
  1378. * bindings/objc/objc_runtime.mm:
  1379. * bindings/qt/qt_runtime.h:
  1380. * bindings/runtime.h:
  1381. * bindings/runtime_method.cpp:
  1382. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1383. Build fix.
  1384. * bindings/qt/qt_class.cpp:
  1385. (KJS::Bindings::QtClass::methodsNamed):
  1386. * bindings/qt/qt_instance.cpp:
  1387. (KJS::Bindings::QtInstance::invokeMethod):
  1388. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1389. Reviewed by Oliver.
  1390. Get rid of the MethodList class and use a good ol' Vector instead.
  1391. * bindings/c/c_class.cpp:
  1392. (KJS::Bindings::CClass::methodsNamed):
  1393. * bindings/c/c_instance.cpp:
  1394. (KJS::Bindings::CInstance::invokeMethod):
  1395. * bindings/jni/jni_class.cpp:
  1396. (JavaClass::JavaClass):
  1397. (JavaClass::~JavaClass):
  1398. * bindings/jni/jni_instance.cpp:
  1399. (JavaInstance::invokeMethod):
  1400. * bindings/objc/objc_class.mm:
  1401. (KJS::Bindings::ObjcClass::methodsNamed):
  1402. * bindings/objc/objc_instance.mm:
  1403. (ObjcInstance::invokeMethod):
  1404. * bindings/objc/objc_runtime.mm:
  1405. (ObjcFallbackObjectImp::callAsFunction):
  1406. * bindings/runtime.cpp:
  1407. * bindings/runtime.h:
  1408. * bindings/runtime_method.cpp:
  1409. (RuntimeMethod::lengthGetter):
  1410. (RuntimeMethod::callAsFunction):
  1411. * bindings/runtime_object.cpp:
  1412. (RuntimeObjectImp::getOwnPropertySlot):
  1413. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1414. Reviewed by Geoff.
  1415. Make RuntimeMethod's method list a pointer so that the object size doesn't
  1416. grow beyond 32 bytes when we later will replace MethodList with a Vector.
  1417. * bindings/runtime_method.cpp:
  1418. (RuntimeMethod::RuntimeMethod):
  1419. (RuntimeMethod::lengthGetter):
  1420. (RuntimeMethod::callAsFunction):
  1421. * bindings/runtime_method.h:
  1422. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1423. Reviewed by Geoff.
  1424. Get rid of the Parameter class.
  1425. * bindings/jni/jni_instance.cpp:
  1426. (JavaInstance::invokeMethod):
  1427. * bindings/jni/jni_runtime.cpp:
  1428. (JavaMethod::signature):
  1429. * bindings/jni/jni_runtime.h:
  1430. (KJS::Bindings::JavaParameter::JavaParameter):
  1431. (KJS::Bindings::JavaParameter::~JavaParameter):
  1432. (KJS::Bindings::JavaParameter::type):
  1433. (KJS::Bindings::JavaMethod::parameterAt):
  1434. (KJS::Bindings::JavaMethod::numParameters):
  1435. * bindings/runtime.h:
  1436. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1437. Build fix.
  1438. * bindings/qt/qt_class.h:
  1439. 2007-06-12 Mark Rowe <mrowe@apple.com>
  1440. Build fix.
  1441. * bindings/objc/objc_runtime.h:
  1442. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1443. Reviewed by Geoff.
  1444. Get rid of Constructor and its only subclass JavaConstructor.
  1445. * bindings/c/c_class.h:
  1446. * bindings/jni/jni_class.cpp:
  1447. (JavaClass::JavaClass):
  1448. (JavaClass::~JavaClass):
  1449. * bindings/jni/jni_class.h:
  1450. * bindings/jni/jni_runtime.cpp:
  1451. * bindings/jni/jni_runtime.h:
  1452. * bindings/objc/objc_class.h:
  1453. * bindings/runtime.h:
  1454. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1455. Reviewed by Geoff.
  1456. Use RetainPtr throughout the bindings code.
  1457. * bindings/objc/objc_class.h:
  1458. * bindings/objc/objc_class.mm:
  1459. (KJS::Bindings::ObjcClass::ObjcClass):
  1460. (KJS::Bindings::ObjcClass::methodsNamed):
  1461. (KJS::Bindings::ObjcClass::fieldNamed):
  1462. * bindings/objc/objc_instance.h:
  1463. (KJS::Bindings::ObjcInstance::getObject):
  1464. * bindings/objc/objc_instance.mm:
  1465. (ObjcInstance::ObjcInstance):
  1466. (ObjcInstance::~ObjcInstance):
  1467. (ObjcInstance::implementsCall):
  1468. (ObjcInstance::invokeMethod):
  1469. (ObjcInstance::invokeDefaultMethod):
  1470. (ObjcInstance::defaultValue):
  1471. * bindings/objc/objc_runtime.h:
  1472. (KJS::Bindings::ObjcMethod::setJavaScriptName):
  1473. (KJS::Bindings::ObjcMethod::javaScriptName):
  1474. (KJS::Bindings::ObjcArray::getObjcArray):
  1475. * bindings/objc/objc_runtime.mm:
  1476. (ObjcField::name):
  1477. (ObjcArray::ObjcArray):
  1478. (ObjcArray::setValueAt):
  1479. (ObjcArray::valueAt):
  1480. (ObjcArray::getLength):
  1481. * wtf/RetainPtr.h:
  1482. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1483. Reviewed by Maciej.
  1484. Have JSCell inherit from Noncopyable.
  1485. * bindings/objc/objc_runtime.h:
  1486. * bindings/runtime_object.h:
  1487. * kjs/value.h:
  1488. 2007-06-12 Anders Carlsson <andersca@apple.com>
  1489. Reviewed by Darin and Maciej.
  1490. More cleanup. Use our Noncopyable WTF class, add a root object member
  1491. to the Array class.
  1492. * bindings/c/c_class.h:
  1493. * bindings/jni/jni_class.h:
  1494. * bindings/jni/jni_instance.h:
  1495. * bindings/jni/jni_runtime.cpp:
  1496. (JavaArray::JavaArray):
  1497. * bindings/jni/jni_runtime.h:
  1498. * bindings/objc/objc_class.h:
  1499. * bindings/objc/objc_runtime.h:
  1500. * bindings/objc/objc_runtime.mm:
  1501. (ObjcArray::ObjcArray):
  1502. * bindings/objc/objc_utility.mm:
  1503. (KJS::Bindings::convertObjcValueToValue):
  1504. * bindings/runtime.cpp:
  1505. (KJS::Bindings::Array::Array):
  1506. (KJS::Bindings::Array::~Array):
  1507. * bindings/runtime.h:
  1508. * bindings/runtime_object.h:
  1509. * bindings/runtime_root.h:
  1510. 2007-06-08 Zack Rusin <zrusin@trolltech.com>
  1511. Fix the Qt build
  1512. * bindings/qt/qt_instance.cpp:
  1513. (KJS::Bindings::QtInstance::QtInstance):
  1514. * bindings/qt/qt_instance.h:
  1515. 2007-06-07 Anders Carlsson <andersca@apple.com>
  1516. Reviewed by Geoff.
  1517. Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.
  1518. * bindings/c/c_instance.cpp:
  1519. (KJS::Bindings::CInstance::CInstance):
  1520. * bindings/c/c_instance.h:
  1521. * bindings/jni/jni_instance.cpp:
  1522. (JavaInstance::JavaInstance):
  1523. * bindings/jni/jni_instance.h:
  1524. * bindings/jni/jni_jsobject.cpp:
  1525. (JavaJSObject::convertJObjectToValue):
  1526. * bindings/objc/objc_instance.h:
  1527. * bindings/objc/objc_instance.mm:
  1528. (ObjcInstance::ObjcInstance):
  1529. * bindings/runtime.cpp:
  1530. (KJS::Bindings::Instance::Instance):
  1531. (KJS::Bindings::Instance::createBindingForLanguageInstance):
  1532. * bindings/runtime.h:
  1533. 2007-06-07 Anders Carlsson <andersca@apple.com>
  1534. Reviewed by Adam.
  1535. Don't use a JavaInstance to store the field when all we want to do is to keep the field
  1536. from being garbage collected. Instead, use a JObjectWrapper.
  1537. * bindings/jni/jni_instance.h:
  1538. * bindings/jni/jni_runtime.cpp:
  1539. (JavaField::JavaField):
  1540. (JavaField::dispatchValueFromInstance):
  1541. (JavaField::dispatchSetValueToInstance):
  1542. * bindings/jni/jni_runtime.h:
  1543. (KJS::Bindings::JavaField::JavaField):
  1544. (KJS::Bindings::JavaField::operator=):
  1545. 2007-05-30 Alp Toker <alp.toker@collabora.co.uk>
  1546. Reviewed by Brady.
  1547. Enable logging in the Gdk port.
  1548. http://bugs.webkit.org/show_bug.cgi?id=13936
  1549. * wtf/Assertions.cpp:
  1550. * wtf/Assertions.h: Add WTFLogVerbose which also logs
  1551. the file, line number and function.
  1552. 2007-05-30 Mark Rowe <mrowe@apple.com>
  1553. Mac build fix. Update #include.
  1554. * API/JSCallbackFunction.h:
  1555. 2007-05-30 Luciano Montanaro <mikelima@cirulla.net>
  1556. Reviewed by Maciej.
  1557. - cross-port Harri Porten's commits 636099 and 636108 from KJS:
  1558. "publish a class anyway public already" and "class is being used from
  1559. outside for quite some time" in preparation for further syncronizations
  1560. * kjs/context.h:
  1561. * kjs/date_object.cpp:
  1562. * kjs/date_object.h:
  1563. * kjs/function.h:
  1564. (KJS::):
  1565. (KJS::InternalFunctionImp::classInfo):
  1566. (KJS::InternalFunctionImp::functionName):
  1567. * kjs/function_object.h:
  1568. * kjs/internal.h:
  1569. * kjs/lookup.h:
  1570. (KJS::getStaticPropertySlot):
  1571. (KJS::getStaticFunctionSlot):
  1572. (KJS::getStaticValueSlot):
  1573. * kjs/object_object.h:
  1574. 2007-05-29 Sam Weinig <sam@webkit.org>
  1575. Reviewed by Adam Roben.
  1576. Cleanup function and fix to match comparison API.
  1577. * kjs/string_object.cpp:
  1578. (KJS::substituteBackreferences):
  1579. (KJS::localeCompare):
  1580. 2007-05-28 Geoffrey Garen <ggaren@apple.com>
  1581. Slight clarification to an exception message.
  1582. * API/JSCallbackObject.cpp:
  1583. (KJS::JSCallbackObject::put):
  1584. 2007-05-27 Holger Freyther <zecke@selfish.org>
  1585. Reviewed by Mark Rowe.
  1586. * wtf/Platform.h: Move Gdk up to allow building WebKit/Gdk on Darwin
  1587. 2007-05-27 Darin Adler <darin@apple.com>
  1588. - fix a couple ifdefs that said WIN instead of WIN_OS
  1589. * kjs/collector.cpp:
  1590. (KJS::allocateBlock): WIN -> WIN_OS
  1591. (KJS::freeBlock): Ditto.
  1592. 2007-05-26 Sam Weinig <sam@webkit.org>
  1593. Reviewed by Darin.
  1594. Patch for http://bugs.webkit.org/show_bug.cgi?id=13854
  1595. Port of commit 667785 from kjs
  1596. - special case calling String.localeCompare() with no parameters to return 0.
  1597. * kjs/string_object.cpp:
  1598. (KJS::StringProtoFunc::callAsFunction):
  1599. 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
  1600. Reviewed by Darin.
  1601. - Fix for http://bugs.webkit.org/show_bug.cgi?id=13456
  1602. REGRESSION: setTimeout "arguments" object gets shadowed by a local variable
  1603. - Add a explicit check for arguments. Previously check was done with getDirect,
  1604. but since the arguments is created on-demand in ActivationImp, it doesn't
  1605. show up in the test. 'arguments' should always be in the VarDeclNode's
  1606. evaluation scope.
  1607. * kjs/nodes.cpp:
  1608. (VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'
  1609. 2007-05-25 George Staikos <staikos@kde.org>
  1610. Reviewed by Maciej.
  1611. - Use COMPILER(GCC), not PLATFORM(GCC) - as Platform.h defines
  1612. * wtf/FastMalloc.h:
  1613. 2007-05-25 Kimmo Kinnunen <kimmok@iki.fi>
  1614. Reviewed by Darin.
  1615. - http://bugs.webkit.org/show_bug.cgi?id=13623 (Decompilation of function
  1616. doesn't compile with "++(x,y)")
  1617. - Create the error node based on the actual node, not the node inside
  1618. parenthesis
  1619. - Fix applies to postfix, prefix and typeof operators
  1620. - Produces run-time ReferenceError like other non-lvalue assignments etc.
  1621. * kjs/grammar.y: Create {Prefix,Postfix}ErrorNode based on the actual node,
  1622. not the based on the node returned by "nodeInsideAllParens()". Same for
  1623. TypeOfValueNode.
  1624. 2007-05-25 Simon Hausmann <hausmann@kde.org>
  1625. Reviewed by Zack.
  1626. Fix crash in Qt JavaScript bindings when the arguments used on the Qt side are not
  1627. registered with QMetaType.
  1628. * bindings/qt/qt_instance.cpp:
  1629. (KJS::Bindings::QtInstance::invokeMethod):
  1630. * bindings/qt/qt_runtime.cpp:
  1631. 2007-05-24 Luciano Montanaro <mikelima@cirulla.net>
  1632. Reviewed by Darin
  1633. Patch for http://bugs.webkit.org/show_bug.cgi?id=13855
  1634. Port patch 666176 to JavaScriptCore
  1635. - Renamed JSValue::downcast() to JSValue::asCell() which makes the
  1636. function meaning cleaner. It's modeled after Harri Porten change in
  1637. KDE trunk.
  1638. * kjs/collector.cpp:
  1639. (KJS::Collector::protect):
  1640. (KJS::Collector::unprotect):
  1641. (KJS::Collector::collectOnMainThreadOnly):
  1642. * kjs/object.h:
  1643. (KJS::JSValue::isObject):
  1644. * kjs/string_object.cpp:
  1645. (KJS::StringProtoFunc::callAsFunction):
  1646. * kjs/value.h:
  1647. (KJS::JSValue::asCell):
  1648. (KJS::JSValue::isNumber):
  1649. (KJS::JSValue::isString):
  1650. (KJS::JSValue::isObject):
  1651. (KJS::JSValue::getNumber):
  1652. (KJS::JSValue::getString):
  1653. (KJS::JSValue::getObject):
  1654. (KJS::JSValue::getUInt32):
  1655. (KJS::JSValue::mark):
  1656. (KJS::JSValue::marked):
  1657. (KJS::JSValue::type):
  1658. (KJS::JSValue::toPrimitive):
  1659. (KJS::JSValue::toBoolean):
  1660. (KJS::JSValue::toNumber):
  1661. (KJS::JSValue::toString):
  1662. (KJS::JSValue::toObject):
  1663. 2007-05-18 Holger Hans Peter Freyther <zecke@selfish.org>
  1664. Reviewed by Mark Rowe.
  1665. * kjs/testkjs.pro: Make the Gdk port link to icu
  1666. 2007-05-15 Geoffrey Garen <ggaren@apple.com>
  1667. Reviewed by Adele Peterson.
  1668. It helps if you swap the right variable.
  1669. * wtf/HashSet.h:
  1670. (WTF::::operator):
  1671. 2007-05-15 Lars Knoll <lars@trolltech.com>
  1672. Reviewed by Zack
  1673. Extend the QObject JavaScript bindings to work for slots with
  1674. arguments.
  1675. * bindings/qt/qt_instance.cpp:
  1676. (KJS::Bindings::QtInstance::invokeMethod):
  1677. 2007-05-14 Kimmo Kinnunen <kimmok@iki.fi>
  1678. Reviewed by Darin.
  1679. - Fixes http://bugs.webkit.org/show_bug.cgi?id=13622 (Decompiler
  1680. omits trailing comma in array literal)
  1681. * kjs/nodes2string.cpp:
  1682. (ArrayNode::streamTo): print extra ',' in case there was elision
  1683. commas (check opt member var) and array elements present
  1684. in the array expression
  1685. 2007-05-14 Geoffrey Garen <ggaren@apple.com>
  1686. Reviewed by Oliver Hunt.
  1687. Added HashMap::swap and HashSet::swap. WebCore now uses HashSet::swap.
  1688. I figured while I was in the neighborhood I might as well add HashMap::swap,
  1689. too.
  1690. * wtf/HashMap.h:
  1691. (WTF::::operator):
  1692. (WTF::::swap):
  1693. * wtf/HashSet.h:
  1694. (WTF::::operator):
  1695. (WTF::::swap):
  1696. 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
  1697. Reviewed by Darin.
  1698. - Fix for bug http://bugs.webkit.org/show_bug.cgi?id=13620
  1699. Bogus decompilation of "for (var j = 1 in [])"
  1700. - ForInNode toString()'ed to syntax error if there was var decl
  1701. and initializer
  1702. - ForNode toStringed()'ed lost 'var ' if it was present
  1703. * kjs/nodes2string.cpp:
  1704. (VarDeclListNode::streamTo): Print "var " here
  1705. (VarStatementNode::streamTo): Don't print "var " here
  1706. (ForNode::streamTo): Remove TODO comment, VarDeclListNode will
  1707. stream the "var "
  1708. (ForInNode::streamTo): ForIn initializer is printed by VarDeclNode
  1709. 2007-05-11 Kimmo Kinnunen <kimmok@iki.fi>
  1710. Reviewed by Darin.
  1711. - Fixes http://bugs.webkit.org/show_bug.cgi?id=10878
  1712. (Incorrect decompilation for "4..x")
  1713. - Group numbers in dotted expressions in toString() output, so we
  1714. avoid the 4.x constructs when the original input is 4..x.
  1715. 4..x means the same as 4. .x or (4).x or Number(4).x
  1716. * kjs/nodes2string.cpp:
  1717. (KJS::SourceStream::):
  1718. Add boolean flag to indicate that if next item is a number, it should be grouped.
  1719. Add new formatting enum which turns on the boolean flag.
  1720. (KJS::SourceStream::SourceStream): Added. Initialize the flag.
  1721. (SourceStream::operator<<): Added. New overloaded operator with double value as parameter.
  1722. (NumberNode::streamTo): Use the double operator
  1723. (ArrayNode::streamTo):
  1724. (DotAccessorNode::streamTo):
  1725. (FunctionCallDotNode::streamTo):
  1726. (FunctionCallParenDotNode::streamTo):
  1727. (PostfixDotNode::streamTo):
  1728. (DeleteDotNode::streamTo):
  1729. (PrefixDotNode::streamTo):
  1730. (AssignDotNode::streamTo): Use the new formatting enum to turn on the grouping flag.
  1731. 2007-05-10 Lars Knoll <lars@trolltech.com>
  1732. Reviewed by Zack
  1733. Fix our last three test failures in the JavaScript
  1734. tests.
  1735. * wtf/unicode/qt4/UnicodeQt4.h:
  1736. (WTF::Unicode::toLower):
  1737. (WTF::Unicode::toUpper):
  1738. 2007-05-08 Geoffrey Garen <ggaren@apple.com>
  1739. Reviewed by Darin Adler.
  1740. Fixed #includes of JSStringRefCF.h and use of CF datatypes. I think I
  1741. misunderstood this issue before.
  1742. * API/JavaScriptCore.h: #include JSStringRefCF.h. Platforms that don't
  1743. want this behavior can just #include individual headers, instead of the
  1744. umbrella framework header. But we definitely want Mac OS X clients to
  1745. get the #include of JSStringRefCF.h "for free."
  1746. * API/minidom.c: Don't #include JSStringRefCF.h. (Don't need to #include
  1747. JavaScriptCore.h, either.)
  1748. * API/testapi.c: Don't #include JSStringRefCF.h. Do use CF datatypes
  1749. regardless of whether __APPLE__ is defined. Platforms that don't support
  1750. CF just shouldn't compile this file.
  1751. (main):
  1752. 2007-05-09 Eric Seidel <eric@webkit.org>
  1753. Reviewed by mjs.
  1754. http://bugs.webkit.org/show_bug.cgi?id=6985
  1755. Cyclic __proto__ values cause WebKit to hang
  1756. * kjs/object.cpp:
  1757. (KJS::JSObject::put): do a cycle check before setting __proto__
  1758. 2007-05-08 Kimmo Kinnunen <kimmok@iki.fi>
  1759. Reviewed by darin. Landed by eseidel.
  1760. - http://bugs.webkit.org/show_bug.cgi?id=10880 (Do..while loop gains
  1761. a semicolon each time it is toStringed)
  1762. Grammar in Ecma-66262, 12.6: "do Statement while ( Expression );"
  1763. EmptyStatement was created after every do..while(expr) which
  1764. had semicolon at the end.
  1765. * kjs/grammar.y: Require semicolon at the end of do..while
  1766. 2007-05-08 Geoffrey Garen <ggaren@apple.com>
  1767. Build fix -- this time for sure.
  1768. APICast.h, being private, ends up in a different folder than JSValueRef.h,
  1769. so we can't include one from the other using "". Instead, just forward
  1770. declare the relevant data types.
  1771. * API/APICast.h:
  1772. 2007-05-08 Geoffrey Garen <ggaren@apple.com>
  1773. Build fix: export APICast.h for WebCore and WebKit.
  1774. * JavaScriptCore.xcodeproj/project.pbxproj:
  1775. 2007-05-04 Darin Adler <darin@apple.com>
  1776. Reviewed by Adele.
  1777. - fix http://bugs.webkit.org/show_bug.cgi?id=12821
  1778. <rdar://problem/5007921> Number.toExponential doesn't work for negative numbers
  1779. * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
  1780. Added a call to fabs before calling log10.
  1781. 2007-05-03 Holger Freyther <freyther@kde.org>
  1782. Reviewed by Zack, landed by Simon.
  1783. This is bugzilla bug 13499.
  1784. * JavaScriptCore.pri: Place Qt into the qt-port scope
  1785. * bindings/testbindings.pro: Place Qt into the qt-port scope
  1786. * kjs/testkjs.pro: Place Qt into the qt-port scope
  1787. * pcre/pcre.pri: Place Qt into the qt-port scope
  1788. 2007-05-02 David Harrison <harrison@apple.com>
  1789. Reviewed by Antti.
  1790. <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
  1791. Added insertion support for more than one value.
  1792. * wtf/Vector.h:
  1793. (WTF::::insert):
  1794. Added support for inserting multiple values.
  1795. (WTF::::prepend):
  1796. New. Insert at the start of vectors. Convenient for vectors used as strings.
  1797. 2007-05-01 Jungshik Shin <jungshik.shin@gmail.com>
  1798. Reviewed by Alexey.
  1799. - get rid of non-ASCII lteral characters : suppress compiler warnings
  1800. http://bugs.webkit.org/show_bug.cgi?id=13551
  1801. * kjs/testkjs.cpp:
  1802. * pcre/pcre_compile.c:
  1803. 2007-04-28 Jungshik Shin <jungshik.shin@gmail.com>
  1804. Reviewed by Sam Weinig.
  1805. - Replace copyright sign in Latin-1 (0xA9) with '(C)'
  1806. http://bugs.webkit.org/show_bug.cgi?id=13531
  1807. * bindings/npruntime.h:
  1808. 2007-04-28 Darin Adler <darin@apple.com>
  1809. Reviewed by Maciej.
  1810. - fix <rdar://problem/5154144> Hamachi test fails: assertion failure in ListHashSet
  1811. Test: fast/forms/add-remove-form-elements-stress-test.html
  1812. * wtf/ListHashSet.h:
  1813. (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): Initialize
  1814. m_isDoneWithInitialFreeList to false.
  1815. (WTF::ListHashSetNodeAllocator::allocate): Added assertions based on a debug-only
  1816. m_isAllocated flag that make sure we don't allocate a block that's already allocated.
  1817. These assertions helped pinpoint the bug. Set m_isDoneWithInitialFreeList when we
  1818. allocate the last block of the initial free list. Once we're done with the initial
  1819. free list, turn off the rule that says that the next node in the pool after the last
  1820. node in the free list is also free. This rule works because any free nodes are added
  1821. to the head of the free list, so a node that hasn't been allocated even once is always
  1822. at the tail of the free list and all the nodes after it also haven't been allocated
  1823. even once. But it doesn't work any longer once the entire pool has been used at least
  1824. once, because there's nothing special about the last node on the free list any more.
  1825. (WTF::ListHashSetNodeAllocator::deallocate): Set the node's m_isAllocated to false.
  1826. (WTF::ListHashSetNodeAllocator::pastPool): Added. Used above.
  1827. (WTF::ListHashSetNodeAllocator::inPool): Changed to use the pastPool function.
  1828. (WTF::ListHashSetNode::ListHashSetNode): Initialize m_isAllocated to true.
  1829. (WTF::ListHashSetNode::operator new): Removed variable name for unused size
  1830. parameter.
  1831. (WTF::ListHashSetNode::destroy): Changed to call the destructor rather than
  1832. delete -- this gets rid of the need to define an operator delete.
  1833. 2007-04-27 Christopher Brichford <chrisb@adobe.com>
  1834. Reviewed by Timothy Hatcher.
  1835. Fix for: Bug 13211: Move JavaScriptCore mac project files for apollo port
  1836. http://bugs.webkit.org/show_bug.cgi?id=13211
  1837. * JavaScriptCore.apolloproj/mac/JavaScriptCore.Debug.xcconfig: Added.
  1838. * JavaScriptCore.apolloproj/mac/JavaScriptCore.Release.xcconfig: Added.
  1839. * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcconfig: Added.
  1840. * JavaScriptCore.apolloproj/mac/JavaScriptCore.xcodeproj/project.pbxproj: Added.
  1841. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Removed.
  1842. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Removed.
  1843. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Removed.
  1844. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Removed.
  1845. 2007-04-27 Holger Freyther <freyther@kde.org>
  1846. Reviewed by Maciej.
  1847. Remove unmaintained CMake build system.
  1848. * CMakeLists.txt: Removed.
  1849. * pcre/CMakeLists.txt: Removed.
  1850. 2007-04-27 Mark Rowe <mrowe@apple.com>
  1851. Reviewed by Oliver.
  1852. * JavaScriptCore.xcodeproj/project.pbxproj: Improve dependencies in Xcode project
  1853. by marking dftables as a dependency of Generate Derived Sources rather than of
  1854. JavaScriptCore itself.
  1855. 2007-04-26 Geoffrey Garen <ggaren@apple.com>
  1856. Build fix -- added #includes that we used to get implicitly through
  1857. JSStringRef.h.
  1858. * API/JSNode.c:
  1859. * API/JSNodeList.c:
  1860. * API/minidom.c:
  1861. * API/testapi.c:
  1862. 2007-04-26 Geoffrey Garen <ggaren@apple.com>
  1863. Reviewed by Maciej Stachowiak, Adam Roben.
  1864. Fixed
  1865. <rdar://problem/4885130> Remove #include of JSStringRefCF.h from JSStringRef.h
  1866. <rdar://problem/4885123> JavaScriptCore is not cross-platform -- JSStringRef.h references CF datatypes
  1867. * API/JSStringRef.h: Removed #include -- no clients need it anymore.
  1868. 2007-04-25 David Kilzer <ddkilzer@apple.com>
  1869. Reviewed by Maciej.
  1870. Add assertions for debug builds.
  1871. * kjs/JSLock.cpp:
  1872. (KJS::JSLock::lock): Assert the return value of pthread_mutex_lock() in debug builds.
  1873. (KJS::JSLock::unlock): Assert the return value of pthread_mutex_unlock() in debug builds.
  1874. 2007-04-25 Maciej Stachowiak <mjs@apple.com>
  1875. Reviewed by Anders.
  1876. - fix build problems
  1877. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable warning that
  1878. gives often downright incorrect results based on guessing what will happen in 64-bit.
  1879. 2007-04-25 Darin Adler <darin@apple.com>
  1880. Reviewed by Geoff.
  1881. - tweak the allocator for a small speedup -- Shark showed this was a win, but I can't
  1882. measure an improvement right now, but it's also clear these changes do no harm
  1883. * wtf/FastMalloc.cpp:
  1884. (WTF::LgFloor): Use ALWAYS_INLINE here; in testing I did a while back this was necessary
  1885. to get this single-instruction function to be inlined.
  1886. (WTF::SizeClass): Use ALWAYS_INLINE here too for the same reason. Also change the special
  1887. case for a size of 0 to work without a branch for a bit of extra speed.
  1888. (WTF::ByteSizeForClass): Use ALWAYS_INLINE here too for the same reason.
  1889. 2007-04-24 Maciej Stachowiak <mjs@apple.com>
  1890. Reviewed by Oliver.
  1891. - use custom calling convention for everything in nodes.cpp on intel gcc for 1.5% speed boost
  1892. Nearly all functions in nodes.cpp were marked up to use the
  1893. regparm(3) calling convention under GCC for x86, since this is
  1894. faster and they are all guaranteed to be called only internally to
  1895. kjs.
  1896. The only exception is destructors, since delete doesn't know how to use a custom calling convention.
  1897. * kjs/nodes.cpp:
  1898. (dotExprDoesNotAllowCallsString):
  1899. * kjs/nodes.h:
  1900. (KJS::Node::):
  1901. (KJS::StatementNode::):
  1902. (KJS::NullNode::):
  1903. (KJS::BooleanNode::):
  1904. (KJS::NumberNode::):
  1905. (KJS::StringNode::):
  1906. (KJS::RegExpNode::):
  1907. (KJS::ThisNode::):
  1908. (KJS::ResolveNode::):
  1909. (KJS::GroupNode::):
  1910. (KJS::ElementNode::):
  1911. (KJS::ArrayNode::):
  1912. (KJS::PropertyNameNode::):
  1913. (KJS::PropertyNode::):
  1914. (KJS::PropertyListNode::):
  1915. (KJS::ObjectLiteralNode::):
  1916. (KJS::BracketAccessorNode::):
  1917. (KJS::DotAccessorNode::):
  1918. (KJS::ArgumentListNode::):
  1919. (KJS::ArgumentsNode::):
  1920. (KJS::NewExprNode::):
  1921. (KJS::FunctionCallValueNode::):
  1922. (KJS::FunctionCallResolveNode::):
  1923. (KJS::FunctionCallBracketNode::):
  1924. (KJS::FunctionCallParenBracketNode::):
  1925. (KJS::FunctionCallDotNode::):
  1926. (KJS::FunctionCallParenDotNode::):
  1927. (KJS::PostfixResolveNode::):
  1928. (KJS::PostfixBracketNode::):
  1929. (KJS::PostfixDotNode::):
  1930. (KJS::PostfixErrorNode::):
  1931. (KJS::DeleteResolveNode::):
  1932. (KJS::DeleteBracketNode::):
  1933. (KJS::DeleteDotNode::):
  1934. (KJS::DeleteValueNode::):
  1935. (KJS::VoidNode::):
  1936. (KJS::TypeOfResolveNode::):
  1937. (KJS::TypeOfValueNode::):
  1938. (KJS::PrefixResolveNode::):
  1939. (KJS::PrefixBracketNode::):
  1940. (KJS::PrefixDotNode::):
  1941. (KJS::PrefixErrorNode::):
  1942. (KJS::UnaryPlusNode::):
  1943. (KJS::NegateNode::):
  1944. (KJS::BitwiseNotNode::):
  1945. (KJS::LogicalNotNode::):
  1946. (KJS::MultNode::):
  1947. (KJS::AddNode::):
  1948. (KJS::ShiftNode::):
  1949. (KJS::RelationalNode::):
  1950. (KJS::EqualNode::):
  1951. (KJS::BitOperNode::):
  1952. (KJS::BinaryLogicalNode::):
  1953. (KJS::ConditionalNode::):
  1954. (KJS::AssignResolveNode::):
  1955. (KJS::AssignBracketNode::):
  1956. (KJS::AssignDotNode::):
  1957. (KJS::AssignErrorNode::):
  1958. (KJS::CommaNode::):
  1959. (KJS::AssignExprNode::):
  1960. (KJS::VarDeclListNode::):
  1961. (KJS::VarStatementNode::):
  1962. (KJS::EmptyStatementNode::):
  1963. (KJS::ExprStatementNode::):
  1964. (KJS::IfNode::):
  1965. (KJS::DoWhileNode::):
  1966. (KJS::WhileNode::):
  1967. (KJS::ForNode::):
  1968. (KJS::ContinueNode::):
  1969. (KJS::BreakNode::):
  1970. (KJS::ReturnNode::):
  1971. (KJS::WithNode::):
  1972. (KJS::LabelNode::):
  1973. (KJS::ThrowNode::):
  1974. (KJS::TryNode::):
  1975. (KJS::ParameterNode::):
  1976. (KJS::Parameter::):
  1977. (KJS::FunctionBodyNode::):
  1978. (KJS::FuncExprNode::):
  1979. (KJS::FuncDeclNode::):
  1980. (KJS::SourceElementsNode::):
  1981. (KJS::CaseClauseNode::):
  1982. (KJS::ClauseListNode::):
  1983. (KJS::SwitchNode::):
  1984. 2007-04-24 Oliver Hunt <oliver@apple.com>
  1985. GTK Build fix, ::findEntry->KJS::findEntry
  1986. * kjs/lookup.cpp:
  1987. (KJS::Lookup::findEntry):
  1988. (KJS::Lookup::find):
  1989. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  1990. Reviewed by Geoff.
  1991. - compile most of JavaScriptCore as one file for 4% JS iBench speed improvement
  1992. * JavaScriptCore.xcodeproj/project.pbxproj: Add AllInOneFile.cpp, and remove files it includes
  1993. from the build.
  1994. * kjs/AllInOneFile.cpp: Added.
  1995. * kjs/dtoa.cpp: Renamed CONST to CONST_ to avoid conflict.
  1996. (Bigint::):
  1997. (Bigint::nrv_alloc):
  1998. * kjs/lookup.cpp: Use "namspace KJS { ... }" instead of "using namespace KJS;"
  1999. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2000. Build fix, not reviewed.
  2001. * kjs/collector.h: Fix struct/class mismatch.
  2002. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2003. Reviewed by Darin.
  2004. - raise ALLOCATIONS_PER_COLLECTION to 4000, for 3.7% iBench speed improvement
  2005. Now that the cell size is smaller and the block size is bigger, we can fit 4000 objects in
  2006. the two spare cells the collector is willing to keep around, so collect a bit less often.
  2007. * kjs/collector.cpp:
  2008. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2009. Reviewed by Darin and Geoff.
  2010. - move mark and collectOnMainThreadOnly bits into separate bitmaps
  2011. This saves 4 bytes per cell, allowing shrink of cell size to 32,
  2012. which leads to a .8% speed improvement on iBench.
  2013. This is only feasible because of all the previous changes on the branch.
  2014. * kjs/collector.cpp:
  2015. (KJS::allocateBlock): Adjust for some renames of constants.
  2016. (KJS::Collector::markStackObjectsConservatively): Now that cells are 32 bytes (64
  2017. bytes on 64-bit) the cell alignment check can be made much more strict, and also
  2018. obsoletes the need for a % sizeof(CollectorCell) check. Also, we can mask off the low
  2019. bits of the pointer to have a potential block pointer to look for.
  2020. (KJS::Collector::collectOnMainThreadOnly): Use bitmap.
  2021. (KJS::Collector::markMainThreadOnlyObjects): Use bitmap.
  2022. (KJS::Collector::collect): When sweeping, use bitmaps directly to find mark bits.
  2023. * kjs/collector.h:
  2024. (KJS::): Move needed constants and type declarations here.
  2025. (KJS::CollectorBitmap::get): Bit twiddling to get a bitmap value.
  2026. (KJS::CollectorBitmap::set): Bit twiddling to set a bitmap bit to true.
  2027. (KJS::CollectorBitmap::clear): Bit twiddling to set a bitmap bit to false.
  2028. (KJS::CollectorBitmap::clearAll): Clear whole bitmap at one go.
  2029. (KJS::Collector::cellBlock): New operation, compute the block pointer for
  2030. a cell by masking off low bits.
  2031. (KJS::Collector::cellOffset): New operation, compute the cell offset for a
  2032. cell by masking off high bits and dividing (actually a shift).
  2033. (KJS::Collector::isCellMarked): Check mark bit in bitmap
  2034. (KJS::Collector::markCell): Set mark bit in bitmap.
  2035. * kjs/value.h:
  2036. (KJS::JSCell::JSCell): No more bits.
  2037. (KJS::JSCell::marked): Let collector handle it.
  2038. (KJS::JSCell::mark): Let collector handle it.
  2039. 2007-04-23 Anders Carlsson <andersca@apple.com>
  2040. Build fix.
  2041. * kjs/regexp_object.h:
  2042. RegExpObjectImpPrivate is a struct, not a class.
  2043. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2044. Reviewed by Darin.
  2045. - shrink FunctionImp / DeclaredFunctionImp by 4 bytes, by moving parameter list to function body
  2046. I reconciled this with a similar change in KDE kjs by Maks Orlovich <maksim@kde.org>.
  2047. * kjs/function.cpp:
  2048. (KJS::FunctionImp::callAsFunction):
  2049. (KJS::FunctionImp::passInParameters):
  2050. (KJS::FunctionImp::lengthGetter):
  2051. (KJS::FunctionImp::getParameterName):
  2052. * kjs/function.h:
  2053. * kjs/function_object.cpp:
  2054. (FunctionProtoFunc::callAsFunction):
  2055. (FunctionObjectImp::construct):
  2056. * kjs/nodes.cpp:
  2057. (FunctionBodyNode::addParam):
  2058. (FunctionBodyNode::paramString):
  2059. (FuncDeclNode::addParams):
  2060. (FuncDeclNode::processFuncDecl):
  2061. (FuncExprNode::addParams):
  2062. (FuncExprNode::evaluate):
  2063. * kjs/nodes.h:
  2064. (KJS::Parameter::Parameter):
  2065. (KJS::FunctionBodyNode::numParams):
  2066. (KJS::FunctionBodyNode::paramName):
  2067. (KJS::FunctionBodyNode::parameters):
  2068. (KJS::FuncExprNode::FuncExprNode):
  2069. (KJS::FuncDeclNode::FuncDeclNode):
  2070. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Disable 64-bit warnings because
  2071. they handle size_t badly.
  2072. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2073. Reviewed by Darin.
  2074. - shrink RegexpObjectImp by 4 bytes
  2075. Somewhat inexplicably, this seems to be a .33% speedup on JS iBench.
  2076. * kjs/regexp_object.cpp:
  2077. (KJS::RegExpObjectImpPrivate::RegExpObjectImpPrivate):
  2078. (RegExpObjectImp::RegExpObjectImp):
  2079. (RegExpObjectImp::performMatch):
  2080. (RegExpObjectImp::arrayOfMatches):
  2081. (RegExpObjectImp::getBackref):
  2082. (RegExpObjectImp::getLastMatch):
  2083. (RegExpObjectImp::getLastParen):
  2084. (RegExpObjectImp::getLeftContext):
  2085. (RegExpObjectImp::getRightContext):
  2086. (RegExpObjectImp::getValueProperty):
  2087. (RegExpObjectImp::putValueProperty):
  2088. * kjs/regexp_object.h:
  2089. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2090. Reviewed by Oliver.
  2091. - change to 1-bit bitfields instead of 8-bit, this turns out to lead to a .51% speedup on JS iBench
  2092. The 1-bit bitfields are actually faster than just plain bools, at least on Intel (go figure).
  2093. * kjs/property_map.h:
  2094. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2095. Reviewed by Darin.
  2096. - shrink ArrayInstance objects by 4 bytes
  2097. http://bugs.webkit.org/show_bug.cgi?id=13386
  2098. I did this by storing the capacity before the beginning of the storage array. It turns out
  2099. it is rarely needed and is by definition 0 when the storage array is null.
  2100. * kjs/array_instance.h:
  2101. (KJS::ArrayInstance::capacity): Get it from the secret stash
  2102. * kjs/array_object.cpp:
  2103. (allocateStorage): New function to encapsulate allocating the storage with extra space ahead
  2104. for the capacity.
  2105. (reallocateStorage): ditto for realloc
  2106. (ArrayInstance::ArrayInstance):
  2107. (ArrayInstance::~ArrayInstance):
  2108. (ArrayInstance::resizeStorage):
  2109. 2007-04-23 Darin Adler <darin@apple.com>
  2110. Reviewed by Maciej.
  2111. - fix <rdar://problem/4840688> REGRESSION (r10588, r10621): JavaScript won't parse
  2112. modifications of non-references (breaks 300themovie.warnerbros.com, fedex.com)
  2113. Despite the ECMAScript specification's claim that you can treat these as syntax
  2114. errors, doing so creates some website incompatibilities. So this patch turns them back
  2115. into evaluation errors instead.
  2116. Test: fast/js/modify-non-references.html
  2117. * kjs/grammar.y: Change makeAssignNode, makePrefixNode, and makePostfixNode so that they
  2118. never fail to parse. Update rules that use them. Fix a little bit of indenting. Use
  2119. new PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
  2120. * kjs/nodes.h: Added an overload of throwError that takes a char* argument.
  2121. Replaced setExceptionDetailsIfNeeded and debugExceptionIfNeeded with handleException,
  2122. which does both. Added PostfixErrorNode, PrefixErrorNode, and AssignErrorNode classes.
  2123. * kjs/nodes.cpp: Changed exception macros to use handleException; simpler and smaller
  2124. code size than the two functions that we used before.
  2125. (Node::throwError): Added the overload mentioned above.
  2126. (Node::handleException): Added. Contains the code from both setExceptionDetailsIfNeeded
  2127. and debugExceptionIfNeeded.
  2128. (PostfixErrorNode::evaluate): Added. Throws an exception.
  2129. (PrefixErrorNode::evaluate): Ditto.
  2130. (AssignErrorNode::evaluate): Ditto.
  2131. (ThrowNode::execute): Call handleException instead of debugExceptionIfNeeded; this
  2132. effectively adds a call to setExceptionDetailsIfNeeded, which may help with getting
  2133. the correct file and line number for these exceptions.
  2134. * kjs/nodes2string.cpp:
  2135. (PostfixErrorNode::streamTo): Added.
  2136. (PrefixErrorNode::streamTo): Added.
  2137. (AssignErrorNode::streamTo): Added.
  2138. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2139. Reviewed by Darin.
  2140. - fix test failures / crashes on PPC
  2141. * kjs/property_map.h: Make the bool fields explicitly 8-bit bitfields, since bool is a full
  2142. word there otherwise :-(
  2143. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2144. Reviewed by Darin.
  2145. - fix more test case failures
  2146. * bindings/runtime_array.cpp:
  2147. (RuntimeArray::RuntimeArray): inherit from JSObject instead of ArrayInstance; it turns
  2148. out that this class only needs the prototype and classInfo from ArrayInstance, not the
  2149. actual class itself, and it was too big otherwise.
  2150. (RuntimeArray::getOwnPropertySlot):
  2151. * bindings/runtime_array.h:
  2152. 2007-04-23 Maciej Stachowiak <mjs@apple.com>
  2153. Reviewed by Darin.
  2154. - fix some test failures
  2155. * bindings/runtime_method.cpp:
  2156. (RuntimeMethod::RuntimeMethod): inherit from InternalFunctionImp instead of FunctionImpl,
  2157. otherwise this is too big
  2158. (RuntimeMethod::getOwnPropertySlot):
  2159. * bindings/runtime_method.h:
  2160. 2007-04-22 Maciej Stachowiak <mjs@apple.com>
  2161. Reviewed by Darin.
  2162. - discard the arguments List for an ActivationImp when the corresponding Context is destroyed (1.7% speedup)
  2163. http://bugs.webkit.org/show_bug.cgi?id=13385
  2164. Based an idea by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>. His patch to do
  2165. this also had many other List changes and I found this much simpler subset of the changes
  2166. was actually a hair faster.
  2167. This optimization is valid because the arguments list is only kept around to
  2168. lazily make the arguments object. If it's not made by the time the function
  2169. exits, it never will be, since any function that captures the continuation will
  2170. have its own local arguments variable in scope.
  2171. Besides the 1.7% speed improvement, it shrinks List by 4 bytes
  2172. (which in turn shrinks ActivationImp by 4 bytes).
  2173. * kjs/Context.cpp:
  2174. (KJS::Context::~Context): Clear the activation's arguments list.
  2175. * kjs/function.cpp:
  2176. (KJS::ActivationImp::ActivationImp): Adjusted for list changes.
  2177. (KJS::ActivationImp::mark): No need to mark, lists are always protected (this doesn't
  2178. cause a ref-cycle for reasons stated above).
  2179. (KJS::ActivationImp::createArgumentsObject): Clear arguments list.
  2180. * kjs/function.h:
  2181. * kjs/list.cpp:
  2182. (KJS::List::List): No more needsMarking boolean
  2183. (KJS::List::operator=): ditto
  2184. * kjs/list.h:
  2185. (KJS::List::List): ditto
  2186. (KJS::List::reset): ditto
  2187. (KJS::List::deref): ditto
  2188. 2007-04-22 Maciej Stachowiak <mjs@apple.com>
  2189. Reviewed by Darin.
  2190. - shrink PropertyMap by 8 bytes and therefore shrink CELL_SIZE to 40 (for 32-bit;
  2191. similar shrinkage for 64-bit)
  2192. http://bugs.webkit.org/show_bug.cgi?id=13384
  2193. Inspired by similar changes by Christopher E. Hyde <C.Hyde@parableuk.force9.co.uk>
  2194. done in the kjs-tweaks branch of KDE's kjs. However, this version is somewhat
  2195. cleaner style-wise and avoids some of the negative speed impact (at least on gcc/x86)
  2196. of his version.
  2197. This is nearly a wash performance-wise, maybe a slight slowdown, but worth doing
  2198. to eventually reach cell size 32.
  2199. * kjs/collector.cpp:
  2200. (KJS::):
  2201. * kjs/property_map.cpp:
  2202. (KJS::PropertyMap::~PropertyMap):
  2203. (KJS::PropertyMap::clear):
  2204. (KJS::PropertyMap::get):
  2205. (KJS::PropertyMap::getLocation):
  2206. (KJS::PropertyMap::put):
  2207. (KJS::PropertyMap::insert):
  2208. (KJS::PropertyMap::expand):
  2209. (KJS::PropertyMap::rehash):
  2210. (KJS::PropertyMap::remove):
  2211. (KJS::PropertyMap::mark):
  2212. (KJS::PropertyMap::containsGettersOrSetters):
  2213. (KJS::PropertyMap::getEnumerablePropertyNames):
  2214. (KJS::PropertyMap::getSparseArrayPropertyNames):
  2215. (KJS::PropertyMap::save):
  2216. (KJS::PropertyMap::checkConsistency):
  2217. * kjs/property_map.h:
  2218. (KJS::PropertyMap::hasGetterSetterProperties):
  2219. (KJS::PropertyMap::setHasGetterSetterProperties):
  2220. (KJS::PropertyMap::):
  2221. (KJS::PropertyMap::PropertyMap):
  2222. 2007-04-22 Maciej Stachowiak <mjs@apple.com>
  2223. Reviewed by Darin.
  2224. - change blocks to 64k in size, and use various platform-specific calls to allocate at 64k-aligned addresses
  2225. http://bugs.webkit.org/show_bug.cgi?id=13383
  2226. * kjs/collector.cpp:
  2227. (KJS::allocateBlock): New function to allocate 64k of 64k-aligned memory
  2228. (KJS::freeBlock): Corresponding free
  2229. (KJS::Collector::allocate):
  2230. (KJS::Collector::collect):
  2231. 2007-04-22 Maciej Stachowiak <mjs@apple.com>
  2232. Reviewed by Darin and Geoff.
  2233. - remove the concept of oversize objects, now that there aren't any (for now
  2234. only enforced with an assert).
  2235. http://bugs.webkit.org/show_bug.cgi?id=13382
  2236. This change is a .66% speedup on JS iBench for 32-bit platforms, probably much more
  2237. for 64-bit since it finally gives a reasonable cell size, but I did not test that.
  2238. * kjs/collector.cpp:
  2239. (KJS::): Use different cell size for 32-bit and 64-bit, now that there is no
  2240. oversize allocation.
  2241. (KJS::Collector::allocate): Remove oversize allocator.
  2242. (KJS::Collector::markStackObjectsConservatively): Don't check oversize objects.
  2243. (KJS::Collector::markMainThreadOnlyObjects): Ditto.
  2244. (KJS::Collector::collect): Ditto.
  2245. 2007-04-21 Mitz Pettel <mitz@webkit.org>
  2246. Reviewed by Adam.
  2247. - fix http://bugs.webkit.org/show_bug.cgi?id=13428
  2248. REGRESSION (r20973-r20976): Failing ecma/Array/15.4.4.5-3.js
  2249. - fix http://bugs.webkit.org/show_bug.cgi?id=13429
  2250. REGRESSION (r20973-r20976): Crashing in fast/dom/plugin-attributes-enumeration.html
  2251. * kjs/array_object.cpp:
  2252. (ArrayInstance::sort): Free the old storage, not the new one.
  2253. 2007-04-20 Maciej Stachowiak <mjs@apple.com>
  2254. Not reviewed, build fix.
  2255. - fix build problem with last change - -O3 complains more about uninitialized variables
  2256. * pcre/pcre_compile.c:
  2257. (compile_branch):
  2258. (pcre_compile2):
  2259. 2007-04-20 Maciej Stachowiak <mjs@apple.com>
  2260. Reviewed by Darin.
  2261. - <rdar://problem/5149915> use mergesort when possible, since it leads to fewer compares (2% JS iBench speedup)
  2262. * kjs/array_object.cpp:
  2263. (ArrayInstance::sort): Use mergesort(3) on platforms that have it, since it tends
  2264. to do fewer compares than qsort; but avoid it very on large arrays since it uses extra
  2265. memory. Also added comments identifying possibly even better sorting algorithms
  2266. for sort by string value and sort by compare function.
  2267. * kjs/config.h:
  2268. 2007-04-20 Maciej Stachowiak <mjs@apple.com>
  2269. Reviewed by Darin.
  2270. - bump optimization flags up to -O3 for 1% JS iBench speed improvement
  2271. * Configurations/Base.xcconfig:
  2272. 2007-04-20 Mark Rowe <mrowe@apple.com>
  2273. Reviewed by Maciej.
  2274. Fix bogus optimisation in the generic pthread code path.
  2275. * kjs/collector.cpp:
  2276. (KJS::currentThreadStackBase):
  2277. 2007-04-20 Mark Rowe <mrowe@apple.com>
  2278. Reviewed by Anders.
  2279. Improve FreeBSD compatibility, as suggested by Alexander Botero-Lowry.
  2280. * kjs/collector.cpp:
  2281. (KJS::currentThreadStackBase): FreeBSD requires that pthread_attr_t's are
  2282. initialized via pthread_attr_init before being used in any context.
  2283. 2007-04-19 Mark Rowe <mrowe@apple.com>
  2284. Reviewed by Darin.
  2285. Fix http://bugs.webkit.org/show_bug.cgi?id=13401
  2286. Bug 13401: Reproducible crash calling myArray.sort(compareFn) from within
  2287. a sort comparison function
  2288. * kjs/array_object.cpp:
  2289. (ArrayInstance::sort): Save/restore the static variables around calls to qsort
  2290. to ensure nested calls to ArrayInstance::sort behave correctly.
  2291. 2007-04-12 Deneb Meketa <dmeketa@adobe.com>
  2292. Reviewed by Darin Adler.
  2293. http://bugs.webkit.org/show_bug.cgi?id=13029
  2294. rdar://problem/4994849
  2295. Bug 13029: Permit NPAPI plug-ins to see HTTP response headers.
  2296. This doesn't actually change JavaScriptCore, but that's where npapi.h is.
  2297. * bindings/npapi.h:
  2298. Add headers member to NPStream struct. Also increase NP_VERSION_MINOR to 18.
  2299. Increasing to >= 17 allows plug-ins to safely detect whether to look for
  2300. NPStream::headers. Increasing from 17 to 18 reflects presence of NPObject
  2301. enumeration, which was added in a prior patch, and which has been agreed to
  2302. constitute version 18 by the plugin-futures list. Also add other missing
  2303. bits of npapi.h to catch up from 14 to 18. This includes features that are
  2304. not implemented in WebKit, but those are safely stubbed.
  2305. 2007-04-10 Geoffrey Garen <ggaren@apple.com>
  2306. Reviewed by Mark Rowe.
  2307. Fixed last check-in to print in release builds, too.
  2308. * kjs/collector.cpp:
  2309. (KJS::getPlatformThreadRegisters):
  2310. 2007-04-10 Geoffrey Garen <ggaren@apple.com>
  2311. Reviewed by John Sullivan, Darin Adler.
  2312. Fixed <rdar://problem/5121899> JavaScript garbage collection leads to
  2313. later crash under Rosetta (should abort or leak instead?)
  2314. Log an error message and crash if the kernel reports failure during GC.
  2315. We decided to do this instead of just leaking because we don't want people
  2316. to get the mistaken impression that running in Rosetta is a supported
  2317. configurtion.
  2318. The CRASH macro will also hook into CrashReporter, which will tell us if
  2319. many (any?) users run into this issue.
  2320. * kjs/collector.cpp:
  2321. (KJS::getPlatformThreadRegisters):
  2322. 2007-04-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  2323. Reviewed by darin.
  2324. Coverity fix. Coverity says:
  2325. "Event var_deref_model: Variable "sourceRanges" tracked as NULL was passed to a
  2326. function that dereferences it"
  2327. * kjs/string_object.cpp:
  2328. (KJS::replace):
  2329. 2007-04-06 Geoffrey Garen <ggaren@apple.com>
  2330. Rubber stamped by Adele Peterson.
  2331. * kjs/ExecState.h: Removed obsolete forward/friend declaration of
  2332. RuntimeMethodImp.
  2333. 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  2334. Reviewed by darin.
  2335. Coverity fix. Coverity says:
  2336. "Event check_after_deref: Pointer "dateString" dereferenced before NULL check"
  2337. * kjs/date_object.cpp:
  2338. (KJS::parseDate):
  2339. 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  2340. Reviewed by darin.
  2341. Coverity fix. Coverity says:
  2342. "Event check_after_deref: Pointer "re" dereferenced before NULL check"
  2343. * pcre/pcre_study.c:
  2344. (pcre_study):
  2345. 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  2346. Reviewed by darin.
  2347. Coverity fixes. Coverity says:
  2348. "Event leaked_storage: Returned without freeing storage "buffer""
  2349. and:
  2350. "Event leaked_storage: Returned without freeing storage "script""
  2351. * kjs/testkjs.cpp:
  2352. (doIt):
  2353. (createStringWithContentsOfFile):
  2354. 2007-04-05 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  2355. Reviewed by darin.
  2356. Coverity fix: in single-threaded case currentThreadIsMainThread is always true
  2357. so the code in if (!currentThreadIsMainThread) cannot possibly be reached
  2358. and Coverity complains about dead code.
  2359. * kjs/collector.cpp:
  2360. (KJS::Collector::collect):
  2361. === Safari-5522.6 ===
  2362. 2007-04-03 Kevin McCullough <kmccullough@apple.com>
  2363. Reviewed by Adam.
  2364. - Testing a post-commit hook.
  2365. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  2366. 2007-04-03 Anders Carlsson <andersca@apple.com>
  2367. Reviewed by Adam.
  2368. <rdar://problem/5107534>
  2369. http://bugs.webkit.org/show_bug.cgi?id=13265
  2370. REGRESSION: Crash in KJS::Bindings::convertValueToNPVariant
  2371. * bindings/NP_jsobject.cpp:
  2372. (_NPN_InvokeDefault):
  2373. Return false if the object isn't a function. Set the return value to undefined by default
  2374. (to match Firefox).
  2375. 2007-03-30 Anders Carlsson <andersca@apple.com>
  2376. Build fix.
  2377. * bindings/NP_jsobject.cpp:
  2378. (_NPN_Enumerate):
  2379. 2007-03-30 Anders Carlsson <andersca@apple.com>
  2380. Reviewed by Geoff.
  2381. Implement _NPN_Enumerate support.
  2382. * JavaScriptCore.exp:
  2383. * bindings/NP_jsobject.cpp:
  2384. (_NPN_Enumerate):
  2385. * bindings/c/c_instance.cpp:
  2386. (KJS::Bindings::CInstance::getPropertyNames):
  2387. * bindings/c/c_instance.h:
  2388. * bindings/npapi.h:
  2389. * bindings/npruntime.h:
  2390. * bindings/npruntime_impl.h:
  2391. * bindings/runtime.h:
  2392. (KJS::Bindings::Instance::getPropertyNames):
  2393. * bindings/runtime_object.cpp:
  2394. (RuntimeObjectImp::getPropertyNames):
  2395. * bindings/runtime_object.h:
  2396. (KJS::RuntimeObjectImp::getInternalInstance):
  2397. 2007-03-28 Jeff Walden <jwalden+code@mit.edu>
  2398. Reviewed by Darin.
  2399. http://bugs.webkit.org/show_bug.cgi?id=12963
  2400. Fix some inconsistencies in the Mozilla JS Array extras implementations
  2401. with respect to the Mozilla implementation:
  2402. - holes in arrays should be skipped, not treated as undefined,
  2403. by all such methods
  2404. - an element with value undefined is not a hole
  2405. - Array.prototype.forEach should return undefined
  2406. * kjs/array_object.cpp:
  2407. (ArrayInstance::getOwnPropertySlot):
  2408. (ArrayProtoFunc::callAsFunction):
  2409. 2007-03-27 Anders Carlsson <acarlsson@apple.com>
  2410. Reviewed by Geoff.
  2411. * bindings/NP_jsobject.cpp:
  2412. (_NPN_InvokeDefault):
  2413. Call JSObject:call for native JavaScript objects.
  2414. 2007-03-26 David Carson <dacarson@gmail.com>
  2415. Reviewed by Darin, landed by Anders.
  2416. Fix for: REGRESSION (r19559): Java applet crash
  2417. http://bugs.webkit.org/show_bug.cgi?id=13142
  2418. <rdar://problem/5080340>
  2419. The previous fix http://bugs.webkit.org/show_bug.cgi?id=12636
  2420. introduced new JNIType to enum in jni_utility.h This is a
  2421. problem on the Mac as it seems that the JNIType enum is also
  2422. used in the JVM, it is used to specify the return type in
  2423. jni_objc.mm
  2424. Corrected the fix by moving type to the end, and changing
  2425. jni_objc.mm to convert the new type to an old compatible
  2426. type.
  2427. * bindings/jni/jni_objc.mm:
  2428. (KJS::Bindings::dispatchJNICall):
  2429. * bindings/jni/jni_utility.h:
  2430. 2007-03-26 Christopher Brichford <chrisb@adobe.com>
  2431. Reviewed/landed by Adam.
  2432. Bug 13198: Move build settings from project file to xcconfig file for apollo
  2433. port JSCore
  2434. http://bugs.webkit.org/show_bug.cgi?id=13198
  2435. - Moving build settings from xcode project file to xcconfig files.
  2436. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig:
  2437. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig:
  2438. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
  2439. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
  2440. 2007-03-26 Brady Eidson <beidson@apple.com>
  2441. Rubberstamped by Anders and Maciej aand Geoff (oh my!)
  2442. Since CFTypeRef is really void*, a RetainPtr couldn't be used.
  2443. RefType was "void", which doesn't actually exist as a type.
  2444. Since RefType only existed for operator*(), and since that operator
  2445. doesn't make any sense for RetainPtr, I removed them!
  2446. * kjs/nodes.cpp: Touch this to force a rebuild and (hopefully) help the
  2447. compiler with dependencies
  2448. * wtf/RetainPtr.h: Nuke RefType and operator*()
  2449. 2007-03-26 Geoffrey Garen <ggaren@apple.com>
  2450. Touched a file to (hopefully) help the compiler with RetainPtr dependencies.
  2451. * kjs/nodes.cpp:
  2452. (Node::deref):
  2453. 2007-03-24 Brady Eidson <beidson@apple.com>
  2454. Reviewed by Adam
  2455. Whoops, RetainPtr should be in the WTF namespace
  2456. * wtf/RetainPtr.h:
  2457. 2007-03-24 Brady Eidson <beidson@apple.com>
  2458. Reviewed by Adam
  2459. <rdar://problem/5086210> - Move RetainPtr to WTF
  2460. * wtf/RetainPtr.h: Added
  2461. * JavaScriptCore.xcodeproj/project.pbxproj: Add it to the project file
  2462. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto
  2463. 2007-03-23 Christopher Brichford <chrisb@adobe.com>
  2464. Reviewed/landed by Adam.
  2465. Bug 13175: Make apollo mac project files for JavaScriptCore actually
  2466. build something
  2467. http://bugs.webkit.org/show_bug.cgi?id=13175
  2468. - Changing apollo mac project files for JavaScriptCore such that they actually build
  2469. JavaScriptCore source code.
  2470. * JavaScriptCore.apolloproj/ForwardingSources/grammar.cpp: Added.
  2471. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig:
  2472. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
  2473. 2007-03-24 Mark Rowe <mrowe@apple.com>
  2474. Rubber-stamped by Darin.
  2475. * Configurations/JavaScriptCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
  2476. 2007-03-22 Christopher Brichford <chrisb@adobe.com>
  2477. Reviewed/landed by Adam.
  2478. Bug 13164: Initial version of mac JavaScriptCore project files for
  2479. apollo port
  2480. http://bugs.webkit.org/show_bug.cgi?id=13164
  2481. - Adding mac project files for apollo port of JavaScriptCore. Currently project
  2482. just builds dftables.
  2483. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Debug.xcconfig: Added.
  2484. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.Release.xcconfig: Added.
  2485. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcconfig: Added.
  2486. * JavaScriptCore.apolloproj/mac/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: Added.
  2487. 2007-03-21 Timothy Hatcher <timothy@apple.com>
  2488. Reviewed by Darin.
  2489. <rdar://problem/5076599> JavaScriptCore has a weak export (vtable for KJS::JSCell)
  2490. * JavaScriptCore.exp: Remove __ZTVN3KJS6JSCellE.
  2491. 2007-03-21 Adele Peterson <adele@apple.com>
  2492. Reviewed by Geoff.
  2493. * API/JSStringRef.cpp: (JSStringIsEqual): Added JSLock.
  2494. 2007-03-21 Zack Rusin <zrusin@trolltech.com>
  2495. Fix the compile when USE(MULTIPLE_THREADS) isn't
  2496. defined
  2497. * kjs/JSLock.cpp:
  2498. (KJS::JSLock::currentThreadIsHoldingLock):
  2499. 2007-03-20 Maciej Stachowiak <mjs@apple.com>
  2500. Reviewed by Geoff and Adam.
  2501. - make USE(MULTIPLE_THREADS) support more portable
  2502. http://bugs.webkit.org/show_bug.cgi?id=13069
  2503. - fixed a threadsafety bug discovered by testing this
  2504. - enhanced threadsafety assertions in collector
  2505. * API/JSCallbackObject.cpp:
  2506. (KJS::JSCallbackObject::~JSCallbackObject): This destructor can't
  2507. DropAllLocks around the finalize callback, because it gets called
  2508. from garbage collection and we can't let other threads collect!
  2509. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  2510. * kjs/JSLock.cpp:
  2511. (KJS::JSLock::currentThreadIsHoldingLock): Added new function
  2512. to allow stronger assertions than just that the lock is held
  2513. by some thread (you can now assert that the current thread is
  2514. holding it, given the new JSLock design).
  2515. * kjs/JSLock.h:
  2516. * kjs/collector.cpp: Refactored for portability plus added some
  2517. stronger assertions.
  2518. (KJS::Collector::allocate):
  2519. (KJS::currentThreadStackBase):
  2520. (KJS::Collector::registerAsMainThread):
  2521. (KJS::onMainThread):
  2522. (KJS::PlatformThread::PlatformThread):
  2523. (KJS::getCurrentPlatformThread):
  2524. (KJS::Collector::Thread::Thread):
  2525. (KJS::destroyRegisteredThread):
  2526. (KJS::Collector::registerThread):
  2527. (KJS::Collector::markCurrentThreadConservatively):
  2528. (KJS::suspendThread):
  2529. (KJS::resumeThread):
  2530. (KJS::getPlatformThreadRegisters):
  2531. (KJS::otherThreadStackPointer):
  2532. (KJS::otherThreadStackBase):
  2533. (KJS::Collector::markOtherThreadConservatively):
  2534. (KJS::Collector::markStackObjectsConservatively):
  2535. (KJS::Collector::protect):
  2536. (KJS::Collector::unprotect):
  2537. (KJS::Collector::collectOnMainThreadOnly):
  2538. (KJS::Collector::markMainThreadOnlyObjects):
  2539. (KJS::Collector::collect):
  2540. * kjs/collector.h:
  2541. * wtf/FastMalloc.cpp:
  2542. (WTF::fastMallocSetIsMultiThreaded):
  2543. * wtf/FastMallocInternal.h:
  2544. * wtf/Platform.h:
  2545. 2007-03-19 Darin Adler <darin@apple.com>
  2546. * kjs/value.h: Roll ~JSValue change out. It was causing problems. I'll do it right later.
  2547. 2007-03-19 Geoffrey Garen <ggaren@apple.com>
  2548. Reviewed by John Sullivan.
  2549. Fixed <rdar://problem/5073380> REGRESSION: Crash occurs at WTF::fastFree()
  2550. when reloading liveconnect page (applet)
  2551. Best to use free when you use malloc, especially when malloc and delete
  2552. use completely different libraries.
  2553. * bindings/jni/jni_runtime.cpp:
  2554. (JavaMethod::~JavaMethod):
  2555. 2007-03-19 Andrew Wellington <proton@wiretapped.net>
  2556. Reviewed by Maciej.
  2557. Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
  2558. * JavaScriptCore.xcodeproj/project.pbxproj:
  2559. 2007-03-19 Darin Adler <darin@apple.com>
  2560. Reviewed by Geoff.
  2561. - Changed list size threshold to 5 based on testing.
  2562. I was testing the i-Bench JavaScript with the list statistics
  2563. dumping on, and discovered that there were many 5-element lists.
  2564. The fast case for lists was for 4 elements and fewer. By changing
  2565. the threshold to 5 elements we get a measurable speedup. I believe
  2566. this will help real web pages too, not just the benchmark.
  2567. * kjs/list.cpp: Change constant from 4 to 5.
  2568. 2007-03-19 Darin Adler <darin@apple.com>
  2569. * kjs/value.h: Oops, fix build.
  2570. 2007-03-19 Darin Adler <darin@apple.com>
  2571. Reviewed by Geoff.
  2572. - remove ~JSValue; tiny low-risk performance boost
  2573. * kjs/value.h: Remove unneeded empty virtual destructor from JSValue.
  2574. The only class derived from JSValue is JSCell and it already has a
  2575. virtual destructor. Declaring an empty constructor in JSValue had one
  2576. good effect: it marked the destructor private, making it a compile
  2577. time error to try to destroy a JSValue; but that's not a likely
  2578. mistake for someone to make. It had two bad effects: (1) it caused gcc,
  2579. at least, to generate code to fix up the virtual table pointer to
  2580. point to the JSValue version of the virtual table inside the destructor
  2581. of all classes derived from JSValue directly or indirectly; (2) it
  2582. caused JSValue to be a polymorphic class so required a virtual table for
  2583. it. It's cleaner to not have either of those.
  2584. 2007-03-18 Maciej Stachowiak <mjs@apple.com>
  2585. Reviewed by Mark.
  2586. - avoid static construction (and global variable access) in a smarter, more portable way,
  2587. to later enable MUTLI_THREAD mode to work on other platforms and compilers.
  2588. * kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers.
  2589. (KJS::CommonIdentifiers::CommonIdentifiers):
  2590. (KJS::CommonIdentifiers::shared):
  2591. * kjs/CommonIdentifiers.h: Added.
  2592. * kjs/ExecState.h:
  2593. (KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access.
  2594. (KJS::ExecState::ExecState):
  2595. * API/JSObjectRef.cpp:
  2596. (JSObjectMakeConstructor):
  2597. * CMakeLists.txt:
  2598. * JavaScriptCore.exp:
  2599. * JavaScriptCore.pri:
  2600. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  2601. * JavaScriptCore.xcodeproj/project.pbxproj:
  2602. * JavaScriptCoreSources.bkl:
  2603. * bindings/runtime_array.cpp:
  2604. (RuntimeArray::getOwnPropertySlot):
  2605. (RuntimeArray::put):
  2606. * bindings/runtime_method.cpp:
  2607. (RuntimeMethod::getOwnPropertySlot):
  2608. * kjs/array_object.cpp:
  2609. (ArrayInstance::getOwnPropertySlot):
  2610. (ArrayInstance::put):
  2611. (ArrayInstance::deleteProperty):
  2612. (ArrayProtoFunc::ArrayProtoFunc):
  2613. (ArrayProtoFunc::callAsFunction):
  2614. (ArrayObjectImp::ArrayObjectImp):
  2615. * kjs/bool_object.cpp:
  2616. (BooleanPrototype::BooleanPrototype):
  2617. (BooleanProtoFunc::BooleanProtoFunc):
  2618. (BooleanProtoFunc::callAsFunction):
  2619. (BooleanObjectImp::BooleanObjectImp):
  2620. * kjs/completion.h:
  2621. (KJS::Completion::Completion):
  2622. * kjs/date_object.cpp:
  2623. (KJS::DateProtoFunc::DateProtoFunc):
  2624. (KJS::DateObjectImp::DateObjectImp):
  2625. (KJS::DateObjectFuncImp::DateObjectFuncImp):
  2626. * kjs/error_object.cpp:
  2627. (ErrorPrototype::ErrorPrototype):
  2628. (ErrorProtoFunc::ErrorProtoFunc):
  2629. (ErrorProtoFunc::callAsFunction):
  2630. (ErrorObjectImp::ErrorObjectImp):
  2631. (ErrorObjectImp::construct):
  2632. (NativeErrorPrototype::NativeErrorPrototype):
  2633. (NativeErrorImp::NativeErrorImp):
  2634. (NativeErrorImp::construct):
  2635. (NativeErrorImp::callAsFunction):
  2636. * kjs/function.cpp:
  2637. (KJS::FunctionImp::getOwnPropertySlot):
  2638. (KJS::FunctionImp::put):
  2639. (KJS::FunctionImp::deleteProperty):
  2640. (KJS::FunctionImp::getParameterName):
  2641. (KJS::DeclaredFunctionImp::construct):
  2642. (KJS::IndexToNameMap::unMap):
  2643. (KJS::Arguments::Arguments):
  2644. (KJS::ActivationImp::getOwnPropertySlot):
  2645. (KJS::ActivationImp::deleteProperty):
  2646. (KJS::GlobalFuncImp::GlobalFuncImp):
  2647. * kjs/function_object.cpp:
  2648. (FunctionPrototype::FunctionPrototype):
  2649. (FunctionProtoFunc::FunctionProtoFunc):
  2650. (FunctionProtoFunc::callAsFunction):
  2651. (FunctionObjectImp::FunctionObjectImp):
  2652. (FunctionObjectImp::construct):
  2653. * kjs/grammar.y:
  2654. * kjs/identifier.cpp:
  2655. * kjs/identifier.h:
  2656. * kjs/interpreter.cpp:
  2657. (KJS::Interpreter::init):
  2658. (KJS::Interpreter::initGlobalObject):
  2659. * kjs/interpreter.h:
  2660. * kjs/lookup.h:
  2661. * kjs/math_object.cpp:
  2662. (MathFuncImp::MathFuncImp):
  2663. * kjs/nodes.cpp:
  2664. (ArrayNode::evaluate):
  2665. (FuncDeclNode::processFuncDecl):
  2666. (FuncExprNode::evaluate):
  2667. * kjs/number_object.cpp:
  2668. (NumberPrototype::NumberPrototype):
  2669. (NumberProtoFunc::NumberProtoFunc):
  2670. (NumberObjectImp::NumberObjectImp):
  2671. * kjs/object.cpp:
  2672. (KJS::JSObject::put):
  2673. (KJS::JSObject::defaultValue):
  2674. (KJS::JSObject::hasInstance):
  2675. * kjs/object.h:
  2676. (KJS::JSObject::getOwnPropertySlot):
  2677. * kjs/object_object.cpp:
  2678. (ObjectPrototype::ObjectPrototype):
  2679. (ObjectProtoFunc::ObjectProtoFunc):
  2680. (ObjectObjectImp::ObjectObjectImp):
  2681. * kjs/regexp_object.cpp:
  2682. (RegExpPrototype::RegExpPrototype):
  2683. (RegExpProtoFunc::RegExpProtoFunc):
  2684. (RegExpObjectImp::RegExpObjectImp):
  2685. * kjs/string_object.cpp:
  2686. (KJS::StringInstance::getOwnPropertySlot):
  2687. (KJS::StringInstance::put):
  2688. (KJS::StringInstance::deleteProperty):
  2689. (KJS::StringPrototype::StringPrototype):
  2690. (KJS::StringProtoFunc::StringProtoFunc):
  2691. (KJS::StringProtoFunc::callAsFunction):
  2692. (KJS::StringObjectImp::StringObjectImp):
  2693. (KJS::StringObjectFuncImp::StringObjectFuncImp):
  2694. * kjs/testkjs.cpp:
  2695. (TestFunctionImp::TestFunctionImp):
  2696. 2007-03-18 Andrew Wellington <proton@wiretapped.net>
  2697. Reviewed by Mark Rowe
  2698. Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
  2699. * JavaScriptCore.xcodeproj/project.pbxproj:
  2700. 2007-03-19 Mark Rowe <mrowe@apple.com>
  2701. Rubber-stamped by Brady.
  2702. Update references to bugzilla.opendarwin.org with bugs.webkit.org.
  2703. * bindings/c/c_utility.cpp:
  2704. (KJS::Bindings::convertUTF8ToUTF16):
  2705. * kjs/function.cpp:
  2706. (KJS::FunctionImp::callAsFunction):
  2707. * kjs/grammar.y:
  2708. * kjs/keywords.table:
  2709. * kjs/lexer.cpp:
  2710. (KJS::Lexer::shift):
  2711. 2007-03-18 Geoffrey Garen <ggaren@apple.com>
  2712. Reviewed by Oliver Hunt.
  2713. Exposed some extra toUInt32 functionality, as part of the fix for
  2714. REGRESSION: Incomplete document.all implementation breaks abtelectronics.com
  2715. (Style Change Through JavaScript Blanks Content)
  2716. * JavaScriptCore.exp:
  2717. * kjs/identifier.h:
  2718. (KJS::Identifier::toUInt32):
  2719. 2007-03-18 Geoffrey Garen <ggaren@apple.com>
  2720. Removed duplicate export name.
  2721. * JavaScriptCore.exp:
  2722. 2007-03-15 Geoffrey Garen <ggaren@apple.com>
  2723. Reviewed by Maciej Stachowiak.
  2724. Fixed <rdar://problem/5064964> Repro ASSERT failure in JS Bindings when
  2725. closing window @ lowtrades.bptrade.com
  2726. Unfortunately, the bindings depend on UString and Identifier as string
  2727. representations. So, they need to acquire the JSLock when doing something
  2728. that will ref/deref their strings.
  2729. Layout tests, the original site, and Java, Flash, and Quicktime on the
  2730. web work. No leaks reported. No automated test for this because testing
  2731. the Java bindings, like math, is hard.
  2732. * bindings/runtime.h: Made Noncopyable, just to be sure.
  2733. * bindings/c/c_class.cpp:
  2734. (KJS::Bindings::CClass::~CClass): Acquire the JSLock and explicitly clear the keys
  2735. in our hashtable, since they're UString::Reps, and ref/deref aren't thread-safe.
  2736. (KJS::Bindings::CClass::methodsNamed): Also acquire the JSLock when adding
  2737. keys to the table, since the table ref's them.
  2738. (KJS::Bindings::CClass::fieldNamed): ditto.
  2739. * bindings/c/c_utility.cpp: Removed dead function.
  2740. (KJS::Bindings::convertValueToNPVariant): Acquire the JSLock because doing
  2741. it recursively is pretty cheap, and it's just too confusing to tell whether
  2742. all our callers do it for us.
  2743. (KJS::Bindings::convertNPVariantToValue): ditto
  2744. * bindings/c/c_utility.h:
  2745. * bindings/jni/jni_class.cpp: Same deal as c_class.cpp.
  2746. (JavaClass::JavaClass):
  2747. (JavaClass::~JavaClass):
  2748. * bindings/jni/jni_instance.cpp: Same deal as c_utility.cpp.
  2749. (JavaInstance::stringValue):
  2750. * bindings/jni/jni_jsobject.cpp:
  2751. (JavaJSObject::convertValueToJObject):
  2752. * bindings/jni/jni_runtime.cpp:
  2753. (JavaMethod::~JavaMethod): Moved from header, for clarity.
  2754. (appendClassName): Made this static, so the set of callers is known, and
  2755. we can assert that we hold the JSLock. Also changed it to take a UString
  2756. reference, which makes the calling code simpler.
  2757. (JavaMethod::signature): Store the ASCII value we care about instead of
  2758. a UString, since UString is so much more hassle. Hold the JSLock while
  2759. building up the temporary UString.
  2760. * bindings/jni/jni_runtime.h: Nixed dead code in JavaMethod.
  2761. (KJS::Bindings::JavaString::JavaString): Hold a UString::Rep instead of
  2762. a UString, so we can acquire the JSLock and explicitly release it.
  2763. (KJS::Bindings::JavaString::_commonInit):
  2764. (KJS::Bindings::JavaString::~JavaString):
  2765. (KJS::Bindings::JavaString::UTF8String):
  2766. (KJS::Bindings::JavaString::uchars):
  2767. (KJS::Bindings::JavaString::length):
  2768. (KJS::Bindings::JavaString::ustring):
  2769. * bindings/jni/jni_utility.cpp:
  2770. (KJS::Bindings::convertArrayInstanceToJavaArray): Made this static, so
  2771. the set of callers is known, and we can assert that we hold the JSLock.
  2772. (KJS::Bindings::convertValueToJValue): Acquire the JSLock because doing
  2773. it recursively is pretty cheap, and it's just too confusing to tell whether
  2774. all our callers do it for us.
  2775. * bindings/objc/objc_runtime.h: Nixed some dead code.
  2776. * bindings/objc/objc_utility.mm:
  2777. (KJS::Bindings::convertNSStringToString): Same drill as above.
  2778. 2007-03-18 Alexey Proskuryakov <ap@webkit.org>
  2779. Reviewed by Geoff.
  2780. http://bugs.webkit.org/show_bug.cgi?id=13105
  2781. REGRESSION: an exception raised when calculating base value of a dot expression is not returned
  2782. Test: fast/js/dot-node-base-exception.html
  2783. * kjs/nodes.cpp:
  2784. (FunctionCallDotNode::evaluate): Added the necessary KJS_CHECKEXCEPTIONVALUE.
  2785. 2007-03-18 Steve Falkenburg <sfalken@apple.com>
  2786. Build fix.
  2787. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  2788. 2007-03-17 Timothy Hatcher <timothy@apple.com>
  2789. Reviewed by Mark Rowe.
  2790. Made Version.xcconfig smarter when building for different configurations.
  2791. Now uses the 522+ OpenSource version for Debug and Release, while using the
  2792. full 522.4 version for Production builds. The system prefix is also computed
  2793. based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
  2794. * Configurations/JavaScriptCore.xcconfig:
  2795. * Configurations/Version.xcconfig:
  2796. 2007-03-15 Maciej Stachowiak <mjs@apple.com>
  2797. Not reviewed.
  2798. - build fix
  2799. * wtf/TCSystemAlloc.cpp:
  2800. 2007-03-15 Maciej Stachowiak <mjs@apple.com>
  2801. Reviewed by Geoff and Steve.
  2802. - fix some portability issues with TCMalloc.
  2803. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  2804. * kjs/config.h:
  2805. * wtf/FastMalloc.cpp:
  2806. (WTF::SizeClass):
  2807. (WTF::InitSizeClasses):
  2808. (WTF::TCMalloc_PageHeap::Split):
  2809. (WTF::TCMalloc_PageHeap::RegisterSizeClass):
  2810. (WTF::TCMalloc_Central_FreeList::length):
  2811. (WTF::TCMalloc_ThreadCache::InitTSD):
  2812. (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  2813. * wtf/TCSpinLock.h:
  2814. * wtf/TCSystemAlloc.cpp:
  2815. (TryVirtualAlloc):
  2816. (TCMalloc_SystemAlloc):
  2817. 2007-03-15 Timothy Hatcher <timothy@apple.com>
  2818. Reviewed by John.
  2819. * Factored out most of our common build settings into .xcconfig files. Anything that was common in
  2820. each build configuration was factored out into the shared .xcconfig file.
  2821. * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
  2822. * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
  2823. * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
  2824. * Configurations/Base.xcconfig: Added.
  2825. * Configurations/DebugRelease.xcconfig: Added.
  2826. * Configurations/JavaScriptCore.xcconfig: Added.
  2827. * Configurations/Version.xcconfig: Added.
  2828. * Info.plist:
  2829. * JavaScriptCore.xcodeproj/project.pbxproj:
  2830. 2007-03-16 Shrikant Gangoda <shrikant.gangoda@celunite.com>
  2831. Gdk build fix.
  2832. * kjs/DateMath.cpp: gettimeofday comes from <sys/time.h> on Linux.
  2833. 2007-03-14 Kevin McCullough <kmccullough@apple.com>
  2834. Reviewed by .
  2835. - Fixed one more build breakage
  2836. * kjs/date_object.cpp:
  2837. (KJS::formatLocaleDate):
  2838. 2007-03-14 Kevin McCullough <kmccullough@apple.com>
  2839. Reviewed by .
  2840. - Fixed a build breakage.
  2841. * kjs/DateMath.cpp:
  2842. * kjs/date_object.cpp:
  2843. (KJS::formatLocaleDate):
  2844. (KJS::DateObjectImp::construct):
  2845. 2007-03-14 Kevin McCullough <kmccullough@apple.com>
  2846. Reviewed by Geoff.
  2847. - rdar://problem/5045720
  2848. - DST changes in US affect JavaScript date calculations (12975)
  2849. This fix was to ensure we properly test for the new changes to DST in the US.
  2850. Also this fixes when we apply DST, now we correctly map most past years to current
  2851. DST rules. We still have a small issue with years before 1900 or after 2100.
  2852. rdar://problem/5055038
  2853. * kjs/DateMath.cpp: Fix DST to match spec better.
  2854. (KJS::getCurrentUTCTime):
  2855. (KJS::mimimumYearForDST):
  2856. (KJS::maximumYearForDST):
  2857. (KJS::equivalentYearForDST):
  2858. (KJS::getDSTOffset):
  2859. * kjs/DateMath.h: Consolodated common funtionality.
  2860. * kjs/date_object.cpp: Consolodated common functionality.
  2861. (KJS::formatLocaleDate):
  2862. (KJS::DateObjectImp::construct):
  2863. * tests/mozilla/ecma/jsref.js: Added functions for finding the correct days when DST starts and ends.
  2864. * tests/mozilla/ecma/shell.js: Added back in the old DST functions for ease of merging with mozilla if needed.
  2865. * tests/mozilla/ecma_2/jsref.js: Added functions for finding the correct days when DST starts and ends.
  2866. * tests/mozilla/ecma_3/Date/shell.js: Added functions for finding the correct days when DST starts and ends.
  2867. * tests/mozilla/expected.html: Updated to show all date tests passing.
  2868. === Safari-5522.4 ===
  2869. 2007-03-13 Kevin McCullough <kmccullough@apple.com>
  2870. Reviewed by .
  2871. - Adding expected failures until the are truly fixed.
  2872. - rdar://problem/5060302
  2873. * tests/mozilla/expected.html:
  2874. 2007-03-12 Kevin McCullough <kmccullough@apple.com>
  2875. Reviewed by .
  2876. - Actually update tests for new DST rules.
  2877. * tests/mozilla/ecma/Date/15.9.3.1-1.js:
  2878. * tests/mozilla/ecma/Date/15.9.3.1-2.js:
  2879. * tests/mozilla/ecma/Date/15.9.3.1-3.js:
  2880. * tests/mozilla/ecma/Date/15.9.3.1-4.js:
  2881. * tests/mozilla/ecma/Date/15.9.3.1-5.js:
  2882. * tests/mozilla/ecma/Date/15.9.3.2-1.js:
  2883. * tests/mozilla/ecma/Date/15.9.3.2-2.js:
  2884. * tests/mozilla/ecma/Date/15.9.3.2-3.js:
  2885. * tests/mozilla/ecma/Date/15.9.3.2-4.js:
  2886. * tests/mozilla/ecma/Date/15.9.3.2-5.js:
  2887. * tests/mozilla/ecma/Date/15.9.3.8-1.js:
  2888. * tests/mozilla/ecma/Date/15.9.3.8-2.js:
  2889. * tests/mozilla/ecma/Date/15.9.3.8-3.js:
  2890. * tests/mozilla/ecma/Date/15.9.3.8-4.js:
  2891. * tests/mozilla/ecma/Date/15.9.3.8-5.js:
  2892. * tests/mozilla/ecma/Date/15.9.5.10-1.js:
  2893. * tests/mozilla/ecma/Date/15.9.5.10-10.js:
  2894. * tests/mozilla/ecma/Date/15.9.5.10-11.js:
  2895. * tests/mozilla/ecma/Date/15.9.5.10-12.js:
  2896. * tests/mozilla/ecma/Date/15.9.5.10-13.js:
  2897. * tests/mozilla/ecma/Date/15.9.5.10-2.js:
  2898. * tests/mozilla/ecma/Date/15.9.5.10-3.js:
  2899. * tests/mozilla/ecma/Date/15.9.5.10-4.js:
  2900. * tests/mozilla/ecma/Date/15.9.5.10-5.js:
  2901. * tests/mozilla/ecma/Date/15.9.5.10-6.js:
  2902. * tests/mozilla/ecma/Date/15.9.5.10-7.js:
  2903. * tests/mozilla/ecma/Date/15.9.5.10-8.js:
  2904. * tests/mozilla/ecma/Date/15.9.5.10-9.js:
  2905. * tests/mozilla/ecma/jsref.js:
  2906. * tests/mozilla/ecma_2/jsref.js:
  2907. * tests/mozilla/ecma_3/Date/shell.js:
  2908. 2007-03-12 Kevin McCullough <kmccullough@apple.com>
  2909. Reviewed by .
  2910. - Update tests for new DST rules.
  2911. * tests/mozilla/ecma/shell.js:
  2912. 2007-03-11 Geoffrey Garen <ggaren@apple.com>
  2913. Reviewed by Oliver Hunt.
  2914. Fixed <rdar://problem/4681051> Installer crashes in KJS::Collector::
  2915. markOtherThreadConservatively(KJS::Collector::Thread*) trying to install
  2916. iLife 06 using Rosetta on an Intel Machine
  2917. The problem was that our thread-specific data destructor would modify the
  2918. list of active JavaScript threads without holding the JSLock, corrupting
  2919. the list. Corruption was especially likely if one JavaScript thread exited
  2920. while another was starting up.
  2921. * JavaScriptCore.exp:
  2922. * kjs/JSLock.cpp: Don't conflate locking the JSLock with registering a
  2923. thread, since the thread-specific data destructor needs to lock
  2924. without registering a thread. Instead, treat thread registration as a
  2925. part of the convenience of the JSLock object, and whittle down JSLock::lock()
  2926. to just the bits that actually do the locking.
  2927. (KJS::JSLock::lock):
  2928. (KJS::JSLock::registerThread):
  2929. * kjs/JSLock.h: Updated comments to mention the new behavior above, and
  2930. other recent changes.
  2931. (KJS::JSLock::JSLock):
  2932. * kjs/collector.cpp:
  2933. (KJS::destroyRegisteredThread): Lock here.
  2934. (KJS::Collector::registerThread): To match, assert that we're locked here.
  2935. 2007-03-10 Geoffrey Garen <ggaren@apple.com>
  2936. Reviewed by Darin Adler.
  2937. Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and
  2938. JSCore causes a hang @ www.panoramas.dk
  2939. With a PAC file, run-webkit-tests --threaded passes, the reported site
  2940. works, and all the Quicktime/JavaScript and Flash/JavaScript examples
  2941. I found through Google work, too.
  2942. Any time JavaScript causes arbitrary non-JavaScript code to execute, it
  2943. risks deadlock, because that code may block, trying to acquire a lock
  2944. owned by a thread that is waiting to execute JavaScript. In this case,
  2945. the thread was a networking thread that was waiting to interpret a PAC file.
  2946. Because non-JavaScript code may execute in response to, well, anything,
  2947. a perfect solution to this problem is impossible. I've implemented an
  2948. optimistic solution, instead: JavaScript will drop its lock whenever it
  2949. makes a direct call to non-JavaScript code through a bridging/plug-in API,
  2950. but will blissfully ignore the indirect ways it may cause non-JavaScript
  2951. code to run (resizing a window, for example).
  2952. Unfortunately, this solution introduces significant locking overhead in
  2953. the bridging APIs. I don't see a way around that.
  2954. This patch includes some distinct bug fixes I saw along the way:
  2955. * bindings/objc/objc_instance.mm: Fixed a bug where a nested begin() call
  2956. would leak its autorelease pool, because it would NULL out _pool without
  2957. draining it.
  2958. * bindings/runtime_object.cpp:
  2959. (RuntimeObjectImp::methodGetter): Don't copy an Identifier to ASCII only
  2960. to turn around and make an Identifier from the ASCII. In an earlier
  2961. version of this patch, the copy caused an assertion failure. Now it's
  2962. just unnecessary work.
  2963. (RuntimeObjectImp::getOwnPropertySlot): ditto
  2964. * bindings/objc/objc_instance.h: Removed overrides of setVAlueOfField and
  2965. getValueOfField, because they did exactly what the base class versions did.
  2966. Removed overrides of Noncopyable declarations for the same reason.
  2967. * bindings/runtime.h: Inherit from Noncopyable instead of rolling our own.
  2968. * bindings/c/c_instance.h: ditto
  2969. And the actual patch:
  2970. * API/JSCallbackConstructor.cpp: Drop all locks when calling out to C.
  2971. (KJS::JSCallbackConstructor::construct):
  2972. * API/JSCallbackFunction.cpp: ditto
  2973. (KJS::JSCallbackFunction::callAsFunction):
  2974. * API/JSCallbackObject.cpp: ditto
  2975. (KJS::JSCallbackObject::init):
  2976. (KJS::JSCallbackObject::~JSCallbackObject):
  2977. (KJS::JSCallbackObject::getOwnPropertySlot):
  2978. (KJS::JSCallbackObject::put):
  2979. (KJS::JSCallbackObject::deleteProperty):
  2980. (KJS::JSCallbackObject::construct):
  2981. (KJS::JSCallbackObject::hasInstance):
  2982. (KJS::JSCallbackObject::callAsFunction):
  2983. (KJS::JSCallbackObject::getPropertyNames):
  2984. (KJS::JSCallbackObject::toNumber):
  2985. (KJS::JSCallbackObject::toString):
  2986. (KJS::JSCallbackObject::staticValueGetter):
  2987. (KJS::JSCallbackObject::callbackGetter):
  2988. * bindings/c/c_instance.cpp: Drop all locks when calling out to C.
  2989. (KJS::Bindings::CInstance::invokeMethod):
  2990. (KJS::Bindings::CInstance::invokeDefaultMethod):
  2991. * bindings/c/c_runtime.cpp: Drop all locks when calling out to C.
  2992. (KJS::Bindings::CField::valueFromInstance):
  2993. (KJS::Bindings::CField::setValueToInstance):
  2994. * bindings/jni/jni_objc.mm:
  2995. (KJS::Bindings::dispatchJNICall): Drop all locks when calling out to Java.
  2996. * bindings/objc/objc_instance.mm: The changes here are to accomodate the
  2997. fact that C++ unwinding of DropAllLocks goes crazy when you put it inside
  2998. a @try block. I moved all JavaScript stuff outside of the @try blocks, and
  2999. then prefixed the whole blocks with DropAllLocks objects. This required some
  3000. supporting changes in other functions, which now acquire the JSLock for
  3001. themselves, intead of relying on their callers to do so.
  3002. (ObjcInstance::end):
  3003. (ObjcInstance::invokeMethod):
  3004. (ObjcInstance::invokeDefaultMethod):
  3005. (ObjcInstance::setValueOfUndefinedField):
  3006. (ObjcInstance::getValueOfUndefinedField):
  3007. * bindings/objc/objc_runtime.mm: Same as above, except I didn't want to
  3008. change throwError to acquire the JSLock for itself.
  3009. (ObjcField::valueFromInstance):
  3010. (ObjcField::setValueToInstance):
  3011. * bindings/objc/objc_utility.mm: Supporting changes mentioned above.
  3012. (KJS::Bindings::convertValueToObjcValue):
  3013. (KJS::Bindings::convertObjcValueToValue):
  3014. * kjs/JSLock.cpp:
  3015. (1) Fixed DropAllLocks to behave as advertised, and drop the JSLock only
  3016. if the current thread actually acquired it in the first place. This is
  3017. important because WebKit needs to ensure that the JSLock has been
  3018. dropped before it makes a plug-in call, even though it doesn't know if
  3019. the current thread actually acquired the JSLock. (We don't want WebKit
  3020. to accidentally drop a lock belonging to *another thread*.)
  3021. (2) Used the new per-thread code written for (1) to make recursive calls
  3022. to JSLock very cheap. JSLock now knows to call pthread_mutext_lock/
  3023. pthread_mutext_unlock only at nesting level 0.
  3024. (KJS::createDidLockJSMutex):
  3025. (KJS::JSLock::lock):
  3026. (KJS::JSLock::unlock):
  3027. (KJS::DropAllLocks::DropAllLocks):
  3028. (KJS::DropAllLocks::~DropAllLocks):
  3029. (KJS::JSLock::lockCount):
  3030. * kjs/JSLock.h: Don't duplicate Noncopyable.
  3031. (KJS::JSLock::~JSLock):
  3032. * wtf/Assertions.h: Blind attempt at helping the Windows build.
  3033. 2007-03-08 Darin Fisher <darin@chromium.org>
  3034. Reviewed by Darin.
  3035. http://bugs.webkit.org/show_bug.cgi?id=13018
  3036. Bug 13018: allow embedders to override the definition of CRASH.
  3037. * wtf/Assertions.h: make it possible to override CRASH.
  3038. 2007-03-07 Huan Ren <huanr@chromium.org>
  3039. Reviewed by Maciej.
  3040. Fix http://bugs.webkit.org/show_bug.cgi?id=12535
  3041. Bug 12535: Stack-optimizing compilers can trick GC into freeing in-use objects
  3042. * kjs/internal.cpp:
  3043. (KJS::StringImp::toObject): Copy val onto the stack so it is not subject to garbage collection.
  3044. 2007-03-07 Geoffrey Garen <ggaren@apple.com>
  3045. Build fix for non-multiple-thread folks.
  3046. Use a shared global in the non-multiple-thread case.
  3047. * wtf/FastMalloc.cpp:
  3048. (WTF::isForbidden):
  3049. (WTF::fastMallocForbid):
  3050. (WTF::fastMallocAllow):
  3051. 2007-03-07 Geoffrey Garen <ggaren@apple.com>
  3052. Reviewed by Darin Adler.
  3053. Fixed ASSERT failure I just introduced.
  3054. Made the fastMalloc isForbidden flag per thread. (Oops!) We expect that
  3055. other threads will malloc while we're marking -- we just want to prevent
  3056. our own marking from malloc'ing.
  3057. * wtf/FastMalloc.cpp:
  3058. (WTF::initializeIsForbiddenKey):
  3059. (WTF::isForbidden):
  3060. (WTF::fastMallocForbid):
  3061. (WTF::fastMallocAllow):
  3062. (WTF::fastMalloc):
  3063. (WTF::fastCalloc):
  3064. (WTF::fastFree):
  3065. (WTF::fastRealloc):
  3066. (WTF::do_malloc):
  3067. 2007-03-07 Shrikant Gangoda <shrikant.gangoda@celunite.com>
  3068. Reviewed by Maciej.
  3069. http://bugs.webkit.org/show_bug.cgi?id=12997
  3070. Wrap pthread-specific assertion in #if USE(MULTIPLE_THREADS).
  3071. * kjs/collector.cpp:
  3072. (KJS::Collector::markMainThreadOnlyObjects):
  3073. 2007-03-06 Geoffrey Garen <ggaren@apple.com>
  3074. Reviewed by Maciej Stachowiak.
  3075. Fixed <rdar://problem/4576242> | http://bugs.webkit.org/show_bug.cgi?id=12586
  3076. PAC file: malloc deadlock sometimes causes a hang @ www.apple.com/pro/profiles/ (12586)
  3077. This is a modified version of r14752 on the branch.
  3078. These changes just add debugging functionality. They ASSERT that we don't
  3079. malloc during the mark phase of a garbage collection, which can cause a
  3080. deadlock.
  3081. * kjs/collector.cpp:
  3082. (KJS::Collector::collect):
  3083. * wtf/FastMalloc.cpp:
  3084. (WTF::fastMallocForbid):
  3085. (WTF::fastMallocAllow):
  3086. (WTF::fastMalloc):
  3087. (WTF::fastCalloc):
  3088. (WTF::fastFree):
  3089. (WTF::fastRealloc):
  3090. (WTF::do_malloc):
  3091. * wtf/FastMalloc.h:
  3092. 2007-03-06 Geoffrey Garen <ggaren@apple.com>
  3093. Reviewed by Maciej Stachowiak.
  3094. Fixed all known crashers exposed by run-webkit-tests --threaded. This covers:
  3095. <rdar://problem/4565394> | http://bugs.webkit.org/show_bug.cgi?id=12585
  3096. PAC file: after closing a window that contains macworld.com, new window
  3097. crashes (KJS::PropertyMap::mark()) (12585)
  3098. <rdar://problem/4571215> | http://bugs.webkit.org/show_bug.cgi?id=9211
  3099. PAC file: Crash occurs when clicking on the navigation tabs at http://www.businessweek.com/ (9211)
  3100. <rdar://problem/4557926>
  3101. PAC file: Crash occurs when attempting to view image in slideshow mode
  3102. at http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute (KJS::
  3103. ExecState*) + 312) if you use a PAC file
  3104. (1) Added some missing JSLocks, along with related ASSERTs.
  3105. (2) Fully implemented support for objects that can only be garbage collected
  3106. on the main thread. So far, only WebCore uses this. We can add it to API
  3107. later if we learn that it's needed.
  3108. The implementation uses a "main thread only" flag inside each object. When
  3109. collecting on a secondary thread, the Collector does an extra pass through
  3110. the heap to mark all flagged objects before sweeping. This solution makes
  3111. the common case -- flag lots of objects, but never collect on a secondary
  3112. thread -- very fast, even though the uncommon case of garbage collecting
  3113. on a secondary thread isn't as fast as it could be. I left some notes
  3114. about how to speed it up, if we ever care.
  3115. For posterity, here are some things I learned about GC while investigating:
  3116. * Each collect must either mark or delete every heap object. "Zombie"
  3117. objects, which are neither marked nor deleted, raise these issues:
  3118. * On the next pass, the conservative marking algorithm might mark a
  3119. zombie, causing it to mark freed objects.
  3120. * The client might try to use a zombie, which would seem live because
  3121. its finalizer had not yet run.
  3122. * A collect on the main thread is free to delete any object. Presumably,
  3123. objects allocated on secondary threads have thread-safe finalizers.
  3124. * A collect on a secondary thread must not delete thread-unsafe objects.
  3125. * The mark function must be thread-safe.
  3126. Line by line comments:
  3127. * API/JSObjectRef.h: Added comment specifying that the finalize callback
  3128. may run on any thread.
  3129. * JavaScriptCore.exp: Nothing to see here.
  3130. * bindings/npruntime.cpp:
  3131. (_NPN_GetStringIdentifier): Added JSLock.
  3132. * bindings/objc/objc_instance.h:
  3133. * bindings/objc/objc_instance.mm:
  3134. (ObjcInstance::~ObjcInstance): Use an autorelease pool. The other callers
  3135. to CFRelease needed one, too, but they were dead code, so I removed them
  3136. instead. (This fixes a leak seen while running run-webkit-tests --threaded,
  3137. although I don't think it's specifically a threading issue.)
  3138. * kjs/collector.cpp:
  3139. (KJS::Collector::collectOnMainThreadOnly): New function. Tells the collector
  3140. to collect a value only if it's collecting on the main thread.
  3141. (KJS::Collector::markMainThreadOnlyObjects): New function. Scans the heap
  3142. for "main thread only" objects and marks them.
  3143. * kjs/date_object.cpp:
  3144. (KJS::DateObjectImp::DateObjectImp): To make the new ASSERTs happy, allocate
  3145. our globals on the heap, avoiding a seemingly unsafe destructor call at
  3146. program exit time.
  3147. * kjs/function_object.cpp:
  3148. (FunctionPrototype::FunctionPrototype): ditto
  3149. * kjs/interpreter.cpp:
  3150. (KJS::Interpreter::mark): Removed boolean parameter, which was an incomplete
  3151. and arguably hackish way to implement markMainThreadOnlyObjects() inside WebCore.
  3152. * kjs/interpreter.h:
  3153. * kjs/identifier.cpp:
  3154. (KJS::identifierTable): Added some ASSERTs to check for thread safety
  3155. problems.
  3156. * kjs/list.cpp: Added some ASSERTs to check for thread safety problems.
  3157. (KJS::allocateListImp):
  3158. (KJS::List::release):
  3159. (KJS::List::append):
  3160. (KJS::List::empty): Make the new ASSERTs happy.
  3161. * kjs/object.h:
  3162. (KJS::JSObject::JSObject): "m_destructorIsThreadSafe" => "m_collectOnMainThreadOnly".
  3163. I removed the constructor parameter because m_collectOnMainThreadOnly,
  3164. like m_marked, is a Collector bit, so only the Collector should set or get it.
  3165. * kjs/object_object.cpp:
  3166. (ObjectPrototype::ObjectPrototype): Make the ASSERTs happy.
  3167. * kjs/regexp_object.cpp:
  3168. (RegExpPrototype::RegExpPrototype): ditto
  3169. * kjs/ustring.cpp: Added some ASSERTs to check for thread safety problems.
  3170. (KJS::UCharReference::ref):
  3171. (KJS::UString::Rep::createCopying):
  3172. (KJS::UString::Rep::create):
  3173. (KJS::UString::Rep::destroy):
  3174. (KJS::UString::null): Make the new ASSERTs happy.
  3175. * kjs/ustring.h:
  3176. (KJS::UString::Rep::ref): Added some ASSERTs to check for thread safety problems.
  3177. (KJS::UString::Rep::deref):
  3178. * kjs/value.h:
  3179. (KJS::JSCell::JSCell):
  3180. 2007-03-06 Geoffrey Garen <ggaren@apple.com>
  3181. Reviewed by Maciej Stachowiak.
  3182. 2% speedup on super accurate JS iBench.
  3183. (KJS::Collector::collect): Removed anti-optimization to call
  3184. pthread_is_threaded_np() before calling pthread_main_np(). Almost all
  3185. apps have more than one thread, so the extra call is actually worse.
  3186. Interestingly, even the single-threaded testkjs shows a speed gain
  3187. from removing the pthread_is_threaded_np() short-circuit. Not sure why.
  3188. 2007-03-04 Peter Kasting <pkasting@google.com>
  3189. Reviewed by Nikolas Zimmermann.
  3190. - fix http://bugs.webkit.org/show_bug.cgi?id=12950
  3191. Assertions.cpp should not #define macros that are already defined
  3192. * wtf/Assertions.cpp: Don't #define WINVER and _WIN32_WINNT if they
  3193. are already defined.
  3194. 2007-03-02 Steve Falkenburg <sfalken@apple.com>
  3195. Reviewed by Anders.
  3196. Add unsigned int hash traits (matches existing unsigned long version)
  3197. * wtf/HashTraits.h:
  3198. (WTF::):
  3199. 2007-03-02 Adam Roben <aroben@apple.com>
  3200. Reviewed by Kevin M.
  3201. Try to fix the Qt build.
  3202. * kjs/DateMath.cpp:
  3203. (KJS::msToGregorianDateTime): Removed unnecessary "struct" keyword.
  3204. * kjs/DateMath.h: Moved forward declarations to the top of the file
  3205. before they are used.
  3206. * kjs/date_object.cpp:
  3207. (KJS::formatLocaleDate): Changed to take a const GregorianDateTime&
  3208. since GregorianDateTime is Noncopyable.
  3209. 2007-03-02 Darin Adler <darin@apple.com>
  3210. Reviewed by Kevin McCullough.
  3211. - fix http://bugs.webkit.org/show_bug.cgi?id=12867
  3212. REGRESSION: BenchJS test 7 (dates) is 220% slower than in Safari 2.0.4
  3213. * kjs/DateMath.h: Marked GregorianDateTime as noncopyable, since it has a non-trivial
  3214. destructor and not the correspoding copy constructor or assignment operator.
  3215. Changed the GregorianDateTime constructor to use member initialization syntax.
  3216. Fixed the destructor to use the array delete operator, since timeZone is an array.
  3217. * kjs/DateMath.cpp:
  3218. (KJS::daysInYear): Changed to call isLeapYear so the rule is not repeated twice.
  3219. (KJS::getUTCOffset): Added caching on PLATFORM(DARWIN), since we can rely on the
  3220. notify_check function and "com.apple.system.timezone" to let us know when the
  3221. offset has changed.
  3222. 2007-02-27 Geoffrey Garen <ggaren@apple.com>
  3223. Reviewed by Darin Adler.
  3224. Follow-up to fixing http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
  3225. JS objects not collected after closing window @ ebay.com/maps.google.com
  3226. Changed Interpreter cache of global constructors and prototypes from
  3227. ProtectedPtrs to bare, marked pointers. ProtectedPtrs are inefficient,
  3228. and they increase the risk of reference cycles. Also, Darin said something
  3229. about ProtectedPtrs giving him warts.
  3230. Also changed data members to precise types from generic JSObject*'s.
  3231. Layout tests and JS tests pass.
  3232. * kjs/SavedBuiltins.h:
  3233. * kjs/interpreter.cpp:
  3234. (KJS::Interpreter::init):
  3235. (KJS::Interpreter::~Interpreter):
  3236. (KJS::Interpreter::initGlobalObject): Moved Identifier::init() call to
  3237. constructor, for clarity.
  3238. (KJS::Interpreter::mark):
  3239. * kjs/interpreter.h:
  3240. 2007-02-27 Geoffrey Garen <ggaren@apple.com>
  3241. Reviewed by Maciej Stachowiak.
  3242. Fixed http://bugs.webkit.org/show_bug.cgi?id=12659 | <rdar://problem/4954306>
  3243. JS objects not collected after closing window @ ebay.com/maps.google.com
  3244. Don't GC in the Interpreter destructor. For that to work, the Interpreter
  3245. would have to NULL out all of its ProtectedPtrs before calling collect(). But
  3246. we've decided that we don't want things to work that way, anyway. We want the
  3247. client to be in charge of manual GC so that it can optimize cases when
  3248. it will be destroying many interpreters at once
  3249. (e.g., http://bugs.webkit.org/show_bug.cgi?id=12900).
  3250. Also removed Interpreter::collect() because it was redundant with
  3251. Collector::collect().
  3252. * JavaScriptCore.exp:
  3253. * kjs/interpreter.cpp:
  3254. (KJS::Interpreter::~Interpreter):
  3255. * kjs/testkjs.cpp:
  3256. (TestFunctionImp::callAsFunction):
  3257. 2007-02-26 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  3258. Reviewed by Adam Roben.
  3259. Rename *_SUPPORT defines to ENABLE_*.
  3260. * jscore.bkl:
  3261. 2007-02-26 Maciej Stachowiak <mjs@apple.com>
  3262. Reviewed by Lars.
  3263. - <rdar://problem/5021698> Disable experimental SVG features (12883)
  3264. * wtf/Platform.h: Add ENABLE() macro similar to HAVE() and USE(), to
  3265. allow nicer handling of optional WebKit features.
  3266. 2007-02-22 George Staikos <staikos@kde.org>
  3267. Reviewed by Lars.
  3268. Add return values
  3269. * wtf/unicode/qt4/UnicodeQt4.h:
  3270. (WTF::Unicode::toLower):
  3271. (WTF::Unicode::toUpper):
  3272. 2007-02-22 Oscar Cwajbaum <public@oscarc.net>
  3273. Reviewed by Maciej.
  3274. Fix ARM-specific alignment problem in FastMalloc
  3275. http://bugs.webkit.org/show_bug.cgi?id=12841
  3276. * wtf/FastMalloc.cpp:
  3277. Modify how pageheap_memory is declared to ensure proper alignment
  3278. on architectures such as ARM
  3279. 2007-02-20 Zack Rusin <zrusin@trolltech.com>
  3280. Reviewed by Lars
  3281. Make sure that non-void methods always return something.
  3282. * wtf/unicode/qt4/UnicodeQt4.h:
  3283. (WTF::Unicode::toLower):
  3284. (WTF::Unicode::toUpper):
  3285. (WTF::Unicode::foldCase):
  3286. 2007-02-18 Kevin Ollivier <kevino@theolliviers.com>
  3287. Reviewed by Adam Roben.
  3288. Fix cases where MSVC-specific code was identified as Win32 platform
  3289. code. (as it should be compiled for e.g. wx port when using MSVC too)
  3290. * wtf/Assertions.h:
  3291. * wtf/MathExtras.h:
  3292. * wtf/StringExtras.h:
  3293. changed PLATFORM(WIN) sections to COMPILER(MSVC) as necessary
  3294. 2007-02-17 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  3295. Reviewed by Adam Roben.
  3296. Fix crashes on ARM due to different struct packing. Based on a patch
  3297. by Mike Emmel.
  3298. * kjs/ustring.cpp: compile-time assert to make sure sizeof(UChar) == 2
  3299. * kjs/ustring.h: pack UChar struct to ensure that sizeof(UChar) == 2
  3300. * wtf/Assertions.h: add COMPILE_ASSERT macro for compile-time assertions
  3301. 2007-02-16 George Staikos <staikos@kde.org>
  3302. Reviewed by Maciej.
  3303. Fix uninitialized variable
  3304. * bindings/testbindings.cpp:
  3305. (myAllocate):
  3306. 2007-02-16 Anders Carlsson <acarlsson@apple.com>
  3307. Reviewed by Mitz.
  3308. http://bugs.webkit.org/show_bug.cgi?id=12788
  3309. REGRESSION: Going back one page in history has a noticeable delay
  3310. Um...if all elements in two vectors are equal, then I guess we could say that
  3311. the two vectors are equal too.
  3312. * wtf/Vector.h:
  3313. (WTF::):
  3314. 2007-02-14 Anders Carlsson <acarlsson@apple.com>
  3315. Reviewed by Darin.
  3316. Add new canCompareWithMemcmp vector trait and use it to determine whether
  3317. operator== can use memcmp.
  3318. * wtf/Vector.h:
  3319. (WTF::):
  3320. (WTF::VectorTypeOperations::compare):
  3321. (WTF::operator==):
  3322. * wtf/VectorTraits.h:
  3323. (WTF::):
  3324. 2007-02-13 Brady Eidson <beidson@apple.com>
  3325. Reviewed by Darin
  3326. Tweaked vector a bit
  3327. * wtf/Vector.h:
  3328. (WTF::operator==):
  3329. 2007-02-13 Matt Perry <mpcomplete@chromium.org>
  3330. Reviewed by Darin.
  3331. - fix for http://bugs.webkit.org/show_bug.cgi?id=12750
  3332. Vector operator== was not defined correctly. It returned void,
  3333. did not accept const Vectors, and used an int instead of size_t.
  3334. * wtf/Vector.h: fixed comparison operators
  3335. (WTF::operator==):
  3336. (WTF::operator!=):
  3337. 2007-02-10 David Carson <dacarson@gmail.com>
  3338. Reviewed by Maciej.
  3339. - fix for http://bugs.webkit.org/show_bug.cgi?id=12636
  3340. Corrected the generation of method signatures when the parameter
  3341. is an Array.
  3342. Added support for converting a Javascript array to a Java array.
  3343. * bindings/jni/jni_utility.h: added new type for array, array_type
  3344. * bindings/jni/jni_runtime.cpp: add support for new array type
  3345. (JavaField::valueFromInstance):
  3346. (JavaField::setValueToInstance):
  3347. (JavaMethod::JavaMethod):
  3348. (JavaMethod::signature):
  3349. * bindings/jni/jni_utility.cpp: add support for new array type
  3350. (KJS::Bindings::callJNIMethod):
  3351. (KJS::Bindings::callJNIStaticMethod):
  3352. (KJS::Bindings::callJNIMethodIDA):
  3353. (KJS::Bindings::JNITypeFromClassName):
  3354. (KJS::Bindings::signatureFromPrimitiveType):
  3355. (KJS::Bindings::JNITypeFromPrimitiveType):
  3356. (KJS::Bindings::getJNIField):
  3357. (KJS::Bindings::convertArrayInstanceToJavaArray): new method
  3358. converts the Javascript array to the requested Java array.
  3359. (KJS::Bindings::convertValueToJValue):
  3360. 2007-02-08 Anders Carlsson <acarlsson@apple.com>
  3361. Reviewed by Geoff.
  3362. <rdar://problem/4930614>
  3363. Safari complains about "Slow Script" if GMail is left open and machine is busy
  3364. <rdar://problem/4649516>
  3365. Turn off slow script dialog or crank up time that makes it come up
  3366. <rdar://problem/4963589>
  3367. Slow script warning is displayed after closing of PROMPT or PRINT dialog
  3368. Re-do the way script timeouts are handled. No longer use a unix timer that sends signals. Instead, add a
  3369. tick count and increment it in loop bodies. If the tick count reaches a threshold, do a timeout check. If the total time executing
  3370. is higher than the timeout value, (possibly) interrupt the script. The timeout checker also adjusts the threshold dynamically
  3371. to prevent doing the timeout check too often.
  3372. * JavaScriptCore.exp:
  3373. Remove pause and resume calls.
  3374. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  3375. Add winmm.lib.
  3376. * kjs/interpreter.cpp:
  3377. (KJS::Interpreter::init):
  3378. (KJS::Interpreter::~Interpreter):
  3379. (KJS::Interpreter::startTimeoutCheck):
  3380. (KJS::Interpreter::stopTimeoutCheck):
  3381. (KJS::Interpreter::resetTimeoutCheck):
  3382. (KJS::getCurrentTime):
  3383. (KJS::Interpreter::checkTimeout):
  3384. * kjs/interpreter.h:
  3385. (KJS::Interpreter::timedOut):
  3386. * kjs/nodes.cpp:
  3387. (DoWhileNode::execute):
  3388. (WhileNode::execute):
  3389. (ForNode::execute):
  3390. 2007-02-07 Darin Adler <darin@apple.com>
  3391. * JavaScriptCore.vcproj/JavaScriptCore.sln: Reenable testkjs.
  3392. 2007-02-07 Darin Adler <darin@apple.com>
  3393. Reviewed by Geoff.
  3394. - another build fix; this time for sure
  3395. * pcre/pcre_exec.c: (match):
  3396. The compiler caught an incorrect use of the othercase variable across
  3397. a call to RMATCH in character repeat processing. Local variables can
  3398. change in the crazy NO_RECURSE mode that we use, so we instead need
  3399. the value in othercase to be in one of the special stack frame variables.
  3400. Added a new stack frame variable for this purpose named repeat_othercase.
  3401. Also noted a similar error in the non-UTF-16 side of the #ifdef, but
  3402. didn't try to fix that one. Also removed a SUPPORT_UCP #ifdef from the
  3403. PCRE_UTF16 side; that code doesn't work without the Unicde properties
  3404. table, and we don't try to use it that way.
  3405. 2007-02-06 Steve Falkenburg <sfalken@apple.com>
  3406. Disable testkjs in sln until we figure out mysterious compiler warning.
  3407. * JavaScriptCore.vcproj/JavaScriptCore.sln:
  3408. 2007-02-06 Steve Falkenburg <sfalken@apple.com>
  3409. Build fix by ggaren
  3410. * pcre/pcre_exec.c:
  3411. (match):
  3412. 2007-02-06 Darin Adler <darin@apple.com>
  3413. Reviewed by Geoff.
  3414. - fix <rdar://problem/4979089> PCRE should avoid setjmp/longjmp even when compiler
  3415. is not GCC
  3416. Added a new code path that's slower and way uglier but doesn't rely on GCC's
  3417. computed gotos.
  3418. * pcre/pcre_exec.c: Added a numeric parameter to the RMATCH function. It must be
  3419. different at every RMATCH call site. Changed the non-GCC NO_RECURSE version of
  3420. the macro to use a label incorporating the number. Changed the RRETURN macro to
  3421. use a goto instead of longjmp.
  3422. (match): Added a different number at each callsite, using a perl script for the
  3423. first-time task. Going forward it should be easy to maintain by hand. Added a
  3424. switch statement at the bottom of the function. We'll get compile time errors
  3425. if we have anything in the switch statement that's never used in an RMATCH,
  3426. but errors in the other direction are silent except at runtime.
  3427. 2007-02-06 Darin Adler <darin@apple.com>
  3428. Reviewed by John.
  3429. - fix <rdar://problem/4687840> 9A241: JavaScript RegExp 25-30x slower than on 10.4.7
  3430. I used Shark to figure out what to do. The test case is now 15% faster than with
  3431. stock Safari. Some other regular expression cases might still be a few % slower
  3432. than before, but the >10x slowdown is now completely gone.
  3433. 1) Fix slowness caused by setjmp/longjmp by using computed goto instead.
  3434. Use GCC extensions - locally declared labels, labels as values, and computed goto -
  3435. instead of using setjmp/longjmp to implemement non-recursive version of the regular
  3436. expression system. We could probably make this even faster if we reduced the use
  3437. of malloc a bit too.
  3438. 2) Fix slowness caused by allocating heapframe objects by allocating the first
  3439. 16 of them from the stack.
  3440. 3) Speed up use of malloc and free in PCRE by making it use fastMalloc and fastFree.
  3441. 4) Speed up the test case by adding a special case to a UString function.
  3442. 5) Made a small improvement to the innermost hottest loop of match by hoisting
  3443. the conversion from int to pcre_uchar out of the loop.
  3444. * JavaScriptCore.xcodeproj/project.pbxproj: Compile FastMallocPCRE.cpp, and don't
  3445. compile pcre_globals.c.
  3446. * wtf/FastMallocPCRE.cpp: Added. A copy of pcre_globals.c that uses FastMalloc.h.
  3447. This is better than code that sets the PCRE allocation globals because by doing it
  3448. this way there's guaranteed to be no problem with order of initialization.
  3449. * kjs/ustring.cpp: (KJS::UString::spliceSubstringsWithSeparators): Add a fast
  3450. special case when this is called for only one subrange and no seaprators. This
  3451. was happening a lot in the test case and it seems quite reasonable to optimize this.
  3452. * pcre/pcre_exec.c: Create a copy of the RMATCH and RRETURN macros that use goto
  3453. instead of setjmp/longjmp. Change code that calls pcre_stack_malloc to first use
  3454. storage on the stack inside the match function.
  3455. (match): Move initialization of utf8 up a couple lines to avoid "possibly used
  3456. uninitialized" warning. Use a local variable so we compare with pcre_uchar instead
  3457. of with int inside the inner "find a character" loop.
  3458. 2007-02-03 George Staikos <staikos@kde.org>
  3459. Reviewed by Alexey.
  3460. -1 is not a valid point. We can't handle anything > 0xffff anyway.
  3461. Fixes crash on cases like eval("x");
  3462. * wtf/unicode/qt4/UnicodeQt4.h:
  3463. (WTF::Unicode::category):
  3464. 2007-02-02 Darin Adler <darin@apple.com>
  3465. Reviewed by Anders.
  3466. - fix copying and assigning a ListHashSet
  3467. No test because the code path with bugs I am fixing is not used yet.
  3468. * wtf/ListHashSet.h: Tweaked ListHashSetNodeAllocator a little bit for clarity.
  3469. Changed m_allocator to be an OwnPtr instead of doing an explicit delete.
  3470. Fixed bug in copy constructor where we'd have an uninitialized m_allocator.
  3471. Fixed bug in assignment operator where it would swap only the hash table, and
  3472. not the head, tail, and allocator pointers.
  3473. 2007-02-02 Geoffrey Garen <ggaren@apple.com>
  3474. Reviewed by Maciej Stachowiak.
  3475. Use WTFLog instead of fprintf for logging KJS::Node leaks.
  3476. * kjs/nodes.cpp:
  3477. (NodeCounter::~NodeCounter): Changed count to unsigned, updated
  3478. to match style guidelines.
  3479. 2007-02-02 Maciej Stachowiak <mjs@apple.com>
  3480. - not reviewed, build fix
  3481. * wtf/ListHashSet.h:
  3482. (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator): ummm, use union correctly
  3483. 2007-02-01 Maciej Stachowiak <mjs@apple.com>
  3484. Reviewed by Darin.
  3485. - use a custom allocator for ListHashSet, to fix ~1% perf regression using it for form control
  3486. * wtf/ListHashSet.h:
  3487. (WTF::ListHashSetNodeAllocator::ListHashSetNodeAllocator):
  3488. (WTF::ListHashSetNodeAllocator::allocate):
  3489. (WTF::ListHashSetNodeAllocator::deallocate):
  3490. (WTF::ListHashSetNode::operator new):
  3491. (WTF::ListHashSetNode::operator delete):
  3492. (WTF::ListHashSetNode::destroy):
  3493. (WTF::ListHashSetTranslator::translate):
  3494. (WTF::::ListHashSet):
  3495. (WTF::::~ListHashSet):
  3496. (WTF::::add):
  3497. (WTF::::unlinkAndDelete):
  3498. (WTF::::deleteAllNodes):
  3499. 2007-01-31 Maciej Stachowiak <mjs@apple.com>
  3500. Reviewed by Adam.
  3501. - fix sporadic crash
  3502. * wtf/ListHashSet.h:
  3503. (WTF::::remove): remove before deleting
  3504. 2007-01-31 Maciej Stachowiak <mjs@apple.com>
  3505. Reviewed by Mark with help from Lars.
  3506. - added new ListHashSet class, which combines a hashtable and a linked list to provide a set
  3507. that keeps elements in inserted order
  3508. This is to assist in fixing the following:
  3509. <rdar://problem/4751164> REGRESSION: Safari places text on incorrect button when returning to a page via back [10541]
  3510. http://bugs.webkit.org/show_bug.cgi?id=10541
  3511. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  3512. * JavaScriptCore.xcodeproj/project.pbxproj:
  3513. * wtf/HashTable.h:
  3514. (WTF::HashTable::find):
  3515. (WTF::HashTable::contains):
  3516. (WTF::::find):
  3517. (WTF::::contains):
  3518. * wtf/ListHashSet.h: Added.
  3519. (WTF::ListHashSetNode::ListHashSetNode):
  3520. (WTF::ListHashSetNodeHashFunctions::hash):
  3521. (WTF::ListHashSetNodeHashFunctions::equal):
  3522. (WTF::ListHashSetIterator::ListHashSetIterator):
  3523. (WTF::ListHashSetIterator::get):
  3524. (WTF::ListHashSetIterator::operator*):
  3525. (WTF::ListHashSetIterator::operator->):
  3526. (WTF::ListHashSetIterator::operator++):
  3527. (WTF::ListHashSetIterator::operator--):
  3528. (WTF::ListHashSetIterator::operator==):
  3529. (WTF::ListHashSetIterator::operator!=):
  3530. (WTF::ListHashSetIterator::operator const_iterator):
  3531. (WTF::ListHashSetIterator::node):
  3532. (WTF::ListHashSetConstIterator::ListHashSetConstIterator):
  3533. (WTF::ListHashSetConstIterator::get):
  3534. (WTF::ListHashSetConstIterator::operator*):
  3535. (WTF::ListHashSetConstIterator::operator->):
  3536. (WTF::ListHashSetConstIterator::operator++):
  3537. (WTF::ListHashSetConstIterator::operator--):
  3538. (WTF::ListHashSetConstIterator::operator==):
  3539. (WTF::ListHashSetConstIterator::operator!=):
  3540. (WTF::ListHashSetConstIterator::node):
  3541. (WTF::ListHashSetTranslator::hash):
  3542. (WTF::ListHashSetTranslator::equal):
  3543. (WTF::ListHashSetTranslator::translate):
  3544. (WTF::::ListHashSet):
  3545. (WTF::::operator):
  3546. (WTF::::~ListHashSet):
  3547. (WTF::::size):
  3548. (WTF::::capacity):
  3549. (WTF::::isEmpty):
  3550. (WTF::::begin):
  3551. (WTF::::end):
  3552. (WTF::::find):
  3553. (WTF::::contains):
  3554. (WTF::::add):
  3555. (WTF::::remove):
  3556. (WTF::::clear):
  3557. (WTF::::unlinkAndDelete):
  3558. (WTF::::appendNode):
  3559. (WTF::::deleteAllNodes):
  3560. (WTF::::makeIterator):
  3561. (WTF::::makeConstIterator):
  3562. (WTF::deleteAllValues):
  3563. 2007-01-30 Darin Adler <darin@apple.com>
  3564. * kjs/DateMath.cpp: Fix license header to reflect LGPL as the first license
  3565. mentioned. We still mention the option of using under MPL or GPL since some
  3566. of this code came from the Mozilla project with those license terms.
  3567. 2007-01-30 Simon Hausmann <hausmann@kde.org>
  3568. Reviewed by Zack.
  3569. Turned JavaScriptCore from a separate library into an includable
  3570. project, to combine it all into libWebKitQt.
  3571. * JavaScriptCore.pri: Added.
  3572. * JavaScriptCore.pro: Removed.
  3573. * kjs/testkjs.pro:
  3574. 2007-01-29 Geoffrey Garen <ggaren@apple.com>
  3575. Reviewed by Maciej Stachowiak.
  3576. Fixed <rdar://problem/4485644> REGRESSION: JavaScriptCore has init routines
  3577. The TCMalloc module now initializes, if needed, inside GetCache() and
  3578. fastMallocSetIsMultiThreaded(). We leverage the same synchronization
  3579. technique used for enabling / disabling the single-threaded optimization
  3580. to synchronize initialization of the library without requiring a lock
  3581. for every malloc.
  3582. 1,251 runs of tcmalloc_unittest, 2 runs of a custom, massively multi-threaded
  3583. tcmalloc_unittest, and my custom version of the PLT show no regressions.
  3584. Super-accurate JS iBench reports a .24% regression, which is right at the
  3585. limit of its error range, so I'm declaring victory.
  3586. * wtf/FastMalloc.cpp:
  3587. (WTF::fastMallocSetIsMultiThreaded): Initialize, if needed. (InitModule()
  3588. checks the "if needed" part.)
  3589. (WTF::TCMalloc_ThreadCache::GetCache): Restored original TCMalloc code
  3590. inside #ifdef, for posterity. Added new initialization logic.
  3591. (WTF::TCMalloc_ThreadCache::InitModule): Call InitTSD(), since we don't
  3592. have a static initializer to call it for us, now. This means that fastMalloc
  3593. is not usable as a general libc allocator, but it never was, and if it were
  3594. the general libc allocator, we wouldn't be here in the first place, so whatever.
  3595. (WTF::TCMalloc_ThreadCache::InitTSD): Don't try to take the pageheap_lock,
  3596. since InitModule already has it.
  3597. 2007-01-29 Kevin McCullough <KMcCullough@apple.com>
  3598. Reviewed by Geoff and Oliver.
  3599. - rdar://problem/4955561
  3600. - missusing JavaScript shouldn't crash webkit. Now it doesn't, in this case.
  3601. * bindings/objc/objc_runtime.mm:
  3602. (ObjcFallbackObjectImp::callAsFunction):
  3603. * bindings/runtime_method.cpp:
  3604. (RuntimeMethod::callAsFunction):
  3605. * bindings/runtime_object.cpp:
  3606. (RuntimeObjectImp::callAsFunction):
  3607. 2007-01-28 Geoffrey Garen <ggaren@apple.com>
  3608. Reviewed by Maciej Stachowiak.
  3609. First step in fixing <rdar://problem/4485644> REGRESSION: JavaScriptCore
  3610. has init routines
  3611. Don't rely on a static initializer to store the main thread's ID (which
  3612. we would use to detect allocations on secondary threads). Instead, require
  3613. the caller to notify fastMalloc if it might allocate on a secondary thread.
  3614. Also fixed what seemed like a race condition in do_malloc.
  3615. tcmalloc_unittest and my custom versions of JS iBench and PLT show no
  3616. regressions.
  3617. * wtf/FastMalloc.cpp:
  3618. (WTF::fastMallocSetIsMultiThreaded):
  3619. (1) Renamed from "fastMallocRegisterThread", which was a misleading name because
  3620. not all threads need to register with fastMalloc -- only secondary threads
  3621. need to, and only for the purpose of disabling its single-threaded optimization.
  3622. (2) Use the pageheap_lock instead of a custom one, since we need to synchronize
  3623. with the read of isMultiThreaded inside CreateCacheIfNecessary. This is a new
  3624. requirement, now that we can't guarantee that the first call to CreateCacheIfNecessary
  3625. will occur on the main thread at init time, before any other threads have been created.
  3626. (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  3627. (WTF::do_malloc): Reverted WTF change only to call GetCache() if size <= kMaxSize.
  3628. The WTF code would read phinited without holding the pageheap_lock, which
  3629. seemed like a race condition. Regardless, calling GetCache reduces the number
  3630. of code paths to module initialization, which will help in writing the
  3631. final fix for this bug.
  3632. 2007-01-28 David Kilzer <ddkilzer@webkit.org>
  3633. Reviewed by Darin.
  3634. - fix http://bugs.webkit.org/show_bug.cgi?id=9815
  3635. JavaScript TypeError loading Dean Edwards' JS compressor/obfuscator
  3636. Creating a function using 'new Function()' was not setting its prototype with the
  3637. same flags as 'function() { }'.
  3638. Test: fast/js/function-prototype.html
  3639. * kjs/function_object.cpp:
  3640. (FunctionObjectImp::construct): Change flags from DontEnum|DontDelete|ReadOnly to
  3641. Internal|DontDelete to match FuncDeclNode::processFuncDecl() and
  3642. FuncExprNode::evaluate() in kjs/nodes.cpp.
  3643. 2007-01-27 Geoffrey Garen <ggaren@apple.com>
  3644. Reviewed by Beth Dakin.
  3645. Added some missing JSLocks, which might fix <rdar://problem/4889707>.
  3646. We need to lock whenever we might allocate memory because our FastMalloc
  3647. implementation requires clients to register their threads, which we do
  3648. through JSLock.
  3649. We also need to lock whenever modifying ref-counts because they're not
  3650. thread-safe.
  3651. * API/JSObjectRef.cpp:
  3652. (JSClassCreate): Allocates memory
  3653. (JSClassRetain): Modifies a ref-count
  3654. (JSClassRelease): Modifies a ref-count
  3655. (JSPropertyNameArrayRetain): Modifies a ref-count
  3656. (JSPropertyNameArrayRelease): Modifies a ref-count
  3657. * API/JSStringRef.cpp:
  3658. (JSStringRetain): Modifies a ref-count
  3659. * API/JSValueRef.cpp:
  3660. (JSValueIsInstanceOfConstructor): Might allocate memory if an exception
  3661. is thrown.
  3662. 2007-01-27 Lars Knoll <lars@trolltech.com>
  3663. Fix the Qt build.
  3664. * bindings/qt/qt_instance.h:
  3665. 2007-01-25 Geoffrey Garen <ggaren@apple.com>
  3666. Reviewed by Maciej Stachowiak.
  3667. Fixed <rdar://problem/4608404> WebScriptObject's _rootObject lack
  3668. of ownership policy causes crashes (e.g., in Dashcode)
  3669. The old model for RootObject ownership was either to (1) leak them or (2) assign
  3670. them to a single owner -- the WebCore::Frame -- which would destroy them
  3671. when it believed that all of its plug-ins had unloaded.
  3672. This model was broken because of (1) and also because plug-ins are not the only
  3673. RootObject clients. All Bindings clients are RootObjects clients, including
  3674. applications, which outlive any particular WebCore::Frame.
  3675. The new model for RootObject ownership is to reference-count them, with a
  3676. throw-back to the old model: The WebCore::Frame tracks the RootObjects
  3677. it creates, and invalidates them when it believes that all of its plug-ins
  3678. have unloaded.
  3679. We maintain this throw-back to avoid plug-in leaks, particularly from Java.
  3680. Java is completely broken when it comes to releasing JavaScript objects.
  3681. Comments in our code allege that Java does not always call finalize when
  3682. collecting objects. Moreoever, my own testing reveals that, when Java does
  3683. notify JavaScript of a finalize, the data it provides is totally bogus.
  3684. This setup is far from ideal, but I don't think we can do better without
  3685. completely rewriting the bindings code, and possibly part of the Java
  3686. plug-in / VM.
  3687. Layout tests pass. No additional leaks reported. WebCore/manual-tests/*liveconnect*
  3688. and a few LiveConnect demos on the web also run without a hitch.
  3689. const RootObject* => RootObject*, since we need to ref/deref
  3690. * bindings/NP_jsobject.cpp:
  3691. (jsDeallocate): deref our RootObjects. Also unprotect or JSObject, instead
  3692. of just relying on the RootObject to do it for us when it's invalidated.
  3693. (_isSafeScript): Check RootObject validity.
  3694. (_NPN_CreateScriptObject): ditto
  3695. (_NPN_Invoke): ditto
  3696. (_NPN_Evaluate): ditto
  3697. (_NPN_GetProperty): ditto
  3698. (_NPN_SetProperty): ditto
  3699. (_NPN_RemoveProperty): ditto
  3700. (_NPN_HasProperty): ditto
  3701. (_NPN_HasMethod): ditto
  3702. (_NPN_SetException): ditto
  3703. * bindings/runtime_root.cpp:
  3704. Revived bit-rotted LIAR LIAR LIAR comment.
  3705. LOOK: Added support for invalidating RootObjects without deleting them,
  3706. which is the main goal of this patch.
  3707. Moved protect counting into the RootObject class, to emphasize that
  3708. the RootObject protects the JSObject, and unprotects it upon being invalidated.
  3709. addNativeReference => RootObject::gcProtect
  3710. removeNativeReference => RootObject::gcUnprotect
  3711. ProtectCountSet::contains => RootObject::gcIsProtected
  3712. I know we'll all be sad to see the word "native" go.
  3713. * bindings/runtime_root.h: Added ref-counting support to RootObject, with
  3714. all the standard accoutrements.
  3715. * bindings/c/c_utility.cpp:
  3716. (KJS::Bindings::convertValueToNPVariant): If we can't find a valid RootObject,
  3717. return void instead of just leaking.
  3718. * bindings/jni/jni_instance.cpp:
  3719. (JavaInstance::JavaInstance): Don't take a RootObject in our constructor;
  3720. be like other Instances and require the caller to call setRootObject. This
  3721. reduces the number of ownership code paths.
  3722. (JavaInstance::invokeMethod): Check RootObject for validity.
  3723. * bindings/jni/jni_instance.h: Removed private no-arg constructor. Having
  3724. an arg constructor accomplishes the same thing.
  3725. * bindings/jni/jni_jsobject.cpp:
  3726. (JavaJSObject::invoke): No need to call findProtectCountSet, because finalize()
  3727. checks for RootObject validity.
  3728. (JavaJSObject::JavaJSObject): check RootObject for validity
  3729. (JavaJSObject::call): ditto
  3730. (JavaJSObject::eval): ditto
  3731. (JavaJSObject::getMember): ditto
  3732. (JavaJSObject::setMember): ditto
  3733. (JavaJSObject::removeMember): ditto
  3734. (JavaJSObject::getSlot): ditto
  3735. (JavaJSObject::setSlot): ditto
  3736. (JavaJSObject::toString): ditto
  3737. (JavaJSObject::finalize): ditto
  3738. (JavaJSObject::createNative): No need to tell the RootObject to protect
  3739. the global object, since the RootObject already owns the interpreter.
  3740. * bindings/jni/jni_runtime.cpp:
  3741. (JavaArray::JavaArray): Removed copy construcutor becaue it was unused.
  3742. Dead code is dangerous code.
  3743. * bindings/objc/objc_runtime.mm: Added WebUndefined protocol. Previous use
  3744. of WebScriptObject was bogus, because WebUndefined is not a subclass of
  3745. WebScriptObject.
  3746. (convertValueToObjcObject): If we can't find a valid RootObject,
  3747. return nil instead of just leaking.
  3748. * bindings/objc/objc_utility.mm:
  3749. (KJS::Bindings::convertValueToObjcValue): If we can't find a valid RootObject,
  3750. return nil instead of just leaking.
  3751. 2007-01-27 Andrew Wellington <proton@wiretapped.net>
  3752. Reviewed by Maciej.
  3753. Fix for Repeated string concatenation results in OOM crash
  3754. http://bugs.webkit.org/show_bug.cgi?id=11131
  3755. * kjs/operations.cpp:
  3756. (KJS::add): Throw exception if string addition result is null
  3757. * kjs/ustring.cpp:
  3758. (KJS::UString::UString): Don't call memcpy when malloc failed
  3759. 2007-01-25 Jan Kraemer <camel@gmx.de>
  3760. Reviewed by Maciej
  3761. Fix for http://bugs.webkit.org/show_bug.cgi?id=12382
  3762. Fix crash on architectures with 32 bit ints and
  3763. 64 bit longs (For example Linux on AMD64)
  3764. * kjs/dtoa.cpp: #define Long int as suggested in comment
  3765. 2007-01-24 Geoffrey Garen <ggaren@apple.com>
  3766. Fixed up #include order for style. No review necessary.
  3767. * API/JSStringRef.cpp:
  3768. 2007-01-24 Geoffrey Garen <ggaren@apple.com>
  3769. Reviewed by Maciej Stachowiak.
  3770. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  3771. Copy JSStringRefCF, in case anybody wants to use it. (I just added
  3772. it recently.)
  3773. 2007-01-24 Maciej Stachowiak <mjs@apple.com>
  3774. Not reviewed, trivial property change.
  3775. * JavaScriptCore.vcproj/JavaScriptCore.sln: remove svn:mime-type
  3776. property which made this binary.
  3777. 2007-01-25 Mark Rowe <mrowe@apple.com>
  3778. Reviewed by Darin.
  3779. * Info.plist: Update copyright string.
  3780. 2007-01-24 Darin Adler <darin@apple.com>
  3781. Reviewed by Mark Rowe.
  3782. * JavaScriptCore.xcodeproj/project.pbxproj: Changed to /usr/sbin/sysctl
  3783. so we don't rely on people's paths.
  3784. 2007-01-23 Alice Liu <alice.liu@apple.com>
  3785. release build fix
  3786. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  3787. Copy APICasts.h
  3788. 2007-01-23 Geoffrey Garen <ggaren@apple.com>
  3789. build fix
  3790. * API/JSStringRef.h:
  3791. * JavaScriptCore.xcodeproj/project.pbxproj:
  3792. 2007-01-24 Mark Rowe <mrowe@apple.com>
  3793. Build fix for DumpRenderTree.
  3794. * JavaScriptCore.xcodeproj/project.pbxproj: Make JSStringRefCF.h public so it's copied into built framework.
  3795. 2007-01-23 Anders Carlsson <acarlsson@apple.com>
  3796. Reviewed by Darin.
  3797. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  3798. Copy APICasts.h
  3799. 2007-01-23 Geoffrey Garen <ggaren@apple.com>
  3800. Reviewed by Maciej Stachowiak.
  3801. Fixed <rdar://problem/4885131> Move CFString function declarations from
  3802. JSStringRef.h to JSStringRefCF.h
  3803. Also removed remaining API FIXMEs and changed them into Radars.
  3804. * API/JSClassRef.cpp:
  3805. (OpaqueJSClass::OpaqueJSClass): Added Radar numbers for UTF8 conversion.
  3806. * API/JSContextRef.cpp:
  3807. (JSGlobalContextCreate): Replaced FIXME for NULL JSContextRef with Radar number.
  3808. * API/JSObjectRef.h: Removed FIXME, which is unprofessional in a public header.
  3809. * API/JSStringRef.cpp: Moved CF related implementations to JSStringRefCF.cpp.
  3810. (JSStringCreateWithUTF8CString): Replaced FIXME with Radar number.
  3811. * API/JSStringRef.h: Moved CF related declarations to JSStringRefCF.h. Added
  3812. #include of JSStringRefCF.h as a stopgap until clients start #including
  3813. it as needed by themselves.
  3814. * API/JSStringRefCF.cpp: Added.
  3815. (JSStringCreateWithCFString):
  3816. (JSStringCopyCFString): Replaced JSChar cast with UniChar cast, which is
  3817. more appropriate for a CF call.
  3818. * API/JSStringRefCF.h: Added.
  3819. * JavaScriptCore.xcodeproj/project.pbxproj:
  3820. 2007-01-18 Sanjay Madhav <sanjay12@gmail.com>
  3821. Reviewed by Darin.
  3822. Add JavaScriptCore define to help with tracing of when objects are marked.
  3823. * kjs/object.cpp:
  3824. (KJS::JSObject::mark):
  3825. 2007-01-18 Simon Hausmann <hausmann@kde.org>
  3826. Reviewed by Zack.
  3827. * JavaScriptCore.pro: Remove generated files on make clean.
  3828. * pcre/pcre.pri:
  3829. 2007-01-16 Alexey Proskuryakov <ap@webkit.org>
  3830. Reviewed by Maciej.
  3831. http://bugs.webkit.org/show_bug.cgi?id=12268
  3832. Give object prototypes their own names
  3833. * kjs/lookup.h: Append "Prototype" to ClassName in KJS_IMPLEMENT_PROTOTYPE.
  3834. 2007-01-16 Geoffrey Garen <ggaren@apple.com>
  3835. Reviewed by Darin Adler.
  3836. Added re-entrency checking to GC allocation and collection. It is an error
  3837. to allocate or collect from within a collection. We've had at least one
  3838. case of each bug in the past.
  3839. Added a comment to the API header, explaining that API clients must not
  3840. make this mistake, either.
  3841. Layout tests and JS tests pass.
  3842. * API/JSObjectRef.h:
  3843. * kjs/collector.cpp:
  3844. (KJS::GCLock::GCLock):
  3845. (KJS::GCLock::~GCLock):
  3846. (KJS::Collector::allocate):
  3847. (KJS::Collector::collect):
  3848. 2007-01-14 Mark Rowe <mrowe@apple.com>
  3849. Reviewed by Mitz.
  3850. Minor fixes to JavaScript pretty-printing.
  3851. * JavaScriptCore.exp:
  3852. * kjs/Parser.cpp:
  3853. (KJS::Parser::prettyPrint): Return line number and error message if parsing fails.
  3854. * kjs/Parser.h:
  3855. * kjs/nodes2string.cpp:
  3856. (ElementNode::streamTo): Include comma delimiters in array literals.
  3857. (PropertyNameNode::streamTo): Quote property names in object literals to handle the case when the property name is not a valid identifier.
  3858. * kjs/testkjs.cpp:
  3859. (doIt): Print any errors encountered while pretty-printing.
  3860. 2007-01-12 Anders Carlsson <acarlsson@apple.com>
  3861. Reviewed by Darin.
  3862. * wtf/HashTraits.h:
  3863. Add hash traits for unsigned long and unsigned long long.
  3864. 2007-01-12 Geoffrey Garen <ggaren@apple.com>
  3865. RS by Brady Eidson.
  3866. Rolling back in r18786 with leaks fixed, and these renames slightly reworked:
  3867. Because they can return 0:
  3868. rootObjectForImp => findRootObject (overloaded for JSObject* and Interpreter*)
  3869. rootObjectForInterpreter => findRootObject (ditto)
  3870. findReferenceSet => findProtectCountSet
  3871. 2007-01-11 Geoffrey Garen <ggaren@apple.com>
  3872. RS by Brady Eidson.
  3873. Rolling out r18786 because it caused leaks.
  3874. 2007-01-11 Geoffrey Garen <ggaren@apple.com>
  3875. Reviewed by Anders Carlsson.
  3876. Even more cleanup in preparation for fixing <rdar://problem/4608404>
  3877. WebScriptObject's _executionContext lack of ownership policy causes
  3878. crashes (e.g., in Dashcode)
  3879. Layout tests pass.
  3880. Renames:
  3881. ReferencesSet | ProtectCounts => ProtectCountSet (because it's a typename for a set of GC protect counts)
  3882. ReferencesByRootMap => RootObjectMap (because RootObjectToProtectCountSetMap would have been confusing)
  3883. pv => protectedValues
  3884. rootObjectForImp => getRootObject (overloaded for JSObject* and Interpreter*)
  3885. rootObjectForInterpreter => getRootObject (ditto)
  3886. findReferenceSet => getProtectCountSet
  3887. imp => jsObject
  3888. (KJS::Bindings::getRootObjectMap): Changed to take advantage of built-in
  3889. facility for initializing static variables.
  3890. (KJS::Bindings::getProtectCountSet):
  3891. (KJS::Bindings::destroyProtectCountSet): Added. Helps encapsulate the fact
  3892. that getting a ProtectCountSet entails adding a RootObject to a hash table,
  3893. and destroying one entails the reverse.
  3894. (KJS::Bindings::getRootObject): Removed spurious NULL check.
  3895. (KJS::Bindings::findReferenceSet): Renamed. Changed to use getRootObject()
  3896. instead of iterating on its own.
  3897. (KJS::Bindings::addNativeReference): Changed to use an early return instead
  3898. of indenting the whole function.
  3899. (KJS::Bindings::removeNativeReference): Ditto.
  3900. 2007-01-11 Geoffrey Garen <ggaren@apple.com>
  3901. Reviewed by Anders Carlsson.
  3902. Even more cleanup in preparation for fixing <rdar://problem/4608404>
  3903. WebScriptObject's _executionContext lack of ownership policy causes
  3904. crashes (e.g., in Dashcode)
  3905. Layout tests pass.
  3906. Renames:
  3907. findRootObjectForNativeHandleFunction => createRootObject
  3908. FindRootObjectForNativeHandleFunctionPtr => CreateRootObjectFunction
  3909. Also removed unnecessary use of "Bindings::" prefix.
  3910. * JavaScriptCore.exp:
  3911. * bindings/jni/jni_jsobject.cpp:
  3912. (JavaJSObject::createNative):
  3913. (JavaJSObject::convertValueToJObject):
  3914. (JavaJSObject::convertJObjectToValue):
  3915. * bindings/runtime_root.cpp:
  3916. (KJS::Bindings::RootObject::setCreateRootObject):
  3917. * bindings/runtime_root.h:
  3918. (KJS::Bindings::RootObject::createRootObject):
  3919. 2007-01-11 George Staikos <staikos@kde.org>
  3920. Reviewed by Maciej
  3921. Appears to be Mac specific right now.
  3922. * kjs/config.h:
  3923. 2007-01-10 Lars Knoll <lars@trolltech.com>
  3924. Reviewed by Zack
  3925. Use the new functionality in Qt 4.3, to make
  3926. the methods closer compliant with the Unicode
  3927. spec.
  3928. Keep the old code so that it still compiles against
  3929. Qt 4.2.
  3930. * wtf/unicode/qt4/UnicodeQt4.h:
  3931. (WTF::Unicode::toLower):
  3932. (WTF::Unicode::toUpper):
  3933. (WTF::Unicode::toTitleCase):
  3934. (WTF::Unicode::foldCase):
  3935. (WTF::Unicode::isFormatChar):
  3936. (WTF::Unicode::isPrintableChar):
  3937. (WTF::Unicode::isSeparatorSpace):
  3938. (WTF::Unicode::isPunct):
  3939. (WTF::Unicode::isDigit):
  3940. (WTF::Unicode::isLower):
  3941. (WTF::Unicode::isUpper):
  3942. (WTF::Unicode::digitValue):
  3943. (WTF::Unicode::mirroredChar):
  3944. (WTF::Unicode::combiningClass):
  3945. (WTF::Unicode::decompositionType):
  3946. (WTF::Unicode::umemcasecmp):
  3947. (WTF::Unicode::direction):
  3948. (WTF::Unicode::category):
  3949. 2007-01-09 Darin Adler <darin@apple.com>
  3950. - update 2007 Apple copyright for the new company name
  3951. * kjs/DateMath.cpp:
  3952. 2007-01-09 Darin Adler <darin@apple.com>
  3953. - fix build
  3954. * kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):
  3955. Actually compile it this time.
  3956. 2007-01-09 Darin Adler <darin@apple.com>
  3957. - fix build
  3958. * kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):
  3959. Change types.
  3960. 2007-01-09 Darin Adler <darin@apple.com>
  3961. - fix build on platforms where Unicode::UChar is != uint16_t
  3962. * kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):
  3963. Change types.
  3964. 2007-01-09 Mitz Pettel <mitz@webkit.org>
  3965. Reviewed by Darin.
  3966. - changes for http://bugs.webkit.org/show_bug.cgi?id=11078
  3967. Forms Don't Submit (ASP Pages)
  3968. * JavaScriptCore.exp:
  3969. * kjs/value.cpp:
  3970. (KJS::JSValue::toInt32): Folded toInt32Inline into this method, which was its
  3971. only caller.
  3972. (KJS::JSValue::toUInt32): Added a variant that reports if the conversion has
  3973. succeeded.
  3974. * kjs/value.h:
  3975. 2007-01-09 Darin Adler <darin@apple.com>
  3976. Reviewed by Maciej.
  3977. - fix http://bugs.webkit.org/show_bug.cgi?id=12174
  3978. improve Unicode use (less WTF::Unicode:: prefix, centralized character names)
  3979. * wtf/unicode/icu/UnicodeIcu.h: Change parameter and return types
  3980. to UChar32 and UChar. Removed unneeded type casts and added some
  3981. const to functions that lacked it. Removed WTF::Unicode::memcmp.
  3982. (WTF::Unicode::umemcasecmp): Renamed from strcasecmp since this
  3983. doesn't work on 0-terminated strings as the str functions do.
  3984. * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
  3985. - got rid of namespace prefixes from most uses of WTF::Unicode
  3986. * kjs/function.cpp:
  3987. (KJS::isStrWhiteSpace):
  3988. (KJS::escapeStringForPrettyPrinting):
  3989. * kjs/lexer.cpp:
  3990. (KJS::Lexer::isWhiteSpace):
  3991. (KJS::Lexer::isIdentStart):
  3992. (KJS::Lexer::isIdentPart):
  3993. * kjs/string_object.cpp:
  3994. (KJS::StringProtoFunc::callAsFunction):
  3995. 2007-01-07 David Kilzer <ddkilzer@webkit.org>
  3996. Reviewed by Darin.
  3997. - fix http://bugs.webkit.org/show_bug.cgi?id=11917
  3998. setlocale() can return null
  3999. * kjs/date_object.cpp:
  4000. (KJS::DateProtoFunc::callAsFunction): Removed dead code.
  4001. 2007-01-07 David Carson <dacarson@gmail.com>
  4002. Reviewed by Darin.
  4003. - fix http://bugs.webkit.org/show_bug.cgi?id=12100
  4004. JNI bindings should be available to non-Mac platforms that have JNI
  4005. Change JNI so that it is not wrapped in the PLATFORM(MAC) ifdef, enabling
  4006. other platforms who have JNI to use it.
  4007. * bindings/jni/jni_instance.h:
  4008. Removed unnecessary include of <CoreFoundation/CoreFoundation.h>
  4009. * bindings/jni/jni_utility.cpp:
  4010. (KJS::Bindings::setJavaVM):
  4011. * bindings/jni/jni_utility.h:
  4012. Added new method for clients to set the JavaVM
  4013. * bindings/runtime.cpp:
  4014. (KJS::Bindings::Instance::createBindingForLanguageInstance):
  4015. Changed code to utilize new #if HAVE(JNI)
  4016. * kjs/config.h:
  4017. Added new #define for JNI, ie HAVE_JNI
  4018. 2007-01-07 David Carson <dacarson@gmail.com>
  4019. Reviewed by Darin.
  4020. Fix http://bugs.webkit.org/show_bug.cgi?id=11431
  4021. ARM platform has some byte alignment issues
  4022. Fix for NaN being 4 bytes and it must start on a byte boundary
  4023. for ARM architectures.
  4024. * kjs/fpconst.cpp:
  4025. (KJS::):
  4026. 2007-01-04 David Kilzer <ddkilzer@webkit.org>
  4027. Reviewed by Kevin McCullough.
  4028. - fix http://bugs.webkit.org/show_bug.cgi?id=12070
  4029. REGRESSION: KJS::getUTCOffset() caches UTC offset but ignores time zone changes
  4030. * kjs/DateMath.cpp:
  4031. (KJS::getUTCOffset): Don't cache UTC offset.
  4032. 2007-01-02 Darin Adler <darin@apple.com>
  4033. - minor tweak (hope this doesn't re-break Windows)
  4034. * pcre/pcre_compile.c: Removed use of const pcre_uchar const * -- Mitz probably
  4035. meant const pcre_uchar *const, but I think we can do without the explicit const here.
  4036. * pcre/pcre_internal.h: Re-enabled warning C4114.
  4037. 2007-01-02 David Kilzer <ddkilzer@webkit.org>
  4038. Reviewed by NOBODY (Windows build fix).
  4039. The MSVC compiler requires variables to be declared at the top of the enclosing block in C source.
  4040. Disable this warning to prevent MSVC from complaining about the 'const pcre_uchar const *' type:
  4041. warning C4114: same type qualifier used more than once
  4042. * pcre/pcre_compile.c:
  4043. (pcre_compile2): Moved variable declarations to top of their respective enclosing blocks.
  4044. * pcre/pcre_internal.h: Added pragma to disable compiler warning.
  4045. 2007-01-01 Mitz Pettel <mitz@webkit.org>
  4046. Reviewed by Darin.
  4047. - fix http://bugs.webkit.org/show_bug.cgi?id=11849
  4048. REGRESSION (r18182): Google Calendar is broken (a regular expression containing a null character is not parsed correctly)
  4049. Modified pcre_compile() (and the functions that it calls) to work with patterns
  4050. containing null characters.
  4051. Covered by JavaScriptCore tests ecma_3/RegExp/octal-002.js and ecma_3/RegExp/regress-85721.js
  4052. * kjs/regexp.cpp:
  4053. (KJS::RegExp::RegExp): Changed to not null-terminate the pattern string and instead
  4054. pass its length to pcre_compile.
  4055. * pcre/pcre.h:
  4056. * pcre/pcre_compile.c:
  4057. (check_escape):
  4058. (get_ucp):
  4059. (is_counted_repeat):
  4060. (check_posix_syntax):
  4061. (compile_branch):
  4062. (compile_regex):
  4063. (pcre_compile): Added a parameter specifying the length of the pattern, which
  4064. is no longer required to be null-terminated and may contain null characters.
  4065. (pcre_compile2):
  4066. * pcre/pcre_internal.h:
  4067. * tests/mozilla/expected.html: Updated for the two tests that this patch
  4068. fixes. Also updated failing results for ecma_3/RegExp/regress-100199.js
  4069. which were not updated after bug 6257 was fixed.
  4070. 2007-01-01 David Kilzer <ddkilzer@webkit.org>
  4071. Reviewed by Darin.
  4072. - fix http://bugs.webkit.org/show_bug.cgi?id=12057
  4073. REGRESSION: JavaScript Date Is One Day In The Future in GMT time zone
  4074. Because Mac OS X returns geographically and historically accurate time zone information,
  4075. converting Jan 02, 1970 12:00:00 AM to local time then subtracting 24 hours did not work
  4076. in GMT (London - England) since it was in BST (+0100) all year in 1970[1]. Instead, the
  4077. UTC offset is calculated by converting Jan 01, 2000 12:00:00 AM to local time then
  4078. subtracting that from the same date in UTC.
  4079. [1] http://en.wikipedia.org/wiki/British_Summer_Time
  4080. * kjs/DateMath.cpp:
  4081. (KJS::getUTCOffset): Updated UTC offset calculation.
  4082. (KJS::getDSTOffset): Improved comment.
  4083. 2006-12-31 David Kilzer <ddkilzer@webkit.org>
  4084. Reviewed by Geoff.
  4085. Update embedded pcre library from version 6.2 to 6.4. Changes from pcre 6.2 to 6.3
  4086. did not include any files in JavaScriptCore/pcre.
  4087. All changes include renaming EXPORT to PCRE_EXPORT, renaming of ucp_findchar() to
  4088. _pcre_ucp_findchar(), or comment changes. Additional changes noted below.
  4089. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated source file list.
  4090. * JavaScriptCore.xcodeproj/project.pbxproj: Renamed pcre_printint.c to pcre_printint.src
  4091. and changed it from a source file to a header file.
  4092. * JavaScriptCoreSources.bkl: Updated source file list.
  4093. * pcre/CMakeLists.txt: Updated source file list.
  4094. * pcre/pcre-config.h:
  4095. * pcre/pcre.h: Updated version.
  4096. * pcre/pcre.pri: Updated source file list.
  4097. * pcre/pcre_compile.c: Include pcre_printint.src #if DEBUG.
  4098. (pcre_compile2):
  4099. * pcre/pcre_config.c:
  4100. * pcre/pcre_exec.c:
  4101. (match):
  4102. * pcre/pcre_fullinfo.c:
  4103. * pcre/pcre_info.c:
  4104. * pcre/pcre_internal.h: Added header guard. Removed export of _pcre_printint().
  4105. * pcre/pcre_ord2utf8.c:
  4106. * pcre/pcre_printint.c: Renamed to pcre_printint.src.
  4107. * pcre/pcre_printint.src: Added. Renamed _pcre_printint() to pcre_printint().
  4108. * pcre/pcre_refcount.c:
  4109. * pcre/pcre_study.c:
  4110. * pcre/pcre_tables.c:
  4111. * pcre/pcre_try_flipped.c:
  4112. * pcre/pcre_ucp_findchar.c: Added contents of ucp_findchar.c.
  4113. * pcre/pcre_version.c:
  4114. * pcre/pcre_xclass.c:
  4115. (_pcre_xclass):
  4116. * pcre/ucp.h: Removed export of ucp_findchar().
  4117. * pcre/ucp_findchar.c: Removed. Contents moved to pcre_ucp_findchar.c.
  4118. 2006-12-29 David Kilzer <ddkilzer@webkit.org>
  4119. Reviewed by Geoff.
  4120. Update embedded pcre library from version 6.1 to 6.2. From the pcre ChangeLog:
  4121. 3. Added "b" to the 2nd argument of fopen() in dftables.c, for non-Unix-like
  4122. operating environments where this matters.
  4123. 5. Named capturing subpatterns were not being correctly counted when a pattern
  4124. was compiled. This caused two problems: (a) If there were more than 100
  4125. such subpatterns, the calculation of the memory needed for the whole
  4126. compiled pattern went wrong, leading to an overflow error. (b) Numerical
  4127. back references of the form \12, where the number was greater than 9, were
  4128. not recognized as back references, even though there were sufficient
  4129. previous subpatterns.
  4130. * pcre/dftables.c: Item 3.
  4131. (main):
  4132. * pcre/pcre.h: Updated version.
  4133. * pcre/pcre_compile.c: Item 5.
  4134. (read_repeat_counts):
  4135. (pcre_compile2):
  4136. 2006-12-29 Geoffrey Garen <ggaren@apple.com>
  4137. Reviewed by Brian Dash... err... Mark Rowe.
  4138. More cleanup in preparation for fixing <rdar://problem/4608404>
  4139. WebScriptObject's _executionContext lack of ownership policy causes
  4140. crashes (e.g., in Dashcode)
  4141. The key change here is to RootObject::RootObject().
  4142. * JavaScriptCore.exp:
  4143. * bindings/c/c_utility.cpp:
  4144. (KJS::Bindings::convertValueToNPVariant): Changed to use new constructor.
  4145. * bindings/jni/jni_jsobject.cpp:
  4146. (JavaJSObject::createNative): Changed to use new constructor. Replaced
  4147. large 'if' followed by default condition with "if !" and explicit default
  4148. condition.
  4149. * bindings/objc/objc_runtime.mm:
  4150. (convertValueToObjcObject): Changed to use new constructor.
  4151. * bindings/runtime_root.cpp:
  4152. (KJS::Bindings::RootObject::destroy): "removeAllNativeReferences" => "destroy"
  4153. because this function actually destroys the RootObject.
  4154. * bindings/runtime_root.h: Changed Interpreter* to RefPtr<Interpreter>
  4155. to prevent a RootObject from holding a stale Interperter*.
  4156. (KJS::Bindings::RootObject::RootObject): Changed constructor to take an
  4157. Interpreter*, since it's pointless to create a RootObject without one.
  4158. Removed setRootObjectImp() and rootObjectImp() because they were just
  4159. a confusing way of setting and getting the Interpreter's global object.
  4160. (KJS::Bindings::RootObject::nativeHandle): "_nativeHandle" => "m_nativeHandle"
  4161. (KJS::Bindings::RootObject::interpreter): "_interpreter" => "m_interpreter"
  4162. 2006-12-28 George Staikos <staikos@kde.org>
  4163. Reviewed by Olliej.
  4164. * bindings/qt/qt_instance.cpp: build
  4165. (KJS::Bindings::QtInstance::QtInstance):
  4166. 2006-12-28 Geoffrey Garen <ggaren@apple.com>
  4167. Reviewed by Oliver Hunt.
  4168. More cleanup. Layout tests pass.
  4169. Use a helper function to initialize and access WebUndefined and WebScriptObject.
  4170. * bindings/objc/objc_runtime.h:
  4171. * bindings/objc/objc_runtime.mm:
  4172. (KJS::Bindings::webScriptObjectClass):
  4173. (KJS::Bindings::webUndefinedClass):
  4174. (convertValueToObjcObject):
  4175. * bindings/objc/objc_utility.mm:
  4176. (KJS::Bindings::convertValueToObjcValue):
  4177. (KJS::Bindings::convertObjcValueToValue):
  4178. 2006-12-28 Geoffrey Garen <ggaren@apple.com>
  4179. Reviewed by Brady Eidson.
  4180. Some cleanup in preparation for fixing <rdar://problem/4608404>
  4181. WebScriptObject's _executionContext lack of ownership policy causes
  4182. crashes (e.g., in Dashcode)
  4183. I'm just trying to make heads or tails of this baffling code.
  4184. Renamed "root" | "execContext" | "executionContext" => "rootObject", because
  4185. that's the object's (admittedly vague) type name.
  4186. * bindings/runtime.cpp: Removed createLanguageInstanceForValue
  4187. because I'll give you a dollar if you can explain to me what it actually did.
  4188. * bindings/runtime_root.cpp: Put everything in the KJS::Bindings namespace,
  4189. removing the KJS::Bindings prefix from individual functions and datatypes.
  4190. This matches the header and eliminates a lot of syntax cruft.
  4191. * bindings/c/c_utility.cpp:
  4192. (KJS::Bindings::convertValueToNPVariant): Replaced use of createLanguageInstanceForValue
  4193. with call to _NPN_CreateScriptObject because that's what createLanguageInstanceForValue
  4194. actually did (but don't ask me for that dollar now; that's cheating.)
  4195. * bindings/objc/objc_utility.h:
  4196. * bindings/objc/objc_utility.mm:
  4197. (KJS::Bindings::convertValueToObjcValue): Removed. Its only purpose was
  4198. to call a single function for WebKit, which WebKit can do on its own.
  4199. * kjs/interpreter.h: Removed rtti() because it was unused, and this class
  4200. is scheduled for demolition anyway.
  4201. * kjs/interpreter.cpp: Removed createLanguageInstanceForValue because it had
  4202. nothing to do with the Interpreter, and nothing makes Chuck Norris more mad
  4203. than a function whose sole purpose is to call another function of the same
  4204. name. (Really, I asked him.)
  4205. 2006-12-26 Geoffrey Garen <ggaren@apple.com>
  4206. Reviewed by Eric Seidel.
  4207. Some cleanup in preparation for fixing <rdar://problem/4740328> Safari
  4208. crash on quit in _NPN_ReleaseObject from KJS::Bindings::CInstance::~CInstance
  4209. * bindings/c/c_instance.cpp:
  4210. * bindings/c/c_instance.h: Removed unused copy constructor and assignment
  4211. operator. They made tracking data flow more difficult. Unused code is also
  4212. dangerous because it can succumb to bit rot with the stealth of a Ninja.
  4213. Replaced #include with forward declaration to reduce header dependency.
  4214. * bindings/npruntime.cpp: Sorted #includes.
  4215. (_NPN_GetStringIdentifier): Replaced assert with ASSERT.
  4216. (_NPN_GetStringIdentifiers): ditto
  4217. (_NPN_ReleaseVariantValue): ditto
  4218. (_NPN_CreateObject): ditto
  4219. (_NPN_RetainObject): ditto
  4220. (_NPN_ReleaseObject): ditto
  4221. (_NPN_DeallocateObject): ditto
  4222. 2006-12-20 Anders Carlsson <acarlsson@apple.com>
  4223. * kjs/string_object.cpp:
  4224. (localeCompare):
  4225. Another speculative Win32 fix.
  4226. 2006-12-20 Anders Carlsson <acarlsson@apple.com>
  4227. * kjs/string_object.cpp:
  4228. (localeCompare):
  4229. Speculative Win32 fix.
  4230. 2006-12-20 Anders Carlsson <acarlsson@apple.com>
  4231. Reviewed by Darin.
  4232. <rdar://problem/4235733>
  4233. <http://bugs.webkit.org/?show_bug.cgi?id=10193>
  4234. support String.localeCompare.
  4235. Implement localeCompare.
  4236. * JavaScriptCore.xcodeproj/project.pbxproj:
  4237. * kjs/string_object.cpp:
  4238. (localeCompare):
  4239. (StringProtoFunc::callAsFunction):
  4240. * kjs/string_object.h:
  4241. (KJS::StringProtoFunc::):
  4242. 2006-12-20 Timothy Hatcher <timothy@apple.com>
  4243. Reviewed by Mark Rowe.
  4244. * JavaScriptCore.xcodeproj/project.pbxproj: use GCC 4.0 for all the other test targets
  4245. 2006-12-20 Timothy Hatcher <timothy@apple.com>
  4246. Reviewed by Mark Rowe.
  4247. <rdar://problem/4871613> JavaScriptCore-421.31's dftables target needs to override default compiler and use gcc-4.0
  4248. * JavaScriptCore.xcodeproj/project.pbxproj:
  4249. 2006-12-20 Lars Knoll <lars@trolltech.com>
  4250. Reviewed by David Hyatt
  4251. Added support to bind QObject's to
  4252. JavaScript.
  4253. * JavaScriptCore.pro:
  4254. * bindings/qt/qt_class.cpp: Added.
  4255. (KJS::Bindings::QtClass::QtClass):
  4256. (KJS::Bindings::QtClass::~QtClass):
  4257. (KJS::Bindings::QtClass::classForObject):
  4258. (KJS::Bindings::QtClass::name):
  4259. (KJS::Bindings::QtClass::methodsNamed):
  4260. (KJS::Bindings::QtClass::fieldNamed):
  4261. * bindings/qt/qt_class.h: Added.
  4262. (KJS::Bindings::QtClass::constructorAt):
  4263. (KJS::Bindings::QtClass::numConstructors):
  4264. * bindings/qt/qt_instance.cpp: Added.
  4265. (KJS::Bindings::QtInstance::QtInstance):
  4266. (KJS::Bindings::QtInstance::~QtInstance):
  4267. (KJS::Bindings::QtInstance::operator=):
  4268. (KJS::Bindings::QtInstance::getClass):
  4269. (KJS::Bindings::QtInstance::begin):
  4270. (KJS::Bindings::QtInstance::end):
  4271. (KJS::Bindings::QtInstance::implementsCall):
  4272. (KJS::Bindings::QtInstance::invokeMethod):
  4273. (KJS::Bindings::QtInstance::invokeDefaultMethod):
  4274. (KJS::Bindings::QtInstance::defaultValue):
  4275. (KJS::Bindings::QtInstance::stringValue):
  4276. (KJS::Bindings::QtInstance::numberValue):
  4277. (KJS::Bindings::QtInstance::booleanValue):
  4278. (KJS::Bindings::QtInstance::valueOf):
  4279. * bindings/qt/qt_instance.h: Added.
  4280. (KJS::Bindings::QtInstance::getObject):
  4281. * bindings/qt/qt_runtime.cpp: Added.
  4282. (KJS::Bindings::convertValueToQVariant):
  4283. (KJS::Bindings::convertQVariantToValue):
  4284. (KJS::Bindings::QtField::name):
  4285. (KJS::Bindings::QtField::valueFromInstance):
  4286. (KJS::Bindings::QtField::setValueToInstance):
  4287. * bindings/qt/qt_runtime.h: Added.
  4288. (KJS::Bindings::QtField::QtField):
  4289. (KJS::Bindings::QtField::type):
  4290. (KJS::Bindings::QtMethod::QtMethod):
  4291. (KJS::Bindings::QtMethod::name):
  4292. (KJS::Bindings::QtMethod::numParameters):
  4293. * bindings/runtime.cpp:
  4294. (KJS::Bindings::Instance::createBindingForLanguageInstance):
  4295. * bindings/runtime.h:
  4296. (KJS::Bindings::Instance::):
  4297. * bindings/testbindings.pro: Added.
  4298. * bindings/testqtbindings.cpp: Added.
  4299. (MyObject::MyObject):
  4300. (MyObject::setTestString):
  4301. (MyObject::setTestInt):
  4302. (MyObject::testString):
  4303. (MyObject::testInt):
  4304. (MyObject::foo):
  4305. (Global::className):
  4306. (main):
  4307. 2006-12-19 Anders Carlsson <acarlsson@apple.com>
  4308. Reviewed by Geoff.
  4309. Add -p option to testkjs which pretty prints the files instead of executing them.
  4310. * JavaScriptCore.exp:
  4311. * JavaScriptCore.xcodeproj/project.pbxproj:
  4312. * kjs/Parser.cpp:
  4313. (KJS::Parser::prettyPrint):
  4314. * kjs/Parser.h:
  4315. * kjs/testkjs.cpp:
  4316. (doIt):
  4317. 2006-12-19 Brady Eidson <beidson@apple.com>
  4318. Rubberstamped by Lou
  4319. Removed unneccessary "else"
  4320. * wtf/Assertions.cpp:
  4321. 2006-12-19 Timothy Hatcher <timothy@apple.com>
  4322. Reviewed by Darin.
  4323. <rdar://problem/4891774> Local WebCore/WebBrowser builds fail in 9A328 due to warning about ObjC-2.0 language features
  4324. * JavaScriptCore.xcodeproj/project.pbxproj:
  4325. 2006-12-17 Simon Hausmann <hausmann@kde.org>
  4326. Reviewed by Zack.
  4327. * kjs/testkjs.pro: Oops, make it also build on machines other than
  4328. mine :)
  4329. 2006-12-17 Simon Hausmann <hausmann@kde.org>
  4330. Reviewed by Rob Buis.
  4331. * kjs/testkjs.pro: Added .pro file to build testkjs.
  4332. 2006-12-16 Alexey Proskuryakov <ap@webkit.org>
  4333. Reviewed by Rob.
  4334. A deleted object was accessed to prepare RegExp construction error messages.
  4335. * kjs/regexp_object.cpp:
  4336. (RegExpObjectImp::construct): Wrap the RegExp into an OwnPtr.
  4337. 2006-12-16 Mitz Pettel <mitz@webkit.org>
  4338. Reviewed by Alexey.
  4339. - fix http://bugs.webkit.org/show_bug.cgi?id=11814
  4340. REGRESSION(r18098): Find does not work with capital letters
  4341. Test: editing/execCommand/findString-3.html
  4342. * wtf/unicode/icu/UnicodeIcu.h:
  4343. (WTF::Unicode::foldCase): Changed to not return an error if the result fits
  4344. in the buffer without a null terminator.
  4345. 2006-12-13 Maciej Stachowiak <mjs@apple.com>
  4346. Reviewed by Anders.
  4347. - added equality and inequality operations for HashMap and Vector, useful for comparing more complex types
  4348. * wtf/HashMap.h:
  4349. (WTF::operator==):
  4350. (WTF::operator!=):
  4351. * wtf/Vector.h:
  4352. (WTF::operator==):
  4353. (WTF::operator!=):
  4354. 2006-12-12 Alexey Proskuryakov <ap@webkit.org>
  4355. Reviewed by Geoff. Based on a patch by Maks Orlovich.
  4356. http://bugs.webkit.org/show_bug.cgi?id=6257
  4357. Throw errors on invalid expressions (KJS merge)
  4358. * kjs/regexp.cpp:
  4359. (KJS::RegExp::RegExp):
  4360. (KJS::RegExp::~RegExp):
  4361. (KJS::RegExp::match):
  4362. * kjs/regexp.h:
  4363. (KJS::RegExp::flags):
  4364. (KJS::RegExp::isValid):
  4365. (KJS::RegExp::errorMessage):
  4366. (KJS::RegExp::subPatterns):
  4367. Remember and report RegExp construction failures. Renamed data members not to start with underscores.
  4368. * kjs/regexp_object.cpp:
  4369. (RegExpObjectImp::construct): Raise an exception if RegExp construction fails.
  4370. (RegExpObjectImp::callAsFunction): Removed an obsolete comment.
  4371. * tests/mozilla/ecma_3/RegExp/regress-119909.js: Reduced the number of nested parentheses to
  4372. a value supported by PCRE.
  4373. 2006-12-11 Alexey Proskuryakov <ap@webkit.org>
  4374. Reviewed by Darin.
  4375. http://bugs.webkit.org/show_bug.cgi?id=9673
  4376. Add support for window.atob() and window.btoa()
  4377. * JavaScriptCore.exp: Export UString::is8Bit().
  4378. * JavaScriptCore.xcodeproj/project.pbxproj: Added StringExtras.h as
  4379. a private header.
  4380. 2006-12-11 Darin Adler <darin@apple.com>
  4381. Reviewed by Brady.
  4382. * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode update this
  4383. (I think Hyatt is using an old Xcode).
  4384. 2006-12-11 David Hyatt <hyatt@apple.com>
  4385. Fix the failing layout test. Just remove Unicode::isSpace and
  4386. revert StringImpl to do the same thing it was doing before.
  4387. Reviewed by darin
  4388. * wtf/unicode/icu/UnicodeIcu.h:
  4389. * wtf/unicode/qt4/UnicodeQt4.h:
  4390. 2006-12-09 George Staikos <staikos@kde.org>
  4391. Reviewed by Zack.
  4392. Fix bison again on qmake build.
  4393. * JavaScriptCore.pro:
  4394. 2006-12-09 Lars Knoll <lars@trolltech.com>
  4395. Reviewed by Zack
  4396. Make it possible to build WebKit with qmake.
  4397. * JavaScriptCore.pro: Added.
  4398. * kjs/kjs.pro: Removed.
  4399. * pcre/pcre.pri: Added.
  4400. 2006-12-09 Zack Rusin <zack@kde.org>
  4401. Fixing the compilation with platform kde after the icu changes.
  4402. * CMakeLists.txt:
  4403. 2006-12-09 Adam Roben <aroben@apple.com>
  4404. Reviewed by Darin.
  4405. Some updates in reaction to r18098.
  4406. * wtf/unicode/icu/UnicodeIcu.h: Use !! to convert UBool to bool in all
  4407. cases.
  4408. (WTF::Unicode::toLower):
  4409. (WTF::Unicode::toUpper):
  4410. (WTF::Unicode::isDigit):
  4411. (WTF::Unicode::isSpace):
  4412. (WTF::Unicode::isPunct):
  4413. (WTF::Unicode::isLower):
  4414. (WTF::Unicode::isUpper):
  4415. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  4416. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  4417. 2006-12-09 George Staikos <staikos@kde.org>
  4418. Patch by Lars Knoll, comment out ICU dependency on Qt platform (unused code).
  4419. Reviewed by Darin.
  4420. * bindings/c/c_utility.cpp:
  4421. (KJS::Bindings::convertUTF8ToUTF16):
  4422. 2006-12-08 David Hyatt <hyatt@apple.com>
  4423. Land the new ICU abstraction layer. Patch by Lars.
  4424. Reviewed by me
  4425. * JavaScriptCore.xcodeproj/project.pbxproj:
  4426. * wtf/Platform.h:
  4427. * wtf/unicode/UnicodeCategory.h: Removed.
  4428. * wtf/unicode/UnicodeDecomposition.h: Removed.
  4429. * wtf/unicode/UnicodeDirection.h: Removed.
  4430. * wtf/unicode/icu/UnicodeIcu.h:
  4431. (WTF::Unicode::):
  4432. (WTF::Unicode::foldCase):
  4433. (WTF::Unicode::toLower):
  4434. (WTF::Unicode::toUpper):
  4435. (WTF::Unicode::toTitleCase):
  4436. (WTF::Unicode::isDigit):
  4437. (WTF::Unicode::isSpace):
  4438. (WTF::Unicode::isPunct):
  4439. (WTF::Unicode::mirroredChar):
  4440. (WTF::Unicode::category):
  4441. (WTF::Unicode::direction):
  4442. (WTF::Unicode::isLower):
  4443. (WTF::Unicode::isUpper):
  4444. (WTF::Unicode::digitValue):
  4445. (WTF::Unicode::combiningClass):
  4446. (WTF::Unicode::decompositionType):
  4447. (WTF::Unicode::strcasecmp):
  4448. (WTF::Unicode::memset):
  4449. * wtf/unicode/qt4/UnicodeQt4.cpp: Removed.
  4450. * wtf/unicode/qt4/UnicodeQt4.h:
  4451. (WTF::Unicode::):
  4452. (WTF::Unicode::toLower):
  4453. (WTF::Unicode::toUpper):
  4454. (WTF::Unicode::toTitleCase):
  4455. (WTF::Unicode::foldCase):
  4456. (WTF::Unicode::isPrintableChar):
  4457. (WTF::Unicode::isLower):
  4458. (WTF::Unicode::isUpper):
  4459. (WTF::Unicode::digitValue):
  4460. (WTF::Unicode::combiningClass):
  4461. (WTF::Unicode::decompositionType):
  4462. (WTF::Unicode::strcasecmp):
  4463. (WTF::Unicode::memset):
  4464. (WTF::Unicode::direction):
  4465. (WTF::Unicode::category):
  4466. === Safari-521.32 ===
  4467. 2006-12-08 Adam Roben <aroben@apple.com>
  4468. Reviewed by Anders.
  4469. This is a mo' better fix for ensuring we don't use macro definitions
  4470. of min/max.
  4471. * kjs/config.h:
  4472. * wtf/Vector.h:
  4473. 2006-12-07 Kevin Fyure <digdog@macports.org>
  4474. Reviewed by Darin.
  4475. http://bugs.webkit.org/show_bug.cgi?id=11545
  4476. Disable the testcases do not follow the ECMA-262v3 specification.
  4477. * tests/mozilla/expected.html: Update Results.
  4478. * tests/mozilla/js1_2/String/concat.js:
  4479. 4 tests disabled. The result of concat Array object is not followinig
  4480. ECMA 15.5.4.6
  4481. * tests/mozilla/js1_2/function/Number.js:
  4482. 1 test disabled. The result of Array object to Number object conversion
  4483. is not following ECMA 9.3. And the test was duplicated in
  4484. ecma/TypeConversion/9.3-1.js
  4485. * tests/mozilla/js1_2/function/String.js:
  4486. 2 tests disabled. The result of Object/Array object to String object
  4487. conversion is not following ECMA 15.5.1.1 and ECMA 9.8
  4488. 2006-11-30 Steve Falkenburg <sfalken@apple.com>
  4489. Reviewed by Oliver.
  4490. Move WTF from JavaScriptCore project into a new WTF project.
  4491. * JavaScriptCore.vcproj/JavaScriptCore.sln: Add WTF.vcproj to sln
  4492. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove WTF source files
  4493. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added.
  4494. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add dependency on WTF.lib
  4495. 2006-11-30 Geoffrey Garen <ggaren@apple.com>
  4496. Reviewed by Beth Dakin.
  4497. Fixed up garbage collection at window close time.
  4498. * kjs/interpreter.cpp:
  4499. (KJS::Interpreter::~Interpreter): Garbage collect here, since
  4500. destroying the interpreter frees the global object and
  4501. therefore creates a lot of garbage.
  4502. 2006-11-20 W. Andy Carrel <wac@google.com>
  4503. Reviewed by Maciej.
  4504. http://bugs.webkit.org/show_bug.cgi?id=11501
  4505. REGRESSION: \u no longer escapes metacharacters in RegExps
  4506. http://bugs.webkit.org/show_bug.cgi?id=11502
  4507. Serializing RegExps doesn't preserve Unicode escapes
  4508. * kjs/lexer.cpp:
  4509. (Lexer::Lexer):
  4510. (Lexer::setCode):
  4511. (Lexer::shift):
  4512. (Lexer::scanRegExp):
  4513. Push \u parsing back down into the RegExp object rather than in the
  4514. parser. This backs out r17354 in favor of a new fix that better
  4515. matches the behavior of other browsers.
  4516. * kjs/lexer.h:
  4517. * kjs/regexp.cpp:
  4518. (KJS::RegExp::RegExp):
  4519. (KJS::sanitizePattern):
  4520. (KJS::isHexDigit):
  4521. (KJS::convertHex):
  4522. (KJS::convertUnicode):
  4523. * kjs/regexp.h:
  4524. Translate \u escaped unicode characters for the benefit of pcre.
  4525. * kjs/ustring.cpp:
  4526. (KJS::UString::append):
  4527. Fix failure to increment length on the first UChar appended to a
  4528. UString that was copy-on-write.
  4529. * tests/mozilla/ecma_2/RegExp/properties-001.js:
  4530. Adjust tests back to the uniform standards.
  4531. 2006-11-20 Samuel Weinig <sam@webkit.org>
  4532. Reviewed by Maciej.
  4533. Fix for http://bugs.webkit.org/show_bug.cgi?id=11647
  4534. Fix Win32 build
  4535. * kjs/config.h: define NOMINMAX instead of min/max
  4536. as themselves.
  4537. * wtf/Vector.h: put back hack to ensure that min/max
  4538. are not defined as macros.
  4539. 2006-11-19 Simon Hausmann <hausmann@kde.org>
  4540. Reviewed by Zack.
  4541. http://bugs.webkit.org/show_bug.cgi?id=11649
  4542. Fix CMake Qt-only build without KDE CMake files
  4543. * CMakeLists.txt:
  4544. * pcre/CMakeLists.txt:
  4545. 2006-11-17 Anders Carlsson <acarlsson@apple.com>
  4546. Reviewed by Adam.
  4547. Make sure that we always use std::min and std::max instead of macros.
  4548. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  4549. * kjs/config.h:
  4550. * wtf/Vector.h:
  4551. === Safari-521.31 ===
  4552. 2006-11-12 Geoffrey Garen <ggaren@apple.com>
  4553. Reviewed by Beth Dakin.
  4554. Added project-wide setting to disable Microsoft's made-up deprecation
  4555. warnings related to std:: functions. (Doesn't have any affect yet,
  4556. since we currently disable all deprecation warnings.)
  4557. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  4558. 2006-11-12 Mark Rowe <bdash@webkit.org>
  4559. Reviewed by Mitz.
  4560. Clean up of JavaScriptCore bakefiles.
  4561. * JavaScriptCoreSources.bkl:
  4562. * jscore.bkl:
  4563. 2006-11-11 Alexey Proskuryakov <ap@webkit.org>
  4564. Reviewed by Maciej.
  4565. http://bugs.webkit.org/show_bug.cgi?id=11508
  4566. Undisable some warnings for JSImmediate.h
  4567. Fix suggested by Don Gibson.
  4568. * kjs/JSImmediate.h:
  4569. Re-enable all MSVC warnings, move the remaining runtime checks
  4570. to compile-time.
  4571. 2006-11-10 Zalan Bujtas <zalan.bujtas@nokia.com>
  4572. Reviewed by Maciej.
  4573. Added s60/symbian platform defines.
  4574. http://bugs.webkit.org/show_bug.cgi?id=11540
  4575. * wtf/Platform.h:
  4576. === Safari-521.30 ===
  4577. 2006-11-08 Ada Chan <adachan@apple.com>
  4578. Reviewed by darin.
  4579. Added a method to delete all the keys in a HashMap.
  4580. * wtf/HashMap.h:
  4581. (WTF::deleteAllPairFirsts):
  4582. (WTF::deleteAllKeys):
  4583. 2006-11-07 Anders Carlsson <acarlsson@apple.com>
  4584. Reviewed by Geoff.
  4585. * API/JSClassRef.cpp:
  4586. (OpaqueJSClass::OpaqueJSClass):
  4587. Initialize cachedPrototype to 0.
  4588. 2006-11-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  4589. Reviewed by Maciej.
  4590. Remove warning about garbage after #else. #else clause applies for all
  4591. non-mac platforms, not only win.
  4592. * kjs/date_object.cpp:
  4593. 2006-11-06 Mark Rowe <bdash@webkit.org>
  4594. Reviewed by the wonderful Mitz Pettel.
  4595. http://bugs.webkit.org/show_bug.cgi?id=11524
  4596. Bug 11524: REGRESSION(r9842): Array.prototype.join should use ToString operator rather than calling toString on each element
  4597. * kjs/array_object.cpp:
  4598. (ArrayProtoFunc::callAsFunction): Use ToString operator on each element rather than calling their toString method.
  4599. 2006-11-03 Steve Falkenburg <sfalken@apple.com>
  4600. Fix build
  4601. * kjs/JSImmediate.h:
  4602. 2006-11-03 Alexey Proskuryakov <ap@nypop.com>
  4603. Reviewed by Darin.
  4604. http://bugs.webkit.org/show_bug.cgi?id=11504
  4605. Fix warnings on non 32 bit platforms
  4606. * kjs/JSImmediate.h:
  4607. (KJS::JSImmediate::NanAsBits):
  4608. (KJS::JSImmediate::oneAsBits):
  4609. Rewrite in a way that moves runtime checks to compile-time.
  4610. (KJS::):
  4611. (KJS::JSImmediate::fromDouble):
  4612. (KJS::JSImmediate::toDouble):
  4613. 2006-11-02 George Staikos <staikos@kde.org>
  4614. Reviewed by Maciej.
  4615. * collector.cpp:
  4616. Remove a deprecated pthreads call.
  4617. 2006-11-02 Anders Carlsson <acarlsson@apple.com>
  4618. Reviewed by Maciej, landed by Anders.
  4619. * CMakeLists.txt:
  4620. Make KDE support optional.
  4621. 2006-11-01 Kevin McCullough <KMcCullough@apple.com>
  4622. Reviewed by Brady.
  4623. - Fixes many JavaScriptCore tests in other timezones. The root problem is that on mac localtime() returns historically accurate information for DST, but the JavaScript spec explicitly states to not take into account historical information but rather to interpolate from valid years.
  4624. * kjs/DateMath.cpp:
  4625. (KJS::equivalentYearForDST):
  4626. (KJS::getDSTOffsetSimple):
  4627. (KJS::getDSTOffset):
  4628. 2006-10-31 Geoffrey Garen <ggaren@apple.com>
  4629. Reviewed by Beth.
  4630. Fixed http://bugs.webkit.org/show_bug.cgi?id=11477
  4631. REGRESSION: GMail crashes in KJS::FunctionImp::callerGetter
  4632. * kjs/function.cpp:
  4633. (KJS::FunctionImp::argumentsGetter): Removed unnecessary braces.
  4634. (KJS::FunctionImp::callerGetter): More logical NULL checking.
  4635. 2006-10-31 Oliver Hunt <oliver@apple.com>
  4636. Reviewed by Geoff.
  4637. Adding definition for PLATFORM(CI)
  4638. * wtf/Platform.h:
  4639. 2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
  4640. Reviewed by Geoff.
  4641. http://bugs.webkit.org/show_bug.cgi?id=4166
  4642. Function object does not support caller property
  4643. Test: fast/js/caller-property.html
  4644. * kjs/function.cpp:
  4645. (KJS::FunctionImp::callerGetter): added
  4646. (KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
  4647. * kjs/function.h: added callerGetter() declaration
  4648. * kjs/identifier.h: added caller property macro
  4649. * tests/mozilla/expected.html:
  4650. 2006-10-30 Kevin McCullough <KMcCullough@apple.com>
  4651. Reviewed by Adam.
  4652. - Fix some timezone issues and JavaScriptCore date tests. Addresses bugzilla 4930.
  4653. * kjs/DateMath.h:
  4654. (KJS::GregorianDateTime::GregorianDateTime): Here's the fix, to add parenthesis for order of precedence.
  4655. * kjs/date_object.cpp:
  4656. (KJS::DateProtoFunc::callAsFunction):
  4657. (KJS::DateObjectImp::construct): memset not needed as GregorianDateTime initializes itself.
  4658. 2006-10-30 Darin Adler <darin@apple.com>
  4659. Reviewed by John Sullivan.
  4660. * kjs/SavedBuiltins.h: Added needed include.
  4661. * wtf/OwnPtr.h: (WTF::OwnPtr::set): Fixed mistake in assertion.
  4662. 2006-10-28 Darin Adler <darin@apple.com>
  4663. Reviewed by Maciej.
  4664. - renamed PassRefPtr::release to releaseRef to make it clearer that
  4665. it's the counterpart of adoptRef, and to make it harder to confuse
  4666. it with the safer-to-use RefPtr::release
  4667. * kjs/identifier.cpp:
  4668. (KJS::CStringTranslator::translate):
  4669. (KJS::UCharBufferTranslator::translate):
  4670. * kjs/ustring.cpp:
  4671. (KJS::UString::Rep::create):
  4672. * wtf/PassRefPtr.h:
  4673. (WTF::PassRefPtr::PassRefPtr):
  4674. (WTF::PassRefPtr::~PassRefPtr):
  4675. (WTF::PassRefPtr::get):
  4676. (WTF::PassRefPtr::releaseRef):
  4677. (WTF::PassRefPtr::operator->):
  4678. (WTF::PassRefPtr::operator=):
  4679. (WTF::adoptRef):
  4680. (WTF::static_pointer_cast):
  4681. (WTF::const_pointer_cast):
  4682. * wtf/RefPtr.h:
  4683. (WTF::RefPtr::RefPtr):
  4684. (WTF::RefPtr::operator=):
  4685. 2006-10-28 Darin Adler <darin@apple.com>
  4686. Reviewed by Steve.
  4687. * kjs/grammar.y: Add definitions of YYMALLOC and YYFREE to fix
  4688. a warning some people see (not sure why others don't see it).
  4689. * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Touch
  4690. this file to force it to re-build grammar.cpp.
  4691. 2006-10-28 Darin Adler <darin@apple.com>
  4692. Reviewed by Geoff.
  4693. - made changes so the code compiles with the highest warning level
  4694. under MSVC (disabling some warnings, making some code fixes)
  4695. * API/JSCallbackConstructor.cpp:
  4696. (KJS::JSCallbackConstructor::construct):
  4697. * API/JSCallbackFunction.cpp:
  4698. (KJS::JSCallbackFunction::callAsFunction):
  4699. * API/JSCallbackObject.cpp:
  4700. (KJS::JSCallbackObject::init):
  4701. (KJS::JSCallbackObject::construct):
  4702. (KJS::JSCallbackObject::callAsFunction):
  4703. * API/JSObjectRef.cpp:
  4704. (JSPropertyNameArrayGetNameAtIndex):
  4705. * API/JSStringRef.cpp:
  4706. (JSStringCreateWithCharacters):
  4707. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  4708. * bindings/c/c_utility.cpp:
  4709. (KJS::Bindings::convertUTF8ToUTF16):
  4710. (KJS::Bindings::coerceValueToNPVariantStringType):
  4711. (KJS::Bindings::convertValueToNPVariant):
  4712. * kjs/DateMath.h:
  4713. (KJS::GregorianDateTime::GregorianDateTime):
  4714. * kjs/ExecState.h:
  4715. (KJS::ExecState::hadException):
  4716. * kjs/JSImmediate.h:
  4717. (KJS::JSImmediate::fromDouble):
  4718. (KJS::JSImmediate::toDouble):
  4719. (KJS::JSImmediate::NanAsBits):
  4720. (KJS::JSImmediate::oneAsBits):
  4721. * kjs/Parser.h:
  4722. * kjs/PropertyNameArray.h:
  4723. (KJS::PropertyNameArray::size):
  4724. * kjs/array_object.cpp:
  4725. (ArrayObjectImp::callAsFunction):
  4726. * kjs/bool_object.cpp:
  4727. (BooleanObjectImp::callAsFunction):
  4728. * kjs/collector.cpp:
  4729. (KJS::Collector::allocate):
  4730. (KJS::Collector::markCurrentThreadConservatively):
  4731. (KJS::Collector::collect):
  4732. * kjs/completion.h:
  4733. (KJS::Completion::isValueCompletion):
  4734. * kjs/date_object.cpp:
  4735. (KJS::findMonth):
  4736. * kjs/debugger.cpp:
  4737. (Debugger::sourceParsed):
  4738. (Debugger::sourceUnused):
  4739. (Debugger::exception):
  4740. (Debugger::atStatement):
  4741. (Debugger::callEvent):
  4742. (Debugger::returnEvent):
  4743. * kjs/dtoa.cpp:
  4744. * kjs/error_object.cpp:
  4745. (ErrorObjectImp::callAsFunction):
  4746. (NativeErrorImp::callAsFunction):
  4747. * kjs/function.cpp:
  4748. (KJS::FunctionImp::processVarDecls):
  4749. (KJS::GlobalFuncImp::callAsFunction):
  4750. * kjs/function_object.cpp:
  4751. (FunctionPrototype::callAsFunction):
  4752. * kjs/grammar.y:
  4753. * kjs/identifier.cpp:
  4754. (KJS::CStringTranslator::translate):
  4755. (KJS::Identifier::add):
  4756. * kjs/internal.h:
  4757. * kjs/lexer.cpp:
  4758. (Lexer::lex):
  4759. (Lexer::isIdentStart):
  4760. (Lexer::isIdentPart):
  4761. (isDecimalDigit):
  4762. (Lexer::isHexDigit):
  4763. (Lexer::isOctalDigit):
  4764. (Lexer::matchPunctuator):
  4765. (Lexer::singleEscape):
  4766. (Lexer::convertOctal):
  4767. (Lexer::convertHex):
  4768. (Lexer::convertUnicode):
  4769. (Lexer::record8):
  4770. * kjs/lexer.h:
  4771. * kjs/math_object.cpp:
  4772. (MathFuncImp::callAsFunction):
  4773. * kjs/number_object.cpp:
  4774. (integer_part_noexp):
  4775. (intPow10):
  4776. (NumberProtoFunc::callAsFunction):
  4777. (NumberObjectImp::callAsFunction):
  4778. * kjs/object.cpp:
  4779. (KJS::JSObject::deleteProperty):
  4780. (KJS::JSObject::callAsFunction):
  4781. (KJS::JSObject::toBoolean):
  4782. (KJS::JSObject::toObject):
  4783. * kjs/object.h:
  4784. (KJS::JSObject::getPropertySlot):
  4785. * kjs/property_map.cpp:
  4786. (KJS::isValid):
  4787. (KJS::PropertyMap::put):
  4788. (KJS::PropertyMap::insert):
  4789. (KJS::PropertyMap::containsGettersOrSetters):
  4790. * kjs/property_map.h:
  4791. (KJS::PropertyMap::hasGetterSetterProperties):
  4792. * kjs/property_slot.h:
  4793. * kjs/string_object.cpp:
  4794. (StringInstance::getPropertyNames):
  4795. (StringObjectImp::callAsFunction):
  4796. (StringObjectFuncImp::callAsFunction):
  4797. * kjs/ustring.cpp:
  4798. (KJS::UString::Rep::computeHash):
  4799. (KJS::UString::UString):
  4800. (KJS::UString::from):
  4801. (KJS::UString::append):
  4802. (KJS::UString::ascii):
  4803. (KJS::UString::operator=):
  4804. (KJS::UString::find):
  4805. (KJS::UString::rfind):
  4806. * kjs/ustring.h:
  4807. (KJS::UChar::high):
  4808. (KJS::UChar::low):
  4809. (KJS::UCharReference::low):
  4810. (KJS::UCharReference::high):
  4811. * kjs/value.cpp:
  4812. (KJS::JSValue::toUInt16):
  4813. * kjs/value.h:
  4814. * pcre/pcre_compile.c:
  4815. (get_othercase_range):
  4816. * pcre/pcre_exec.c:
  4817. (match):
  4818. * pcre/pcre_internal.h:
  4819. * wtf/HashFunctions.h:
  4820. (WTF::intHash):
  4821. (WTF::PtrHash::hash):
  4822. * wtf/MathExtras.h:
  4823. (isnan):
  4824. (lround):
  4825. (lroundf):
  4826. * wtf/StringExtras.h:
  4827. (strncasecmp):
  4828. * wtf/unicode/icu/UnicodeIcu.h:
  4829. (WTF::Unicode::isPrintableChar):
  4830. 2006-10-26 W. Andy Carrel <wac@google.com>
  4831. Reviewed by Maciej.
  4832. - Fix http://bugs.webkit.org/show_bug.cgi?id=7445 /
  4833. <rdar://problem/4614195> (and 7253 / <rdar://4694011>) by changing
  4834. inline regexps so that they can have \u escaped Unicode sequences and
  4835. still work properly.
  4836. * kjs/lexer.cpp:
  4837. (Lexer::Lexer):
  4838. (Lexer::setCode):
  4839. (Lexer::shift): Looking ahead one additional character for the benefit
  4840. of scanRegExp
  4841. (Lexer::scanRegExp): Change code to support unicode escapes in inline
  4842. regexps.
  4843. * kjs/lexer.h: Extra lookahead added.
  4844. === Safari-521.29 ===
  4845. 2006-10-26 Nikolas Zimmermann <zimmermann@kde.org>
  4846. Reviewed by Darin.
  4847. Fix build with older gcc 3.3.4.
  4848. * kjs/DateMath.cpp: Remove inline prefix.
  4849. (KJS::equivalentYearForDST):
  4850. 2006-10-26 Darin Adler <darin@apple.com>
  4851. Reviewed by John.
  4852. - fix iteration of properties of string objects (found because of a warning
  4853. emitted by the MSVC compiler)
  4854. * kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that
  4855. wants to format a number as a string to use UString::from. Before it was using
  4856. the UString constructor that makes a string from a character!
  4857. * kjs/ustring.h:
  4858. * kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char)
  4859. constructor.
  4860. * kjs/grammar.y: Change code to not depend on the UString(char) constructor.
  4861. This is potentially more efficient anyway because we could overload the + operator
  4862. some day to handle char* directly instead of creating a UString.
  4863. * kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on
  4864. the UString(char) constructor.
  4865. 2006-10-25 Kevin McCullough <KMcCullough@apple.com>
  4866. Reviewed by Steve (rubber stamp).
  4867. - Link against your local build of JavaScriptCore.lib first, this fixes some errors on release builds of testkjs.
  4868. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  4869. 2006-10-25 Geoffrey Garen <ggaren@apple.com>
  4870. Reviewed by Lou.
  4871. Removed duplicate symbol declaration.
  4872. * JavaScriptCore.xcodeproj/project.pbxproj:
  4873. * kjs/grammar.y:
  4874. 2006-10-24 Steve Falkenburg <sfalken@apple.com>
  4875. Build config change
  4876. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  4877. 2006-10-24 Kevin McCullough <KMcCullough@apple.com>
  4878. Reviewed by Brady.
  4879. - Fixes a date formatting issue on win. Specifically strftime cannot handle some ranges of time so we shift time call strftime and then manipulate the returned string, if needed.
  4880. * kjs/date_object.cpp:
  4881. (KJS::):
  4882. (KJS::formatLocaleDate):
  4883. (KJS::DateProtoFunc::callAsFunction):
  4884. 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
  4885. Reviewed by
  4886. - Build fix
  4887. * JavaScriptCore.xcodeproj/project.pbxproj:
  4888. * kjs/grammar.y:
  4889. 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
  4890. Reviewed by Maciej.
  4891. - Makes the toTM function an operator. Was going to piggy back on a patch but the patch needs more work.
  4892. * kjs/DateMath.cpp:
  4893. (KJS::equivalentYearForDST):
  4894. * kjs/DateMath.h:
  4895. (KJS::GregorianDateTime::operator tm):
  4896. * kjs/date_object.cpp:
  4897. (KJS::formatTime):
  4898. (KJS::DateProtoFunc::callAsFunction):
  4899. 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
  4900. Reviewed by Maciej.
  4901. - Fixes two regressions on win. Both are stack overflows. For one the number of recursions is capped at 100, and for the other, nested parenthesis pairs are not evaluated (since they would evaluate to whatever is in them anyway).
  4902. * kjs/grammar.y:
  4903. * kjs/object.cpp:
  4904. 2006-10-21 Steve Falkenburg <sfalken@apple.com>
  4905. Reviewed by Adam.
  4906. Add minimal compatibility with MSVCRT leak checker
  4907. * wtf/FastMalloc.h:
  4908. 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
  4909. Reviewed by Geof.
  4910. - Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
  4911. * tests/mozilla/ecma/String/15.5.4.11-2.js:
  4912. 2006-10-21 Darin Adler <darin@apple.com>
  4913. Reviewed by Anders.
  4914. - http://bugs.webkit.org/show_bug.cgi?id=11377
  4915. swap(Vector, Vector) should be O(1) instead of O(n)
  4916. * wtf/Vector.h:
  4917. (WTF::VectorBuffer::swap): Added.
  4918. (WTF::Vector::swap): Added.
  4919. (WTF::swap): Added overload that takes two Vector objects.
  4920. 2006-10-21 Darin Adler <darin@apple.com>
  4921. Reviewed by Adam.
  4922. - http://bugs.webkit.org/show_bug.cgi?id=11376
  4923. build scripts should invoke make with "-j" option for multiple processors
  4924. * JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
  4925. 2006-10-19 Kevin McCullough <KMcCullough@apple.com>
  4926. Reviewed by Geof.
  4927. Changed test to make us pass Georgian case changing for Unicode 4.0 and 5.0. This incorporates changes from the 1.4 revision of the same mozilla test.
  4928. On Tiger we are still using Unicode 4.0 but on win and Leopard we are using Unicode 5.0, so this test currently allows for either answer.
  4929. * tests/mozilla/ecma/String/15.5.4.11-2.js:
  4930. 2006-10-18 Maciej Stachowiak <mjs@apple.com>
  4931. Reviewed by Geoff.
  4932. - remove vestiges of KXMLCore name (former name of WTF).
  4933. * wtf/Assertions.h:
  4934. * wtf/FastMalloc.h:
  4935. (operator new):
  4936. (operator delete):
  4937. (operator new[]):
  4938. (operator delete[]):
  4939. * wtf/FastMallocInternal.h:
  4940. * wtf/Forward.h:
  4941. * wtf/GetPtr.h:
  4942. * wtf/HashCountedSet.h:
  4943. * wtf/HashFunctions.h:
  4944. * wtf/HashMap.h:
  4945. * wtf/HashSet.h:
  4946. * wtf/HashTable.h:
  4947. * wtf/HashTraits.h:
  4948. * wtf/ListRefPtr.h:
  4949. * wtf/MathExtras.h:
  4950. * wtf/Noncopyable.h:
  4951. * wtf/OwnArrayPtr.h:
  4952. * wtf/OwnPtr.h:
  4953. * wtf/PassRefPtr.h:
  4954. * wtf/Platform.h:
  4955. * wtf/RefPtr.h:
  4956. * wtf/StringExtras.h:
  4957. (snprintf):
  4958. * wtf/UnusedParam.h:
  4959. * wtf/Vector.h:
  4960. * wtf/VectorTraits.h:
  4961. 2006-10-17 Steve Falkenburg <sfalken@apple.com>
  4962. Reviewed by Maciej.
  4963. Adjust include paths
  4964. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  4965. 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
  4966. Reviewed by Darin.
  4967. Fixed a date issue where the UTC offset was not set in win.
  4968. * kjs/DateMath.cpp:
  4969. (KJS::getDSTOffsetSimple):
  4970. (KJS::getDSTOffset):
  4971. (KJS::msToGregorianDateTime):
  4972. * kjs/DateMath.h:
  4973. (KJS::):
  4974. (KJS::GregorianDateTime::GregorianDateTime):
  4975. 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
  4976. Reviewed by Brady.
  4977. Fixes a JavaScriptCore math issue on win.
  4978. * kjs/math_object.cpp:
  4979. (MathFuncImp::callAsFunction):
  4980. * wtf/MathExtras.h:
  4981. (wtf_atan2):
  4982. 2006-10-16 Kevin McCullough <kmccullough@apple.com>
  4983. Reviewed by Geof.
  4984. Removed unecessary global specifiers.
  4985. * kjs/math_object.cpp:
  4986. (MathFuncImp::callAsFunction):
  4987. 2006-10-16 Kevin McCullough <KMcCullough@apple.com>
  4988. Reviewed by John.
  4989. Fixes a compile order issue for testkjs on win.
  4990. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  4991. 2006-10-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  4992. Reviewed by Anders.
  4993. Remove junk (as gcc calls it) after #else clause.
  4994. * wtf/FastMalloc.cpp:
  4995. (WTF::do_free):
  4996. 2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  4997. Reviewed by Maciej.
  4998. Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
  4999. networking, and set it for GDK build
  5000. * wtf/Platform.h:
  5001. 2006-10-13 Brett Wilson <brettw@google.com>
  5002. Reviewed by Kevin McCullough.
  5003. Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
  5004. Fixes Qt/Linux and Windows build
  5005. * kjs/DateMath.cpp:
  5006. * kjs/DateMath.h:
  5007. * kjs/date_object.cpp:
  5008. (KJS::DateProtoFunc::callAsFunction):
  5009. 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
  5010. Reviewed by Adam, Geoff, Darin.
  5011. Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
  5012. * ChangeLog:
  5013. * kjs/DateMath.cpp:
  5014. (KJS::getUTCOffset):
  5015. (KJS::getDSTOffsetSimple):
  5016. (KJS::gregorianDateTimeToMS):
  5017. (KJS::msToGregorianDateTime):
  5018. * kjs/DateMath.h:
  5019. (KJS::GregorianDateTime::GregorianDateTime):
  5020. (KJS::GregorianDateTime::~GregorianDateTime):
  5021. (KJS::GregorianDateTime::toTM):
  5022. * kjs/date_object.cpp:
  5023. (KJS::gmtoffset):
  5024. (KJS::formatDate):
  5025. (KJS::formatDateUTCVariant):
  5026. (KJS::formatTime):
  5027. (KJS::fillStructuresUsingTimeArgs):
  5028. (KJS::fillStructuresUsingDateArgs):
  5029. (KJS::DateInstance::getTime):
  5030. (KJS::DateInstance::getUTCTime):
  5031. (KJS::DateProtoFunc::callAsFunction):
  5032. (KJS::DateObjectImp::construct):
  5033. (KJS::DateObjectImp::callAsFunction):
  5034. (KJS::DateObjectFuncImp::callAsFunction):
  5035. (KJS::parseDate):
  5036. * kjs/date_object.h:
  5037. 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
  5038. Reviewed by Adam.
  5039. Gets JavaScripCore tests running on windows.
  5040. * Scripts/run-javascriptcore-tests:
  5041. * Scripts/webkitdirs.pm:
  5042. 2006-10-12 Geoffrey Garen <ggaren@apple.com>
  5043. Reviewed by Maciej.
  5044. Removed JSObjectMakeWithPrototype, clarified some comments. We really
  5045. don't want people to manage their own prototypes, so we don't want an
  5046. extra function in the API devoted to just that. People can still manage
  5047. their own prototypes if they really want by using JSObjectSetPrototype.
  5048. * API/JSClassRef.cpp:
  5049. (OpaqueJSClass::createNoAutomaticPrototype):
  5050. (OpaqueJSClass::create):
  5051. * API/JSClassRef.h:
  5052. * API/JSObjectRef.cpp:
  5053. (JSClassCreate):
  5054. (JSObjectMake):
  5055. * API/JSObjectRef.h:
  5056. * API/testapi.c:
  5057. (main):
  5058. * JavaScriptCore.exp:
  5059. 2006-10-12 Kevin McCullough <KMcCullough@apple.com>
  5060. Reviewed by Adam.
  5061. Build breakage fix
  5062. * kjs/DateMath.cpp:
  5063. (KJS::msToTM):
  5064. * kjs/date_object.cpp:
  5065. (KJS::gmtoffset):
  5066. 2006-10-11 Kevin McCullough <KMcCullough@apple.com>
  5067. Reviewed by Geoff.
  5068. Added our own tm struct to have a consistent set of fields, which lets us display the DST offset and timezone strings correctly. Also there is some code cleanup.
  5069. * kjs/DateMath.cpp:
  5070. (KJS::timeToMS):
  5071. (KJS::getUTCOffset):
  5072. (KJS::getDSTOffsetSimple):
  5073. (KJS::dateToMS):
  5074. (KJS::msToTM):
  5075. (KJS::tmToKJStm):
  5076. (KJS::KJStmToTm):
  5077. * kjs/DateMath.h:
  5078. * kjs/date_object.cpp:
  5079. (KJS::gmtoffset):
  5080. (KJS::formatTime):
  5081. (KJS::DateProtoFunc::callAsFunction):
  5082. (KJS::DateObjectImp::construct):
  5083. (KJS::DateObjectImp::callAsFunction):
  5084. (KJS::DateObjectFuncImp::callAsFunction):
  5085. (KJS::parseDate):
  5086. * kjs/date_object.h:
  5087. 2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  5088. Reviewed by Geoff.
  5089. Improve gdk build compiler flags (show warning, no rtti and exceptions).
  5090. * jscore.bkl:
  5091. 2006-10-06 Kevin McCullough <KMcCullough@apple.com>
  5092. Reviewed by Brady.
  5093. DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
  5094. * kjs/DateMath.cpp:
  5095. (KJS::equivalentYearForDST):
  5096. (KJS::getUTCOffset):
  5097. (KJS::getDSTOffsetSimple):
  5098. (KJS::getDSTOffset):
  5099. (KJS::dateToMseconds):
  5100. (KJS::msToTM):
  5101. * kjs/DateMath.h:
  5102. * kjs/date_object.cpp:
  5103. (KJS::gmtoffset):
  5104. 2006-10-05 Darin Adler <darin@apple.com>
  5105. Reviewed by Kevin McCullough.
  5106. * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
  5107. 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
  5108. Reviewed by Adam.
  5109. - Removed an unnecessary assert that was stopping many pages. tm_gmtoff was not set for UTC time in mozilla but is always set for us.
  5110. * kjs/DateMath.cpp:
  5111. (KJS::getUTCOffset):
  5112. (KJS::msToTM):
  5113. * kjs/date_object.cpp:
  5114. (KJS::gmtoffset):
  5115. (KJS::formatTime):
  5116. 2006-10-04 Geoffrey Garen <ggaren@apple.com>
  5117. Patch by Darin and me, reviewed by Maciej.
  5118. Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
  5119. in JavaScript garbage collection (KJS::Collector::collect())
  5120. <rdar://problem/4752492> Crash in KJS::collect
  5121. The issue here was allocating one garbage-collected object in the midst
  5122. of allocating a second garbage-collected object. In such a case, the
  5123. zeroIfFree word lies.
  5124. * kjs/collector.cpp:
  5125. (KJS::Collector::allocate):
  5126. (KJS::Collector::collect):
  5127. 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
  5128. Reviewed by Adam.
  5129. - Layout test fix
  5130. * kjs/DateMath.cpp:
  5131. (KJS::dateToDayInYear): accept and correctly handle negative months
  5132. 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
  5133. build fix
  5134. * kjs/DateMath.cpp:
  5135. (KJS::dateToDayInYear):
  5136. 2006-10-05 Mark Rowe <bdash@webkit.org>
  5137. Reviewed by maculloch.
  5138. Gdk build fix.
  5139. * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
  5140. 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
  5141. Reviewed by aroben
  5142. - build fix
  5143. * JavaScriptCore.xcodeproj/project.pbxproj:
  5144. 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
  5145. Reviewed by Mitz.
  5146. Fix Qt/Linux build by adding DateMath.cpp to compilation.
  5147. * CMakeLists.txt: Also replace tabs with spaces.
  5148. 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
  5149. Reviewed by DethBakin.
  5150. - Apparently the build bot uses an older version of XCode which warns about conversions and the newest version does not. I hope this fixes the build but I cann't be sure on my system.
  5151. * kjs/DateMath.cpp:
  5152. (KJS::msToYear):
  5153. (KJS::dayInYear):
  5154. (KJS::dateToDayInYear):
  5155. 2006-10-05 Darin Adler <darin@apple.com>
  5156. Reviewed by Adam.
  5157. * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
  5158. lines so you can see more assertions in less space. Also improved format
  5159. of file/line information so it works with more development environments.
  5160. 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
  5161. Reviewed by Tim H.
  5162. - The build machine is more sensitive about automatic conversions. These fixes exp
  5163. licitly cast or change the input and return types of functions to avoid conversions.
  5164. * JavaScriptCore.xcodeproj/project.pbxproj:
  5165. * kjs/DateMath.cpp:
  5166. (KJS::):
  5167. (KJS::msToDays):
  5168. (KJS::msToYear):
  5169. (KJS::dayInYear):
  5170. (KJS::monthToDayInYear):
  5171. (KJS::dateToDayInYear):
  5172. (KJS::getDSTOffsetSimple):
  5173. (KJS::getDSTOffset):
  5174. (KJS::dateToMseconds):
  5175. (KJS::msToTM):
  5176. 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
  5177. Reviewed by GGaren
  5178. - This is a big makeover for our Date implemenetation. This solves many platform specific issues, specifically dates before 1970, and simplifies some ugly code. The purpose of this was to get us to pass many of the JavaScriptCore tests on windows.
  5179. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5180. * JavaScriptCore.xcodeproj/project.pbxproj:
  5181. * kjs/DateMath.cpp: Added.
  5182. (KJS::):
  5183. (KJS::daysInYear):
  5184. (KJS::daysFrom1970ToYear):
  5185. (KJS::msFrom1970ToYear):
  5186. (KJS::msToDays):
  5187. (KJS::msToYear):
  5188. (KJS::isLeapYear):
  5189. (KJS::isInLeapYear):
  5190. (KJS::dayInYear):
  5191. (KJS::msToMilliseconds):
  5192. (KJS::msToWeekDay):
  5193. (KJS::msToSeconds):
  5194. (KJS::msToMinutes):
  5195. (KJS::msToHours):
  5196. (KJS::msToMonth):
  5197. (KJS::msToDayInMonth):
  5198. (KJS::monthToDayInYear):
  5199. (KJS::timeToMseconds):
  5200. (KJS::dateToDayInYear):
  5201. (KJS::equivalentYearForDST):
  5202. (KJS::getUTCOffset):
  5203. (KJS::getDSTOffsetSimple):
  5204. (KJS::getDSTOffset):
  5205. (KJS::localTimeToUTC):
  5206. (KJS::UTCToLocalTime):
  5207. (KJS::dateToMseconds):
  5208. (KJS::msToTM):
  5209. (KJS::isDST):
  5210. * kjs/DateMath.h: Added.
  5211. (KJS::):
  5212. * kjs/date_object.cpp:
  5213. (KJS::gmtoffset):
  5214. (KJS::formatTime):
  5215. (KJS::DateInstance::getTime):
  5216. (KJS::DateInstance::getUTCTime):
  5217. (KJS::DateProtoFunc::callAsFunction):
  5218. (KJS::DateObjectImp::construct):
  5219. (KJS::DateObjectFuncImp::callAsFunction):
  5220. (KJS::parseDate):
  5221. * kjs/testkjs.cpp:
  5222. * os-win32/stdint.h:
  5223. 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
  5224. Reviewed/landed by Adam.
  5225. Build testkjs on Qt/Linux.
  5226. * CMakeLists.txt:
  5227. 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
  5228. Reviewed by eseidel. Landed by eseidel.
  5229. Fix win32 build, which has no inttypes.h
  5230. * wtf/Assertions.h:
  5231. 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
  5232. Reviewed by eseidel & mjs. Landed by eseidel.
  5233. Fix Qt/Linux build with older gcc 3.3.4.
  5234. http://bugs.webkit.org/show_bug.cgi?id=11116
  5235. * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
  5236. (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
  5237. * wtf/Assertions.h: Include inttypes.h for uintptr_t.
  5238. 2006-09-28 Steve Falkenburg <sfalken@apple.com>
  5239. Reviewed by Maciej.
  5240. Use $(ConfigSuffix) set via vsprops files to add _debug
  5241. to end of debug filenames.
  5242. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5243. * JavaScriptCore.vcproj/debug.vsprops: Added.
  5244. * JavaScriptCore.vcproj/dftables/dftables.vcproj:
  5245. * JavaScriptCore.vcproj/release.vsprops: Added.
  5246. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  5247. 2006-09-28 Darin Adler <darin@apple.com>
  5248. Reviewed by Alice.
  5249. - support for change that should fix <rdar://problem/4733044>
  5250. REGRESSION: XML iBench shows 10% perf. regression (copying
  5251. strings while decoding)
  5252. * wtf/Vector.h: Changed VectorBuffer so that the general case
  5253. contains an instance of the 0 case, since deriving from it
  5254. was violating the Liskov Substitution Principle.
  5255. (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
  5256. be adopted by another data structure that uses the FastMalloc.h allocator.
  5257. Returns 0 if the internal buffer was being used.
  5258. (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
  5259. a new one in the case where the internal buffer was being used.
  5260. 2006-09-28 Maciej Stachowiak <mjs@apple.com>
  5261. Reviewed by Geoff.
  5262. - change garbage collection to happen at increments proportional to number of live objects, not always
  5263. every 1000 allocations
  5264. * kjs/collector.cpp:
  5265. (KJS::Collector::allocate):
  5266. 2006-09-28 Maciej Stachowiak <mjs@apple.com>
  5267. Reviewed by Mitz.
  5268. - fixed REGRESSION (r16606): javascriptCore Crash on website load
  5269. Plus style fixes.
  5270. - fixed some possible off-by-one bugs
  5271. - use indexing, not iterators, for Vectors
  5272. - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
  5273. * kjs/function.cpp:
  5274. (KJS::FunctionImp::addParameter):
  5275. (KJS::FunctionImp::parameterString):
  5276. (KJS::FunctionImp::processParameters):
  5277. (KJS::FunctionImp::lengthGetter):
  5278. (KJS::FunctionImp::getParameterName):
  5279. * kjs/function.h:
  5280. 2006-09-27 Steve Falkenburg <sfalken@apple.com>
  5281. Reviewed by Maciej.
  5282. More build tweaks
  5283. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5284. * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
  5285. 2006-09-27 John Sullivan <sullivan@apple.com>
  5286. * kjs/function.cpp:
  5287. (KJS::FunctionImp::getParameterName):
  5288. removed assertion that displeased gcc 4.0.1 (build 5420):
  5289. ASSERT(static_cast<size_t>(index) == index);
  5290. 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
  5291. Reviewed by GGaren.
  5292. Cleanup of previous fix which was to address Radar: 4752492
  5293. * kjs/function.cpp:
  5294. (KJS::FunctionImp::addParameter):
  5295. (KJS::FunctionImp::parameterString):
  5296. (KJS::FunctionImp::processParameters):
  5297. (KJS::FunctionImp::lengthGetter):
  5298. (KJS::FunctionImp::getParameterName):
  5299. * kjs/function.h:
  5300. 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
  5301. Reviewed by Adele.
  5302. Fixes a GC stack overflow crash.
  5303. The change is to move from a linked list implementation of Parameters to a Vector.
  5304. The problem with the linked list is that each one creates it's own stack frame when being destroyed and in extreme cases this caused the stack to overflow.
  5305. * kjs/function.cpp:
  5306. (KJS::Parameter::Parameter):
  5307. (KJS::FunctionImp::addParameter):
  5308. (KJS::FunctionImp::parameterString):
  5309. (KJS::FunctionImp::processParameters):
  5310. (KJS::FunctionImp::lengthGetter):
  5311. (KJS::FunctionImp::getParameterName):
  5312. * kjs/function.h:
  5313. 2006-09-27 Steve Falkenburg <sfalken@apple.com>
  5314. Fix last path fix.
  5315. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5316. 2006-09-27 Steve Falkenburg <sfalken@apple.com>
  5317. Set path before build.
  5318. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5319. 2006-09-27 Sean Gies <seangies@apple.com>
  5320. Reviewed by Adam Roben.
  5321. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
  5322. * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
  5323. 2006-09-27 Don Melton <gramps@apple.com>
  5324. Reviewed by Adam Roben.
  5325. Changed line ending from DOS to UNIX format so it doesn't die running
  5326. on my machine. ;)
  5327. * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
  5328. 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
  5329. Reviewed by Maciej.
  5330. http://bugs.webkit.org/show_bug.cgi?id=10183
  5331. REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
  5332. (Fanfiction.net author pages not listing stories)
  5333. Rolled out the fix for bug 4139.
  5334. * kjs/lexer.cpp:
  5335. (Lexer::setCode):
  5336. (Lexer::shift):
  5337. * tests/mozilla/ecma/Array/15.4.5.1-1.js:
  5338. * tests/mozilla/expected.html:
  5339. 2006-09-22 Steve Falkenburg <sfalken@apple.com>
  5340. Build fix.
  5341. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5342. 2006-09-22 Darin Adler <darin@apple.com>
  5343. Reviewed by Alice.
  5344. * wtf/Vector.h: Add an append that takes a pointer and length.
  5345. Generalize the existing Vector append to work on vectors with
  5346. any value for inlineCapacity. Change the append algorithm so
  5347. it doesn't check capacity each time through the loop.
  5348. 2006-09-22 Steve Falkenburg <sfalken@apple.com>
  5349. Fix release build.
  5350. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5351. 2006-09-21 Geoffrey Garen <ggaren@apple.com>
  5352. Reviewed by Maciej.
  5353. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5354. Updated to include the right path.
  5355. * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
  5356. === Safari-521.27 ===
  5357. 2006-09-20 Anders Carlsson <acarlsson@apple.com>
  5358. Reviewed by Dave Hyatt.
  5359. * wtf/MathExtras.h:
  5360. Get rid of lrint.
  5361. 2006-09-20 Sean Gies <seangies@apple.com>
  5362. Reviewed by Steve Falkenburg.
  5363. * wtf/Assertions.cpp: Debug messages should go into debugger console.
  5364. 2006-09-20 David Hyatt <hyatt@apple.com>
  5365. Add an implementation of lrint for Win32.
  5366. Reviewed by anders
  5367. * wtf/MathExtras.h:
  5368. (lrint):
  5369. 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  5370. Reviewed by Adam.
  5371. http://bugs.webkit.org/show_bug.cgi?id=10864
  5372. Bug 10864: Linux\GDK build fixes
  5373. * JavaScriptCoreSources.bkl:
  5374. * jscore.bkl:
  5375. 2006-09-15 Adam Roben <aroben@apple.com>
  5376. Windows build fix.
  5377. * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
  5378. 2006-09-15 Anders Carlsson <acarlsson@apple.com>
  5379. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5380. Fix the release build.
  5381. 2006-09-15 Anders Carlsson <acarlsson@apple.com>
  5382. Reviewed by Steve.
  5383. Add JavaScriptCore API to the build.
  5384. * API/JSBase.cpp:
  5385. * API/JSCallbackConstructor.cpp:
  5386. * API/JSCallbackFunction.cpp:
  5387. * API/JSCallbackObject.cpp:
  5388. * API/JSClassRef.cpp:
  5389. * API/JSContextRef.cpp:
  5390. * API/JSObjectRef.cpp:
  5391. * API/JSStringRef.cpp:
  5392. * API/JSValueRef.cpp:
  5393. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5394. * os-win32/stdbool.h: Added.
  5395. 2006-09-12 Steve Falkenburg <sfalken@apple.com>
  5396. Reviewed by Ada.
  5397. Build tweaks (doing JavaScriptCore now since it doesn't have
  5398. dependencies).
  5399. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5400. * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
  5401. * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
  5402. * JavaScriptCore.vcproj/dftables/dftables.vcproj:
  5403. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  5404. 2006-09-11 Brady Eidson <beidson@apple.com>
  5405. Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
  5406. commented out the undefined constants until he can have a chance to make the right call
  5407. * bindings/objc/objc_utility.mm:
  5408. (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
  5409. 2006-09-11 Timothy Hatcher <timothy@apple.com>
  5410. Reviewed by Tim O. and Darin.
  5411. Add support for more method signatures affecting ObjC methods called from JavaScript:
  5412. - Added unsigned types and long long.
  5413. - Allow methods that use const, oneway, bycopy and byref type modifiers.
  5414. * bindings/objc/objc_instance.mm:
  5415. (ObjcInstance::invokeMethod):
  5416. * bindings/objc/objc_utility.h:
  5417. (KJS::Bindings::):
  5418. * bindings/objc/objc_utility.mm:
  5419. (KJS::Bindings::convertValueToObjcValue):
  5420. (KJS::Bindings::convertObjcValueToValue):
  5421. (KJS::Bindings::objcValueTypeForType):
  5422. 2006-09-05 Timothy Hatcher <timothy@apple.com>
  5423. Reviewed by Tim O.
  5424. <rdar://problem/4715840> SEL is not char*
  5425. * bindings/objc/objc_class.mm:
  5426. (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
  5427. * bindings/objc/objc_runtime.mm:
  5428. (ObjcFallbackObjectImp::callAsFunction): ditto
  5429. 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
  5430. Reviewed by Tim H.
  5431. http://bugs.webkit.org/show_bug.cgi?id=10693
  5432. Convert JavaScript arrays to AppleScript lists
  5433. * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
  5434. * kjs/array_instance.h:
  5435. * kjs/array_object.cpp:
  5436. (ArrayInstance::getItem): Added a method to access array items from C++.
  5437. 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  5438. Reviewed by Tim H.
  5439. Bug 10454: Unix bakefile fixes
  5440. http://bugs.webkit.org/show_bug.cgi?id=10454
  5441. * JavaScriptCoreSources.bkl:
  5442. 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
  5443. Reviewed by hyatt. Landed by eseidel.
  5444. Fix build on Linux.
  5445. * pcre/CMakeLists.txt: Add wtf/ include.
  5446. 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
  5447. Reviewed and landed by ap.
  5448. Fix build on Linux (C89 without gcc extensions enabled).
  5449. * pcre/pcre_internal.h: Use C style comments.
  5450. * wtf/Assertions.h: Use C style comments.
  5451. * wtf/Platform.h: Use C style comments.
  5452. 2006-09-01 Steve Falkenburg <sfalken@apple.com>
  5453. Fix build.
  5454. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5455. * JavaScriptCore.vcproj/dftables/dftables.vcproj:
  5456. 2006-08-31 Anders Carlsson <acarlsson@apple.com>
  5457. Reviewed by Darin.
  5458. Add new portability functions to MathExtras.h and add StringExtras.h which is for
  5459. string portability functions.
  5460. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5461. * bindings/c/c_instance.cpp:
  5462. * kjs/date_object.cpp:
  5463. * wtf/MathExtras.h:
  5464. (copysign):
  5465. (isfinite):
  5466. * wtf/StringExtras.h: Added.
  5467. (snprintf):
  5468. (strncasecmp):
  5469. 2006-08-31 Anders Carlsson <acarlsson@apple.com>
  5470. Reviewed by Tim H.
  5471. Fix Windows build.
  5472. * JavaScriptCore.vcproj/dftables/dftables.vcproj:
  5473. * pcre/pcre_internal.h:
  5474. 2006-08-31 Timothy Hatcher <timothy@apple.com>
  5475. Reviewed by Geoff.
  5476. Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
  5477. we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
  5478. the value <= INT_MAX.
  5479. I filed <rdar://problem/4712064> to track the need to verify
  5480. PCRE's 64-bit compliance.
  5481. * pcre/pcre_compile.c:
  5482. (complete_callout):
  5483. (compile_branch):
  5484. (compile_regex):
  5485. (pcre_compile2):
  5486. * pcre/pcre_exec.c:
  5487. (match):
  5488. (pcre_exec):
  5489. * pcre/pcre_get.c:
  5490. (pcre_get_substring_list):
  5491. * pcre/pcre_internal.h:
  5492. * pcre/pcre_tables.c:
  5493. * pcre/pcre_try_flipped.c:
  5494. (_pcre_try_flipped):
  5495. 2006-08-30 Darin Adler <darin@apple.com>
  5496. Reviewed by Tim Hatcher.
  5497. - add WTF::getPtr, a function template that makes it possible to write
  5498. generic code that gets a raw pointer out of any of our pointer types
  5499. * JavaScriptCore.xcodeproj/project.pbxproj:
  5500. * wtf/GetPtr.h: Added.
  5501. * wtf/ListRefPtr.h: (WTF::getPtr): Added.
  5502. * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
  5503. * wtf/OwnPtr.h: (WTF::getPtr): Added.
  5504. * wtf/PassRefPtr.h: (WTF::getPtr): Added.
  5505. * wtf/RefPtr.h: (WTF::getPtr): Added.
  5506. 2006-08-29 waylonis <waylonis@google.com>
  5507. Reviewed, tweaked by ggaren.
  5508. - Added storage and accessor functions for ExecState as a fix for
  5509. http://bugs.webkit.org/show_bug.cgi?id=10114
  5510. * kjs/ExecState.cpp:
  5511. (KJS::ExecState::ExecState):
  5512. * kjs/ExecState.h:
  5513. * kjs/context.h:
  5514. (KJS::Context::setExecState):
  5515. (KJS::Context::execState):
  5516. 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
  5517. Reviewed by Tim H.
  5518. Commit KDE related tweaks, to be able to
  5519. differentiate between a Qt-only or a KDE build.
  5520. * CMakeLists.txt: Install wtf-unity library.
  5521. * wtf/Platform.h: Add define for the KDE platform.
  5522. 2006-08-28 Darin Adler <darin@apple.com>
  5523. Reviewed by Geoff.
  5524. * kjs/list.h: Use explicit in constructor (as appropriate).
  5525. 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
  5526. Reviewed, tweaked and landed by ap
  5527. http://bugs.webkit.org/show_bug.cgi?id=10467
  5528. WebKit should have Qt platform support (Part II)
  5529. * CMakeLists.txt: Adjust to Anders' build fixes.
  5530. * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
  5531. 2006-08-23 David Hyatt <hyatt@apple.com>
  5532. Fix Platform.h to include #defines for graphics features.
  5533. Reviewed by darin
  5534. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5535. * wtf/Platform.h:
  5536. 2006-08-23 Anders Carlsson <acarlsson@apple.com>
  5537. Reviewed by Darin.
  5538. Make the bindings compile without CoreFoundation.
  5539. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5540. * bindings/c/c_instance.cpp:
  5541. * bindings/c/c_utility.cpp:
  5542. (KJS::Bindings::convertUTF8ToUTF16):
  5543. * bindings/npapi.h:
  5544. * bindings/runtime.cpp:
  5545. (KJS::Bindings::Instance::createBindingForLanguageInstance):
  5546. (KJS::Bindings::Instance::createLanguageInstanceForValue):
  5547. * bindings/runtime_root.cpp:
  5548. * bindings/runtime_root.h:
  5549. * kjs/interpreter.cpp:
  5550. (KJS::Interpreter::createLanguageInstanceForValue):
  5551. * kjs/interpreter.h:
  5552. 2006-08-22 Anders Carlsson <acarlsson@apple.com>
  5553. Reviewed by Darin.
  5554. Move the npruntime code over to using HashMap and the runtime_root code over to using
  5555. HashMap and HashCountedSet.
  5556. * bindings/NP_jsobject.cpp:
  5557. * bindings/c/c_utility.cpp:
  5558. (KJS::Bindings::identifierFromNPIdentifier):
  5559. * bindings/c/c_utility.h:
  5560. * bindings/jni/jni_jsobject.cpp:
  5561. (JavaJSObject::invoke):
  5562. * bindings/npruntime.cpp:
  5563. (getStringIdentifierMap):
  5564. (getIntIdentifierMap):
  5565. (_NPN_GetStringIdentifier):
  5566. (_NPN_GetIntIdentifier):
  5567. * bindings/runtime_root.cpp:
  5568. (getReferencesByRootMap):
  5569. (getReferencesSet):
  5570. (KJS::Bindings::findReferenceSet):
  5571. (KJS::Bindings::rootForImp):
  5572. (KJS::Bindings::rootForInterpreter):
  5573. (KJS::Bindings::addNativeReference):
  5574. (KJS::Bindings::removeNativeReference):
  5575. (RootObject::removeAllNativeReferences):
  5576. * bindings/runtime_root.h:
  5577. 2006-08-22 Anders Carlsson <acarlsson@apple.com>
  5578. Reviewed by Geoff.
  5579. Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
  5580. * JavaScriptCore.xcodeproj/project.pbxproj:
  5581. * bindings/c/c_class.cpp:
  5582. (KJS::Bindings::CClass::CClass):
  5583. (KJS::Bindings::CClass::~CClass):
  5584. (KJS::Bindings::CClass::classForIsA):
  5585. (KJS::Bindings::CClass::methodsNamed):
  5586. (KJS::Bindings::CClass::fieldNamed):
  5587. * bindings/c/c_class.h:
  5588. * bindings/jni/jni_class.cpp:
  5589. (JavaClass::JavaClass):
  5590. (JavaClass::~JavaClass):
  5591. (JavaClass::methodsNamed):
  5592. (JavaClass::fieldNamed):
  5593. * bindings/jni/jni_class.h:
  5594. * bindings/objc/objc_class.h:
  5595. * bindings/objc/objc_class.mm:
  5596. (KJS::Bindings::deleteMethod):
  5597. (KJS::Bindings::deleteField):
  5598. (KJS::Bindings::):
  5599. (KJS::Bindings::ObjcClass::methodsNamed):
  5600. (KJS::Bindings::ObjcClass::fieldNamed):
  5601. * bindings/runtime.cpp:
  5602. * bindings/runtime.h:
  5603. * bindings/runtime_object.cpp:
  5604. (RuntimeObjectImp::fieldGetter):
  5605. (RuntimeObjectImp::getOwnPropertySlot):
  5606. (RuntimeObjectImp::put):
  5607. (RuntimeObjectImp::canPut):
  5608. 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
  5609. Reviewed by Darin.
  5610. http://bugs.webkit.org/show_bug.cgi?id=6252
  5611. JavaScript 1.6 Array.lastIndexOf
  5612. Test: fast/js/array-lastIndexOf.html
  5613. * kjs/array_object.cpp:
  5614. (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
  5615. * kjs/array_object.h:
  5616. (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
  5617. * tests/mozilla/expected.html: Two more tests now pass.
  5618. 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
  5619. Reviewed by Maciej. Landed by rwlbuis.
  5620. Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
  5621. WebKit should have Qt platform support
  5622. Removing obsolete QConstString/QString constructors in kjs code.
  5623. * kjs/identifier.h:
  5624. * kjs/ustring.h:
  5625. 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
  5626. Reviewed by Maciej. Landed by rwlbuis.
  5627. Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
  5628. WTF Changes needed for Qt platform code.
  5629. * wtf/Platform.h:
  5630. * wtf/unicode/UnicodeDecomposition.h: Added.
  5631. (WTF::Unicode::):
  5632. * wtf/unicode/UnicodeDirection.h: Added.
  5633. (WTF::Unicode::):
  5634. * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
  5635. (WTF::Unicode::direction):
  5636. (WTF::Unicode::category):
  5637. (WTF::Unicode::decomposition):
  5638. * wtf/unicode/qt4/UnicodeQt4.h:
  5639. (WTF::Unicode::toLower):
  5640. (WTF::Unicode::toUpper):
  5641. (WTF::Unicode::isPrintableChar):
  5642. (WTF::Unicode::isSpace):
  5643. (WTF::Unicode::isPunct):
  5644. (WTF::Unicode::isDigit):
  5645. (WTF::Unicode::mirroredChar):
  5646. (WTF::Unicode::compare):
  5647. 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
  5648. Reviewed by Eric. Landed by rwlbuis.
  5649. Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
  5650. Offer a cmake build system for Qt platform.
  5651. * CMakeLists.txt: Added.
  5652. * pcre/CMakeLists.txt: Added.
  5653. 2006-08-17 Anders Carlsson <acarlsson@apple.com>
  5654. Reviewed by Maciej.
  5655. * bindings/npapi.h:
  5656. Fix ifdef.
  5657. 2006-08-15 Steve Falkenburg <sfalken@apple.com>
  5658. Reviewed by mjs.
  5659. Build fix.
  5660. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5661. * wtf/Assertions.h:
  5662. 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
  5663. Reviewed by Tim H.
  5664. Build fix: DWARF and -gfull are incompatible with symbol separation.
  5665. * JavaScriptCore.xcodeproj/project.pbxproj:
  5666. 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
  5667. Reviewed by Tim H.
  5668. http://bugs.webkit.org/show_bug.cgi?id=10394
  5669. Bug 10394: WebKit Release and Production configurations should enable dead code stripping
  5670. * JavaScriptCore.xcodeproj/project.pbxproj:
  5671. 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
  5672. Reviewed by Tim H.
  5673. http://bugs.webkit.org/show_bug.cgi?id=10384
  5674. Bug 10384: Switch to DWARF for Release configuration
  5675. * JavaScriptCore.xcodeproj/project.pbxproj:
  5676. 2006-08-13 Maks Orlovich <maksim@kde.org>
  5677. Reviewed (and tweaked a little) by Maciej.
  5678. - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
  5679. in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
  5680. This was done by removing _scope and _internalValue data members
  5681. from JSObject and moving them only to the subclasses that actually
  5682. make use of them.
  5683. * kjs/object.cpp:
  5684. (KJS::JSObject::mark): No need to mark scope or internal value here.
  5685. * kjs/object.h:
  5686. (KJS::JSObject::JSObject): Don't initialize them.
  5687. * kjs/JSWrapperObject.cpp: Added. New base class for object types that
  5688. wrap primitive values (Number, String, Boolean, Date).
  5689. (KJS::JSWrapperObject::mark):
  5690. * kjs/JSWrapperObject.h: Added.
  5691. (KJS::JSWrapperObject::JSWrapperObject):
  5692. (KJS::JSWrapperObject::internalValue):
  5693. (KJS::JSWrapperObject::setInternalValue):
  5694. * kjs/array_object.cpp:
  5695. (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
  5696. * kjs/bool_object.cpp:
  5697. (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
  5698. (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
  5699. JSObjects have an internal value.
  5700. (BooleanObjectImp::construct): ditto.
  5701. * kjs/bool_object.h:
  5702. * kjs/collector.cpp: Lowered cell size to 48.
  5703. (KJS::Collector::allocate): meaningless whitespace change
  5704. * kjs/date_object.cpp:
  5705. (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
  5706. (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
  5707. (KJS::DateObjectImp::construct): ditto
  5708. * kjs/date_object.h:
  5709. * kjs/error_object.cpp:
  5710. (ErrorPrototype::ErrorPrototype): don't set internal value
  5711. * kjs/function.cpp: move _scope and related handling here
  5712. (KJS::FunctionImp::mark): mark scope
  5713. * kjs/function.h:
  5714. (KJS::FunctionImp::scope): moved here from JSObject
  5715. (KJS::FunctionImp::setScope): ditto
  5716. * kjs/number_object.cpp:
  5717. (NumberInstance::NumberInstance): inherit from JSWrapperObject
  5718. (NumberProtoFunc::callAsFunction): adjusted
  5719. (NumberObjectImp::construct): adjusted
  5720. * kjs/number_object.h: shring RegExp-related objects a little
  5721. * kjs/regexp_object.cpp:
  5722. (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
  5723. (RegExpObjectImp::RegExpObjectImp): ditto
  5724. * kjs/regexp_object.h:
  5725. * kjs/string_object.cpp:
  5726. (StringInstance::StringInstance): inherit from JSWrapperObject
  5727. (StringProtoFunc::callAsFunction): adjusted
  5728. * kjs/string_object.h:
  5729. * JavaScriptCore.exp: Exported new methods as needed.
  5730. * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
  5731. 2006-08-04 Brady Eidson <beidson@apple.com>
  5732. Reviewed by Geoff's rubber stamp
  5733. Fix a build break on Intel hardware causes by adapting stricter
  5734. compiler warnings (-Wshorten-64-to-32)
  5735. * API/testapi.c:
  5736. (assertEqualsAsNumber): manually cast some doubles to floats
  5737. (main): ditto
  5738. 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
  5739. Reviewed by Darin.
  5740. - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
  5741. Make WebCore (and friends) compile with -Wshorten-64-to-32
  5742. * Adds -Wshorten-64-to-32 flag to Xcode project.
  5743. * Adds explicit casts where OK.
  5744. * API/JSNodeList.c:
  5745. (JSNodeList_item):
  5746. (JSNodeList_getProperty):
  5747. * JavaScriptCore.xcodeproj/project.pbxproj:
  5748. 2006-08-04 Adam Roben <aroben@apple.com>
  5749. Reviewed by Anders.
  5750. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
  5751. spaces to tabs
  5752. 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
  5753. Reviewed by Darin.
  5754. - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
  5755. Make WebCore compile with -Wundef
  5756. * Adds -Wundef flag to Xcode project
  5757. * Converts #ifs to #ifdef and #ifndefs where needed.
  5758. * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
  5759. to fix a warning from within Bison.
  5760. * JavaScriptCore.xcodeproj/project.pbxproj:
  5761. * bindings/jni/jni_jsobject.cpp:
  5762. (JavaJSObject::getSlot):
  5763. (JavaJSObject::setSlot):
  5764. * bindings/npapi.h:
  5765. * bindings/objc/objc_class.mm:
  5766. (KJS::Bindings::ObjcClass::methodsNamed):
  5767. (KJS::Bindings::ObjcClass::fieldNamed):
  5768. * bindings/objc/objc_instance.mm:
  5769. (ObjcInstance::invokeMethod):
  5770. * bindings/objc/objc_runtime.mm:
  5771. (ObjcMethod::getMethodSignature):
  5772. (ObjcField::name):
  5773. (ObjcField::type):
  5774. * kjs/grammar.y:
  5775. * kjs/identifier.h:
  5776. 2006-08-03 Anders Carlsson <acarlsson@apple.com>
  5777. Reviewed by John Sullivan.
  5778. * wtf/HashSet.h:
  5779. (WTF::::operator):
  5780. Return *this in operator=
  5781. 2006-08-03 Adam Roben <aroben@apple.com>
  5782. Reviewed by Anders.
  5783. - Fixed Windows build
  5784. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5785. * wtf/MathExtras.h: Implement inline versions of these functions
  5786. (nextafter):
  5787. (nextafterf):
  5788. 2006-08-02 Adam Roben <aroben@apple.com>
  5789. Reviewed by Darin.
  5790. - Fixed build
  5791. * kjs/date_object.cpp:
  5792. (KJS::formatTime):
  5793. 2006-07-29 Darin Adler <darin@apple.com>
  5794. - Removed tabs from these source files that still had them.
  5795. We don't use them; that way source files look fine in editors
  5796. that have tabs set to 8 spaces or to 4 spaces.
  5797. - Removed allow-tabs Subversion property from the files too.
  5798. * bindings/NP_jsobject.cpp:
  5799. * bindings/c/c_utility.cpp:
  5800. * bindings/jni/jni_runtime.cpp:
  5801. * bindings/jni/jni_utility.cpp:
  5802. * bindings/objc/objc_utility.mm:
  5803. * bindings/runtime.cpp:
  5804. * bindings/runtime_method.cpp:
  5805. * bindings/testbindings.cpp:
  5806. * bindings/testbindings.mm:
  5807. * kjs/date_object.cpp:
  5808. * kjs/function.cpp:
  5809. * kjs/list.cpp:
  5810. * kjs/nodes.cpp:
  5811. * kjs/nodes.h:
  5812. * kjs/string_object.cpp:
  5813. * kjs/ustring.cpp:
  5814. 2006-07-29 Darin Adler <darin@apple.com>
  5815. * tests/mozilla/expected.html: Update test results now that regress-185165.js
  5816. is succeeding. I suspect Anders fix for bug 4620655 is the reason.
  5817. 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
  5818. Reviewed by Darin.
  5819. - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
  5820. Adopt pedantic changes from the Unity project to improve
  5821. cross-compiler compatibility
  5822. Changes include:
  5823. * Removing trailing semicolon from namespace braces.
  5824. * Removing trailing comma from last enum declaration.
  5825. * Updating to match style guidelines.
  5826. * Adding missing newline to the end of the file.
  5827. * Turning on gcc warning for missing newline at the end of a source file
  5828. (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
  5829. * Alphabetical sorting of Xcode source list files.
  5830. * Replace use of non-portable variable-size array with Vector.
  5831. * Use C-style comments instead of C++ comments in files that might
  5832. be included by either C or C++ files.
  5833. * API/JSCallbackConstructor.cpp:
  5834. (KJS::JSCallbackConstructor::construct):
  5835. * API/JSCallbackFunction.cpp:
  5836. (KJS::JSCallbackFunction::callAsFunction):
  5837. * API/JSCallbackObject.cpp:
  5838. (KJS::JSCallbackObject::construct):
  5839. (KJS::JSCallbackObject::callAsFunction):
  5840. * JavaScriptCore.xcodeproj/project.pbxproj:
  5841. * JavaScriptCorePrefix.h:
  5842. * bindings/jni/jni_class.cpp:
  5843. (JavaClass::fieldNamed):
  5844. * bindings/jni/jni_class.h:
  5845. * bindings/jni/jni_instance.cpp:
  5846. (JavaInstance::JavaInstance):
  5847. (JavaInstance::valueOf):
  5848. * bindings/jni/jni_objc.mm:
  5849. (KJS::Bindings::dispatchJNICall):
  5850. * bindings/jni/jni_runtime.cpp:
  5851. (JavaParameter::JavaParameter):
  5852. (JavaArray::JavaArray):
  5853. * bindings/jni/jni_runtime.h:
  5854. * bindings/jni/jni_utility.h:
  5855. * bindings/objc/objc_instance.h:
  5856. * bindings/runtime_array.h:
  5857. * kjs/collector.h:
  5858. * kjs/config.h:
  5859. * kjs/ustring.cpp:
  5860. * wtf/Platform.h:
  5861. 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
  5862. Reviewed by Darin.
  5863. - fixes for Linux build
  5864. * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
  5865. and kjs/testkjs.cpp, and removed old files.
  5866. 2006-07-24 Dan Waylonis <waylonis@google.com>
  5867. Reviewed and tweaked a bit by Darin.
  5868. - fix http://bugs.webkit.org/show_bug.cgi?id=9902
  5869. jsNull and NSNull not properly converted between JS and ObjC
  5870. * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
  5871. Added case for converting NSNull to jsNull.
  5872. 2006-07-24 Rob Buis <buis@kde.org>
  5873. Reviewed by Darin.
  5874. http://bugs.webkit.org/show_bug.cgi?id=4258
  5875. Date().toString() only includes GMT offset, not timezone string
  5876. Use the info in tm_zone to append timezone abbreviation
  5877. to Date().toString().
  5878. * kjs/date_object.cpp:
  5879. (KJS::formatTime):
  5880. 2006-07-24 Rob Buis <buis@kde.org>
  5881. Reviewed by Darin.
  5882. http://bugs.webkit.org/show_bug.cgi?id=5257
  5883. setYear() does not match FireFox/IE behavior
  5884. Make sure the right values end up in tm_year.
  5885. * kjs/date_object.cpp:
  5886. (KJS::formatTime):
  5887. 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
  5888. Reviewed by Maciej.
  5889. Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
  5890. http://bugs.webkit.org/show_bug.cgi?id=9686
  5891. JavaScriptCore portion of the fix.
  5892. * JavaScriptCore.exp: Update symbol for change in argument type.
  5893. * kjs/debugger.cpp:
  5894. (Debugger::detach): Clear map of recent exceptions.
  5895. (Debugger::hasHandledException): Track the most recent exception
  5896. thrown by an interpreter.
  5897. (Debugger::exception): Change exception argument to a JSValue.
  5898. * kjs/debugger.h:
  5899. * kjs/nodes.cpp:
  5900. (Node::debugExceptionIfNeeded): Notify the debugger of an exception
  5901. if it hasn't seen it before.
  5902. (ThrowNode::execute): Notify the debugger that an exception is being thrown.
  5903. * kjs/nodes.h:
  5904. 2006-07-23 Geoffrey Garen <ggaren@apple.com>
  5905. Patch by Eric Albert, reviewed by Darin and me.
  5906. - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
  5907. crashes (Collector::markStackObjectsConservatively)
  5908. * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
  5909. int.
  5910. (JavaJSObject::getSlot):
  5911. (JavaJSObject::setSlot):
  5912. * kjs/collector.cpp:
  5913. (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
  5914. an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
  5915. and we want to scan the stack for pointers.
  5916. * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
  5917. XCode war has started up again!
  5918. === Safari-521.20 ===
  5919. 2006-07-21 Geoffrey Garen <ggaren@apple.com>
  5920. Reviewed by Darin.
  5921. <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
  5922. - Added support for strings that masquerade as undefined. Currently used
  5923. by WebCore to implement undetectable style.filter.
  5924. The name is a little long, but it's only used in one line of code, so I
  5925. thought clarity should win over brevity.
  5926. * JavaScriptCore.exp:
  5927. * JavaScriptCore.xcodeproj/project.pbxproj:
  5928. * kjs/object.h:
  5929. * kjs/string_object.h:
  5930. (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
  5931. (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
  5932. (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
  5933. === Safari-521.19 ===
  5934. 2006-07-20 Steve Falkenburg <sfalken@apple.com>
  5935. Fix the build
  5936. * kjs/function.cpp:
  5937. (KJS::escapeStringForPrettyPrinting):
  5938. 2006-07-19 Anders Carlsson <acarlsson@apple.com>
  5939. Reviewed by Darin.
  5940. <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
  5941. * kjs/nodes2string.cpp:
  5942. (StringNode::streamTo):
  5943. Return the escaped string.
  5944. (RegExpNode::streamTo):
  5945. Use the correct syntax.
  5946. * kjs/function.cpp:
  5947. (KJS::escapeStringForPrettyPrinting):
  5948. * kjs/function.h:
  5949. Add escape function which escapes a string for pretty-printing so it can be parsed again.
  5950. * wtf/unicode/icu/UnicodeIcu.h:
  5951. (WTF::Unicode::isPrintableChar):
  5952. New function.
  5953. 2006-07-18 Maciej Stachowiak <mjs@apple.com>
  5954. Reviewed by Adele Peterson.
  5955. <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
  5956. * kjs/lexer.cpp:
  5957. (Lexer::shift):
  5958. (Lexer::lex):
  5959. (Lexer::record16):
  5960. (Lexer::scanRegExp):
  5961. * kjs/lexer.h:
  5962. 2006-07-18 Tim Omernick <timo@apple.com>
  5963. Reviewed by Tim Hatcher.
  5964. Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
  5965. variable.
  5966. * bindings/npapi.h:
  5967. === Safari-521.18 ===
  5968. 2006-07-18 Timothy Hatcher <timothy@apple.com>
  5969. Made the following headers public:
  5970. * JavaScriptCore.h
  5971. * JSBase.h
  5972. * JSContextRef.h
  5973. * JSObjectRef.h
  5974. * JSStringRef.h
  5975. * JSValueRef.h
  5976. * JavaScriptCore.xcodeproj/project.pbxproj:
  5977. 2006-07-17 Geoffrey Garen <ggaren@apple.com>
  5978. Reviewed by Maciej.
  5979. - Added automatic prototype creation for classes.
  5980. A class stores a weak reference to a prototype, which is cleared when
  5981. the prototype is garbage collected, to avoid a reference cycle.
  5982. We now have an attributes field in JSClassDefinition, that currently is
  5983. used only to override automatic prototype creation when you want to manage your
  5984. own prototypes, but can be extended in the future for other nefarious purposes.
  5985. Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
  5986. allowing you to manage your own prototypes.
  5987. JSObjectMakeConstructor is more interesting now, able to make a constructor
  5988. on your behalf if you just give it a class.
  5989. - Removed bogus old code from minidom.js.
  5990. - Tweaked the headerdocs.
  5991. - Added more GC testing, which caught some leaks, and tested more funny
  5992. edge cases in lookup, which caught a lookup bug. Removed some testing
  5993. we used to do with MyObject because it was redundant with the new, cool
  5994. stuff.
  5995. While fixing the lookup bug I retracted this change:
  5996. "If a static setProperty callback returns 'false', to indicate that the
  5997. property was not set, we no longer forward the set request up the class
  5998. chain, because that's almost certainly not what the programmer expected."
  5999. Returning false when setting a static property is a little silly, but you can see
  6000. it being useful when shadowing a base class's static properties, and, regardless
  6001. of usefullness, this is the defined behavior of the setProperty callback.
  6002. - Plus a little ASCII art, for the kids.
  6003. 2006-07-17 Timothy Hatcher <timothy@apple.com>
  6004. Reviewed by Maciej.
  6005. <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
  6006. Moves WebScriptObject and WebUndefined up to WebCore.
  6007. This change does create an upwards-dependancy on WebScriptObject existing
  6008. in the loaded process, but this code path in JavaScriptCore does not get used
  6009. unless it is through WebKit/WebCore. Moving all of the binding code out of
  6010. JavaScriptCore might make sense in the future.
  6011. * JavaScriptCore.exp:
  6012. * JavaScriptCore.xcodeproj/project.pbxproj:
  6013. * bindings/objc/WebScriptObject.h: Replaced.
  6014. * bindings/objc/WebScriptObject.mm: Removed.
  6015. * bindings/objc/WebScriptObjectPrivate.h: Removed.
  6016. * bindings/objc/objc_class.h:
  6017. * bindings/objc/objc_instance.h:
  6018. * bindings/objc/objc_instance.mm:
  6019. (ObjcInstance::~ObjcInstance):
  6020. * bindings/objc/objc_runtime.h:
  6021. * bindings/objc/objc_runtime.mm:
  6022. (convertValueToObjcObject):
  6023. * bindings/objc/objc_utility.mm:
  6024. (KJS::Bindings::convertValueToObjcValue):
  6025. (KJS::Bindings::convertObjcValueToValue):
  6026. (KJS::Bindings::createObjcInstanceForValue):
  6027. 2006-07-17 Darin Adler <darin@apple.com>
  6028. * API/JSBase.h: Fix comment formatting where things used to be lined up but
  6029. are now ragged. Got rid of spaces that attempted to line things up.
  6030. * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
  6031. 2006-07-17 Geoffrey Garen <ggaren@apple.com>
  6032. Reviewed by Maciej.
  6033. - Removed the exception parameter from the initialize callback and, by extension,
  6034. JSObjectMake. We have never had a need for exceptions when iniitializing,
  6035. so the parameter seemed likely to "get in the way."
  6036. Also, an exception in JavaScript is thrown in response to input --
  6037. "invalid URL", "index not a number", etc., so it's the job of the
  6038. constructor function, not the initialize method, to throw.
  6039. If initialize *really* wants to throw, it can communicate the throw to
  6040. the constructor through the constructed object's private data (e.g., set
  6041. it to NULL, signaling to the consntructor that initialization failed.)
  6042. - Added JSObjectMakeWithData, which enables a constructor to set private
  6043. data on an object *before* it has been initialized. That way, the initialize
  6044. methods can properly operate on the data.
  6045. * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
  6046. now that it's possible.
  6047. * API/JSNodeList.c: ditto
  6048. * API/minidom.c:
  6049. (main): Do more aggressive garbage collection to test ref/deref and
  6050. initialize/finalize.
  6051. * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
  6052. like a thousand times. This makes debugging ref/deref easier
  6053. 2006-07-17 Geoffrey Garen <ggaren@apple.com>
  6054. Reviewed by Maciej.
  6055. - Changed the initialize callback to run from least derived class (parent
  6056. class) to most derived class. This enables C++ style initialization,
  6057. and derived class overriding of member data.
  6058. - Added excpetion propopgation to JSObjectMake, to support initialize
  6059. exceptions, and generally round out our policy of making function
  6060. signatures as long as possible.
  6061. * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
  6062. in C++ land now.
  6063. 2006-07-17 Geoffrey Garen <ggaren@apple.com>
  6064. Reviewed by Maciej.
  6065. - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
  6066. to match JSObjectMakeFunctionWithCallback.
  6067. - Added prototype parameter, so the generated constructor
  6068. automatically works with hasInstance / instanceof
  6069. - Moved hasInstance implementation from InternalFunctionImp to JSObject
  6070. so that subclasses can inherit it without inheriting function-related baggage.
  6071. More refactoring here would be good, but this seems like a good short-term
  6072. solution.
  6073. (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
  6074. because callback functions aren't constructors.
  6075. 2006-07-17 Maciej Stachowiak <mjs@apple.com>
  6076. Reviewed by Geoff.
  6077. - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
  6078. except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
  6079. Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
  6080. but usually uninteresting parameter.
  6081. * API/JSBase.cpp:
  6082. (JSEvaluateScript):
  6083. (JSCheckScriptSyntax):
  6084. (JSGarbageCollect):
  6085. * API/JSBase.h:
  6086. * API/JSCallbackObject.cpp:
  6087. (KJS::JSCallbackObject::JSCallbackObject):
  6088. (KJS::JSCallbackObject::init):
  6089. (KJS::JSCallbackObject::getOwnPropertySlot):
  6090. (KJS::JSCallbackObject::put):
  6091. (KJS::JSCallbackObject::deleteProperty):
  6092. (KJS::JSCallbackObject::toNumber):
  6093. (KJS::JSCallbackObject::toString):
  6094. * API/JSContextRef.cpp:
  6095. (JSGlobalContextCreate):
  6096. (JSGlobalContextRetain):
  6097. (JSGlobalContextRelease):
  6098. (JSContextGetGlobalObject):
  6099. * API/JSContextRef.h:
  6100. * API/JSNode.c:
  6101. (JSNodePrototype_appendChild):
  6102. (JSNodePrototype_removeChild):
  6103. (JSNodePrototype_replaceChild):
  6104. (JSNode_getNodeType):
  6105. (JSNode_getFirstChild):
  6106. (JSNode_prototype):
  6107. * API/JSNodeList.c:
  6108. (JSNodeListPrototype_item):
  6109. (JSNodeList_length):
  6110. (JSNodeList_getProperty):
  6111. (JSNodeList_prototype):
  6112. * API/JSObjectRef.cpp:
  6113. (JSObjectMake):
  6114. (JSObjectMakeFunctionWithCallback):
  6115. (JSObjectMakeConstructor):
  6116. (JSObjectMakeFunction):
  6117. (JSObjectGetPrototype):
  6118. (JSObjectSetPrototype):
  6119. (JSObjectHasProperty):
  6120. (JSObjectGetProperty):
  6121. (JSObjectSetProperty):
  6122. (JSObjectGetPropertyAtIndex):
  6123. (JSObjectSetPropertyAtIndex):
  6124. (JSObjectDeleteProperty):
  6125. (JSObjectIsFunction):
  6126. (JSObjectCallAsFunction):
  6127. (JSObjectIsConstructor):
  6128. (JSObjectCallAsConstructor):
  6129. (JSObjectCopyPropertyNames):
  6130. * API/JSObjectRef.h:
  6131. * API/JSStringRef.cpp:
  6132. * API/JSValueRef.cpp:
  6133. (JSValueGetType):
  6134. (JSValueIsUndefined):
  6135. (JSValueIsNull):
  6136. (JSValueIsBoolean):
  6137. (JSValueIsNumber):
  6138. (JSValueIsString):
  6139. (JSValueIsObject):
  6140. (JSValueIsObjectOfClass):
  6141. (JSValueIsEqual):
  6142. (JSValueIsStrictEqual):
  6143. (JSValueIsInstanceOfConstructor):
  6144. (JSValueMakeUndefined):
  6145. (JSValueMakeNull):
  6146. (JSValueMakeBoolean):
  6147. (JSValueMakeNumber):
  6148. (JSValueMakeString):
  6149. (JSValueToBoolean):
  6150. (JSValueToNumber):
  6151. (JSValueToStringCopy):
  6152. (JSValueToObject):
  6153. (JSValueProtect):
  6154. (JSValueUnprotect):
  6155. * API/JSValueRef.h:
  6156. * API/minidom.c:
  6157. (print):
  6158. * API/testapi.c:
  6159. (MyObject_getProperty):
  6160. (MyObject_deleteProperty):
  6161. (MyObject_callAsFunction):
  6162. (MyObject_callAsConstructor):
  6163. (MyObject_convertToType):
  6164. (print_callAsFunction):
  6165. (main):
  6166. 2006-07-16 Geoffrey Garen <ggaren@apple.com>
  6167. Approved by Maciej, RS by Beth.
  6168. JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
  6169. JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
  6170. because the latter is more common, and more fundamental, than the former.
  6171. * API/APICast.h:
  6172. (toJS):
  6173. * API/JSBase.h:
  6174. * API/JSCallbackObject.cpp:
  6175. (KJS::JSCallbackObject::getOwnPropertySlot):
  6176. (KJS::JSCallbackObject::put):
  6177. (KJS::JSCallbackObject::deleteProperty):
  6178. (KJS::JSCallbackObject::getPropertyNames):
  6179. (KJS::JSCallbackObject::staticValueGetter):
  6180. (KJS::JSCallbackObject::staticFunctionGetter):
  6181. * API/JSClassRef.cpp:
  6182. (OpaqueJSClass::OpaqueJSClass):
  6183. (OpaqueJSClass::~OpaqueJSClass):
  6184. * API/JSClassRef.h:
  6185. * API/JSObjectRef.cpp:
  6186. (JSClassCreate):
  6187. (JSObjectMakeFunctionWithCallback):
  6188. (JSObjectMakeFunction):
  6189. (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
  6190. (JSObjectCopyPropertyNames):
  6191. * API/JSObjectRef.h:
  6192. * API/minidom.c:
  6193. (main):
  6194. * API/testapi.c:
  6195. (main):
  6196. * ChangeLog:
  6197. * JavaScriptCore.exp:
  6198. 2006-07-16 Geoffrey Garen <ggaren@apple.com>
  6199. Laughed at by Beth.
  6200. Replace __JS with OpaqueJS because the former, while used by CF, is
  6201. a prefix that's triply-reserved by the compiler. (_* is reserved in global
  6202. names, _[A-Z] is reserved in all names, and __ is reserved in all names
  6203. in C++.)
  6204. Opaque is an alternative used by other Mac OS X framewokrs.
  6205. * API/APICast.h:
  6206. (toJS):
  6207. * API/JSBase.h:
  6208. * API/JSCallbackObject.cpp:
  6209. (KJS::JSCallbackObject::getOwnPropertySlot):
  6210. (KJS::JSCallbackObject::put):
  6211. (KJS::JSCallbackObject::deleteProperty):
  6212. (KJS::JSCallbackObject::getPropertyNames):
  6213. (KJS::JSCallbackObject::staticValueGetter):
  6214. (KJS::JSCallbackObject::staticFunctionGetter):
  6215. * API/JSClassRef.cpp:
  6216. (OpaqueJSClass::OpaqueJSClass):
  6217. (OpaqueJSClass::~OpaqueJSClass):
  6218. * API/JSClassRef.h:
  6219. * API/JSObjectRef.cpp:
  6220. (JSClassCreate):
  6221. (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
  6222. (JSObjectCopyPropertyNames):
  6223. 2006-07-16 Darin Adler <darin@apple.com>
  6224. - try to fix Windows build
  6225. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6226. Added some recently added files, removed some recently removed.
  6227. 2006-07-16 Geoffrey Garen <ggaren@apple.com>
  6228. Reviewed by Maciej.
  6229. - Change getProperty* to return undefined, rather than NULL, for missing
  6230. properties, since that's what the spec says. Also added exception out
  6231. parameters to the *Index functions, because they can call through to the
  6232. regular functions, which can throw for custom objects.
  6233. * API/JSObjectRef.cpp:
  6234. (JSObjectGetProperty):
  6235. (JSObjectGetPropertyAtIndex):
  6236. (JSObjectSetPropertyAtIndex):
  6237. * API/JSObjectRef.h:
  6238. * API/testapi.c:
  6239. (main):
  6240. 2006-07-16 Geoffrey Garen <ggaren@apple.com>
  6241. Reviewed by Maciej.
  6242. - Properly document and handle NULL callbacks for static properties. We
  6243. throw an exception in any case other than a ReadOnly property with a NULL
  6244. setProperty callback, because a NULL callback almost certainly indicates
  6245. a programming error. Also throw an exception if hasProperty returns true
  6246. for a property that getProperty can't get.
  6247. - If a static setProperty callback returns 'false', to indicate that the
  6248. property was not set, we no longer forward the set request up the class
  6249. chain, because that's almost certainly not what the programmer expected.
  6250. * API/JSCallbackObject.cpp:
  6251. (KJS::JSCallbackObject::getOwnPropertySlot):
  6252. (KJS::JSCallbackObject::put):
  6253. (KJS::JSCallbackObject::staticValueGetter):
  6254. (KJS::JSCallbackObject::staticFunctionGetter):
  6255. (KJS::JSCallbackObject::callbackGetter):
  6256. * API/JSObjectRef.h:
  6257. * API/minidom.js:
  6258. * API/testapi.c:
  6259. (MyObject_hasProperty):
  6260. * API/testapi.js:
  6261. 2006-07-16 Geoffrey Garen <ggaren@apple.com>
  6262. Reviewed by Maciej.
  6263. - Added names to functions.
  6264. - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
  6265. The private data idiom is that a JS object stores its native implementation
  6266. as private data. For functions and constructors, the native implementation is nothing
  6267. more than the callback they already store, so supporting private data, too,
  6268. confuses the idiom. If you *really* want, you can still create a custom
  6269. function with private data.
  6270. * API/JSCallbackConstructor.cpp:
  6271. * API/JSCallbackConstructor.h:
  6272. * API/JSCallbackFunction.cpp:
  6273. (KJS::JSCallbackFunction::JSCallbackFunction):
  6274. * API/JSCallbackFunction.h:
  6275. * API/JSCallbackObject.cpp:
  6276. (KJS::JSCallbackObject::staticFunctionGetter):
  6277. * API/JSObjectRef.cpp:
  6278. (JSObjectMakeFunction):
  6279. (JSObjectMakeFunctionWithBody):
  6280. (JSObjectGetPrivate):
  6281. (JSObjectSetPrivate):
  6282. * API/JSObjectRef.h:
  6283. * API/minidom.c:
  6284. (main):
  6285. * API/testapi.c:
  6286. (main):
  6287. 2006-07-15 Maciej Stachowiak <mjs@apple.com>
  6288. Reviewed by Darin.
  6289. - switch property lists to be vector+set of Identifiers instead of list of References
  6290. This has the following benefits:
  6291. - no duplicates in property lists
  6292. - simplifies API calls
  6293. - probably more efficient, since linked list is gone
  6294. - entirely removed Reference, ReferenceList and ProtectedReference types from the API
  6295. * kjs/PropertyNameArray.cpp: Added.
  6296. (KJS::PropertyNameArray::add): Check set, if not already there, add to
  6297. vector.
  6298. * kjs/PropertyNameArray.h: Added.
  6299. (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
  6300. a set and a vector to make a unique but ordered list of identifiers.
  6301. (KJS::PropertyNameArray::begin): ditto
  6302. (KJS::PropertyNameArray::end): ditto
  6303. (KJS::PropertyNameArray::size): ditto
  6304. (KJS::PropertyNameArray::operator[]): ditto
  6305. * kjs/array_instance.h:
  6306. * kjs/array_object.cpp:
  6307. (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
  6308. for PropertyNameArray
  6309. (ArrayInstance::setLength): updated for PropertyNameArray
  6310. (ArrayInstance::pushUndefinedObjectsToEnd): ditto
  6311. * kjs/nodes.cpp:
  6312. (ForInNode::execute): updated for PropertyNameArray
  6313. * kjs/nodes.h:
  6314. * kjs/object.cpp:
  6315. (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
  6316. for PropertyNameArray
  6317. * kjs/object.h:
  6318. * kjs/property_map.cpp:
  6319. (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
  6320. (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
  6321. * kjs/property_map.h:
  6322. * kjs/protected_reference.h: Removed.
  6323. * kjs/reference.cpp: Removed.
  6324. * kjs/reference.h: Removed.
  6325. * kjs/reference_list.cpp: Removed.
  6326. * kjs/reference_list.h: Removed.
  6327. * kjs/scope_chain.cpp:
  6328. (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
  6329. * kjs/string_object.cpp:
  6330. (StringInstance::getPropertyNames): Updated for new approach.
  6331. * kjs/string_object.h:
  6332. * kjs/ustring.h:
  6333. * API/APICast.h:
  6334. (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
  6335. (toRef): ditto
  6336. * API/JSBase.h:
  6337. * API/JSCallbackObject.cpp:
  6338. (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
  6339. * API/JSCallbackObject.h:
  6340. * API/JSObjectRef.cpp:
  6341. (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
  6342. JSPropertyNameArrayRef.
  6343. (JSObjectCopyPropertyNames): New API call - renamed / refactored from
  6344. JSObjectCreatePropertyList
  6345. (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
  6346. (JSPropertyNameArrayRelease): new release call for - " -.
  6347. (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
  6348. can now get the count and items in any order.
  6349. (JSPropertyNameArrayGetNameAtIndex): See above.
  6350. (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
  6351. accumulator object.
  6352. * API/JSObjectRef.h: Prototyped new functions, removed old ones
  6353. * JavaScriptCore.exp: Updated exported symbols.
  6354. * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
  6355. * API/testapi.c:
  6356. (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
  6357. (main): Updated for new API.
  6358. 2006-07-15 Darin Adler <darin@apple.com>
  6359. - oops, missed a few more arrays that had to be const
  6360. * API/JSNode.c:
  6361. (JSNodePrototype_appendChild): Added const.
  6362. (JSNodePrototype_removeChild): Ditto.
  6363. (JSNodePrototype_replaceChild): Ditto.
  6364. (JSNode_construct): Ditto.
  6365. * API/JSNodeList.c:
  6366. (JSNodeListPrototype_item): Ditto.
  6367. * API/JSObjectRef.cpp:
  6368. (JSObjectMakeFunctionWithBody): Ditto.
  6369. (JSObjectCallAsFunction): Ditto.
  6370. (JSObjectCallAsConstructor): Ditto.
  6371. * API/minidom.c:
  6372. (print): Ditto.
  6373. * API/testapi.c:
  6374. (MyObject_callAsFunction): Ditto.
  6375. (MyObject_callAsConstructor): Ditto.
  6376. (print_callAsFunction): Ditto.
  6377. (myConstructor_callAsConstructor): Ditto.
  6378. 2006-07-15 Darin Adler <darin@apple.com>
  6379. Reviewed by Maciej.
  6380. * API/JSNode.h: Made an array parameter const.
  6381. * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
  6382. 2006-07-15 Geoffrey Garen <ggaren@apple.com>
  6383. Reviewed by Maciej.
  6384. - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
  6385. * API/JSObjectRef.cpp:
  6386. (JSObjectMakeFunctionWithBody):
  6387. * API/JSObjectRef.h:
  6388. * API/testapi.c:
  6389. (assertEqualsAsUTF8String): More informative failure reporting.
  6390. (main): Test more function cases.
  6391. 2006-07-15 Geoffrey Garen <ggaren@apple.com>
  6392. Reviewed by Maciej.
  6393. - Moved the arguments passed to JSClassCreate into a single structure,
  6394. called JSClassDefinition. This will enable easier structure
  6395. migration/versioning in the future, if necessary.
  6396. - Added support for class names.
  6397. - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
  6398. - JSClass is becoming a fairly complex struct, so I migrated all of its
  6399. implementation other than reference counting to the sruct.
  6400. - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
  6401. declared in JSObjectRef.h
  6402. - Also added some more informative explanation to the class structure doc.
  6403. 2006-07-15 Darin Adler <darin@apple.com>
  6404. Reviewed by Geoff.
  6405. - fix http://bugs.webkit.org/show_bug.cgi?id=8395
  6406. <rdar://problem/4613467>
  6407. REGRESSION: RegEx seems broken for hex escaped non breaking space
  6408. Test: fast/js/regexp-extended-characters-more.html
  6409. * pcre/pcre_exec.c:
  6410. (match): Got rid of utf16Length local variable to guarantee there's no
  6411. extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
  6412. code that were using the length variable, which is the UTF-8 length of
  6413. a character in the pattern, to move in the UTF-16 subject string. Instead
  6414. they hardcode lengths of 1 and 2 since the code already handles BMP
  6415. characters and surrogate pairs separately. Also fixed some DPRINTF so
  6416. I could compile with DEBUG on.
  6417. (pcre_exec): Changed a place that was checking for multibyte characters
  6418. in the subject string to use ISMIDCHAR. Instead it was using hardcoded
  6419. logic that was right for UTF-8 but wrong for UTF-16.
  6420. * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
  6421. with DEBUG on.
  6422. 2006-07-14 Geoffrey Garen <ggaren@apple.com>
  6423. RS by Maciej.
  6424. Global replace in the API of argc/argv with argumentCount/arguments.
  6425. 2006-07-14 Geoffrey Garen <ggaren@apple.com>
  6426. Reviewed by Maciej.
  6427. - Finalized exception handling in the API.
  6428. setProperty can throw because it throws for built-in arrays. getProperty
  6429. and deleteProperty can throw because setProperty can throw and we want
  6430. to be consistent, and also because they seem like "actions." callAsFunction,
  6431. callAsConstructor, and hasInstance can throw, because they caan throw for
  6432. all built-ins.
  6433. toBoolean can't throw because it's defined that way in the spec.
  6434. - Documented that toBoolean and toObject can't be overridden by custom
  6435. objects because they're defined that way in the spec.
  6436. === Safari-521.17 ===
  6437. 2006-07-14 Geoffrey Garen <ggaren@apple.com>
  6438. Reviewed by Maciej.
  6439. - Implemented ref-counting of JSContexts by splitting into two datatypes:
  6440. JSGlobalContext, which you can create/retain/release, and JSContext, which
  6441. you can't.
  6442. Internally, you retain a JSGlobalContext/ExecState by retaining its
  6443. interpreter, which, in the case of a global ExecState, owns it.
  6444. - Also made ~Interpreter() protected to catch places where Interpreter
  6445. is manually deleted. (Can't make it private because some crazy fool
  6446. decided it would be a good idea to subclass Interpreter in other frameworks.
  6447. I pity da fool.)
  6448. * API/APICast.h:
  6449. (toJS): Added cast for new JSGlobalContext
  6450. * API/JSStringRef.h: Changed vague "you must" language to more specific
  6451. (but, ultimately, equally vague) "behavior is undefined if you don't"
  6452. language.
  6453. (KJS::Interpreter::Interpreter): Factored more common initialization into
  6454. init()
  6455. * kjs/interpreter.h:
  6456. (KJS::Interpreter::ref): new
  6457. (KJS::Interpreter::deref): new
  6458. (KJS::Interpreter::refCount): new
  6459. * kjs/testkjs.cpp:
  6460. (doIt): Ref-count the interpreter.
  6461. 2006-07-14 Maciej Stachowiak <mjs@apple.com>
  6462. Reviewed by Geoff.
  6463. - removed bool return value from JSObjectSetProperty, since it is inefficient and
  6464. also doesn't work quite right
  6465. - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
  6466. * API/JSObjectRef.cpp:
  6467. (JSObjectSetProperty): Removed return value and canPut stuff.
  6468. (JSObjectGetPropertyAtIndex): Added.
  6469. (JSObjectSetPropertyAtIndex): Added.
  6470. * API/JSObjectRef.h: Prototyped and documented new functions.
  6471. 2006-07-14 Geoffrey Garen <ggaren@apple.com>
  6472. Reviewed by Beth.
  6473. Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
  6474. JSBase.h/.cpp. They don't belong in the value-specific or context-specific
  6475. files because they're not part of the value or context implementations.
  6476. * API/JSBase.h:
  6477. * API/JSContextRef.cpp:
  6478. (JSContextGetGlobalObject):
  6479. * API/JSContextRef.h:
  6480. * API/JSValueRef.cpp:
  6481. (JSValueUnprotect):
  6482. * API/JSValueRef.h:
  6483. * JavaScriptCore.xcodeproj/project.pbxproj:
  6484. 2006-07-13 Timothy Hatcher <timothy@apple.com>
  6485. Reviewed by Maciej.
  6486. Moved JavaScriptCore to be a public framework.
  6487. * JavaScriptCore.xcodeproj/project.pbxproj:
  6488. 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
  6489. Reviewed by Geoffrey.
  6490. http://bugs.webkit.org/show_bug.cgi?id=9742
  6491. Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
  6492. * kjs/value.h:
  6493. (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
  6494. 2006-07-13 Geoffrey Garen <ggaren@apple.com>
  6495. Pleasing to Maciej.
  6496. - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
  6497. - Added exception out parameters to JSValueTo* and JSValueIsEqual because
  6498. they can throw
  6499. - Removed JSObjectGetDescription because it's useless and vague, and
  6500. JSValueToString/JSValueIsObjectOfClass do a better job, anyway
  6501. - Clarified comments about "IsFunction/Constructor" to indicate that they
  6502. are true of all functions/constructors, not just those created by JSObjectMake*
  6503. 2006-07-12 Geoffrey Garen <ggaren@apple.com>
  6504. RS by Beth.
  6505. Finished previously approved JSInternalString -> JSString conversion
  6506. by renaming the files.
  6507. * API/JSCallbackObject.cpp:
  6508. * API/JSInternalStringRef.cpp: Removed.
  6509. * API/JSInternalStringRef.h: Removed.
  6510. * API/JSStringRef.cpp: Added.
  6511. * API/JSStringRef.h: Added.
  6512. * API/JavaScriptCore.h:
  6513. * JavaScriptCore.xcodeproj/project.pbxproj:
  6514. 2006-07-12 Geoffrey Garen <ggaren@apple.com>
  6515. Reviewed by Maciej.
  6516. - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
  6517. removing the spurious use of ExecState inside JavaScriptCore that made
  6518. us think this was necessary in the first place.
  6519. (StringInstance::getPropertyList): Use getString instead of toString because
  6520. we know we're dealing with a string -- we put it there in the first place.
  6521. While we're at it, store the string's size instead of retrieving it each time
  6522. through the loop, to avoid the unnecessary killing of puppies.
  6523. * kjs/string_object.h:
  6524. 2006-07-12 Maciej Stachowiak <mjs@apple.com>
  6525. Reviewed by Geoff.
  6526. - add handling of hasInstance callback for API objects
  6527. * API/JSCallbackObject.cpp:
  6528. (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
  6529. (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
  6530. * API/JSCallbackObject.h:
  6531. * API/JSClassRef.cpp:
  6532. * API/JSObjectRef.h:
  6533. * API/testapi.c:
  6534. (MyObject_hasInstance): Test case; should match what construct would do.
  6535. * API/testapi.js:
  6536. 2006-07-11 Geoffrey Garen <ggaren@apple.com>
  6537. Reviewed by Maciej.
  6538. - Implemented a vast number of renames and comment clarifications
  6539. suggested during API review.
  6540. JSInternalString -> JSString
  6541. JS*Make -> JSValueMake*, JSObjectMake*
  6542. JSTypeCode -> JSType
  6543. JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
  6544. JSGC*Protect -> JSValue*Protect
  6545. JS*Callback -> JSObject*Callback
  6546. JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
  6547. JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
  6548. JSString* ->
  6549. JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
  6550. JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
  6551. JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
  6552. - Changed functions taking a JSValue out arg and returning a bool indicating
  6553. whether it was set to simply return a JSValue or NULL.
  6554. - Removed JSStringGetCharacters because it's more documentation than code,
  6555. and it's just a glorified memcpy built on existing API functionality.
  6556. - Moved standard library includes into the headers that actually require them.
  6557. - Standardized use of the phrase "Create Rule."
  6558. - Removed JSLock from make functions that don't allocate.
  6559. - Added exception handling to JSValueToBoolean, since we now allow
  6560. callback objects to throw exceptions upon converting to boolean.
  6561. - Renamed JSGCCollect to JSGarbageCollect.
  6562. 2006-07-10 Geoffrey Garen <ggaren@apple.com>
  6563. Reviewed by Darin.
  6564. - Changed public header includes to the <JavaScriptCore/ style.
  6565. - Changed instances of 'buffer' to 'string' since we decided on
  6566. JSInternalString instead of JSStringBuffer.
  6567. * API/JSContextRef.h:
  6568. * API/JSInternalStringRef.cpp:
  6569. (JSStringMake):
  6570. (JSInternalStringRetain):
  6571. (JSInternalStringRelease):
  6572. (JSValueCopyStringValue):
  6573. (JSInternalStringGetLength):
  6574. (JSInternalStringGetCharactersPtr):
  6575. (JSInternalStringGetCharacters):
  6576. (JSInternalStringGetMaxLengthUTF8):
  6577. (JSInternalStringGetCharactersUTF8):
  6578. (CFStringCreateWithJSInternalString):
  6579. * API/JSInternalStringRef.h:
  6580. * API/JSNode.c:
  6581. (JSNodePrototype_appendChild):
  6582. (JSNode_getNodeType):
  6583. * API/JSObjectRef.cpp:
  6584. (JSObjectCallAsConstructor):
  6585. * API/JSValueRef.h:
  6586. * API/JavaScriptCore.h:
  6587. * API/minidom.c:
  6588. (main):
  6589. (print):
  6590. * API/testapi.c:
  6591. (MyObject_getPropertyList):
  6592. (myConstructor_callAsConstructor):
  6593. (main): I noticed that we were prematurely releasing some string buffers,
  6594. so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
  6595. (sometimes changing to 'IString', when necessary to differentiate a variable)
  6596. to match the buffer->string change.
  6597. === Safari-521.16 ===
  6598. 2006-07-10 Darin Adler <darin@apple.com>
  6599. * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
  6600. Just in case.
  6601. 2006-07-10 Darin Adler <darin@apple.com>
  6602. - fix the release build
  6603. * kjs/value.h:
  6604. * kjs/value.cpp:
  6605. (KJS::JSValue::toInt32Inline): Move the code here to an inline.
  6606. (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
  6607. 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
  6608. Reviewed by Darin.
  6609. - fix http://bugs.webkit.org/show_bug.cgi?id=9179
  6610. Implement select.options.add() method
  6611. * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
  6612. * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
  6613. kjs/value.h to make it available as a forwarded header.
  6614. * kjs/lookup.h:
  6615. (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
  6616. The new method returns a boolean value if no entry is found in the lookup table.
  6617. * kjs/value.cpp:
  6618. (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
  6619. * kjs/value.h: Ditto.
  6620. 2006-07-10 Geoffrey Garen <ggaren@apple.com>
  6621. No review necessary. Removed bogus file I accidentally checked in before.
  6622. * API/JSInternalSringRef.h: Removed.
  6623. 2006-07-10 Geoffrey Garen <ggaren@apple.com>
  6624. Reviewed by Darin.
  6625. Added exception out parameter to API object callbacks, removed semi-bogus
  6626. JSContext(.*)Exception functions.
  6627. To make these calls syntactically simple, I added an exceptionSlot()
  6628. method to the ExecState class, which provides a JSValue** slot in which to
  6629. store a JSValue* exception.
  6630. * API/APICast.h:
  6631. (toRef):
  6632. * API/JSCallbackConstructor.cpp:
  6633. (KJS::JSCallbackConstructor::construct):
  6634. * API/JSCallbackFunction.cpp:
  6635. (KJS::JSCallbackFunction::callAsFunction):
  6636. * API/JSCallbackObject.cpp:
  6637. (KJS::JSCallbackObject::init):
  6638. (KJS::JSCallbackObject::getOwnPropertySlot):
  6639. (KJS::JSCallbackObject::put):
  6640. (KJS::JSCallbackObject::deleteProperty):
  6641. (KJS::JSCallbackObject::construct):
  6642. (KJS::JSCallbackObject::callAsFunction):
  6643. (KJS::JSCallbackObject::getPropertyList):
  6644. (KJS::JSCallbackObject::toBoolean):
  6645. (KJS::JSCallbackObject::toNumber):
  6646. (KJS::JSCallbackObject::toString):
  6647. (KJS::JSCallbackObject::staticValueGetter):
  6648. (KJS::JSCallbackObject::callbackGetter):
  6649. * API/JSContextRef.cpp:
  6650. (JSCheckSyntax):
  6651. * API/JSContextRef.h:
  6652. * API/JSNode.c:
  6653. (JSNodePrototype_appendChild):
  6654. (JSNodePrototype_removeChild):
  6655. (JSNodePrototype_replaceChild):
  6656. (JSNode_getNodeType):
  6657. (JSNode_getChildNodes):
  6658. (JSNode_getFirstChild):
  6659. (JSNode_construct):
  6660. * API/JSNode.h:
  6661. * API/JSNodeList.c:
  6662. (JSNodeListPrototype_item):
  6663. (JSNodeList_length):
  6664. (JSNodeList_getProperty):
  6665. * API/JSObjectRef.h:
  6666. * API/minidom.c:
  6667. (print):
  6668. * API/testapi.c:
  6669. (MyObject_initialize):
  6670. (MyObject_hasProperty):
  6671. (MyObject_getProperty):
  6672. (MyObject_setProperty):
  6673. (MyObject_deleteProperty):
  6674. (MyObject_getPropertyList):
  6675. (MyObject_callAsFunction):
  6676. (MyObject_callAsConstructor):
  6677. (MyObject_convertToType):
  6678. (print_callAsFunction):
  6679. (myConstructor_callAsConstructor):
  6680. (main):
  6681. * JavaScriptCore.exp:
  6682. * kjs/ExecState.h:
  6683. (KJS::ExecState::exceptionHandle):
  6684. 2006-07-10 Geoffrey Garen <ggaren@apple.com>
  6685. Reviewed by Darin.
  6686. Improved type safety by implementing opaque JSValue/JSObject typing through
  6687. abuse of 'const', not void*. Also fixed an alarming number of bugs
  6688. exposed by this new type safety.
  6689. I made one design change in JavaScriptCore, which is that the JSObject
  6690. constructor should take a JSValue* as its prototype argument, not a JSObject*,
  6691. since we allow the prototype to be any JSValue*, including jsNull(), for
  6692. example.
  6693. * API/APICast.h:
  6694. (toJS):
  6695. * API/JSBase.h:
  6696. * API/JSCallbackConstructor.cpp:
  6697. (KJS::JSCallbackConstructor::construct):
  6698. * API/JSCallbackFunction.cpp:
  6699. (KJS::JSCallbackFunction::callAsFunction):
  6700. * API/JSCallbackObject.cpp:
  6701. (KJS::JSCallbackObject::JSCallbackObject):
  6702. (KJS::JSCallbackObject::getOwnPropertySlot):
  6703. (KJS::JSCallbackObject::put):
  6704. (KJS::JSCallbackObject::construct):
  6705. (KJS::JSCallbackObject::callAsFunction):
  6706. (KJS::JSCallbackObject::staticFunctionGetter):
  6707. * API/JSCallbackObject.h:
  6708. * API/JSContextRef.cpp:
  6709. (JSEvaluate):
  6710. * API/JSNode.c:
  6711. (JSNodePrototype_appendChild):
  6712. (JSNodePrototype_removeChild):
  6713. (JSNodePrototype_replaceChild):
  6714. * API/JSObjectRef.cpp:
  6715. (JSObjectMake):
  6716. (JSFunctionMakeWithBody):
  6717. (JSObjectGetProperty):
  6718. (JSObjectCallAsFunction):
  6719. (JSObjectCallAsConstructor):
  6720. * API/JSObjectRef.h:
  6721. * API/testapi.c:
  6722. (main):
  6723. * ChangeLog:
  6724. * kjs/object.h:
  6725. (KJS::JSObject::JSObject):
  6726. 2006-07-10 Geoffrey Garen <ggaren@apple.com>
  6727. Approved by Maciej, Darin.
  6728. Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
  6729. JavaScript engine's internal string representation, which is the most
  6730. low-level and efficient representation to use when interfacing with JavaScript.
  6731. * API/APICast.h:
  6732. (toJS):
  6733. (toRef):
  6734. * API/JSBase.h:
  6735. * API/JSCallbackObject.cpp:
  6736. (KJS::JSCallbackObject::getOwnPropertySlot):
  6737. (KJS::JSCallbackObject::put):
  6738. (KJS::JSCallbackObject::deleteProperty):
  6739. (KJS::JSCallbackObject::staticValueGetter):
  6740. (KJS::JSCallbackObject::callbackGetter):
  6741. * API/JSContextRef.cpp:
  6742. (JSEvaluate):
  6743. (JSCheckSyntax):
  6744. * API/JSContextRef.h:
  6745. * API/JSInternalStringRef.cpp: Added.
  6746. (JSStringMake):
  6747. (JSInternalStringCreate):
  6748. (JSInternalStringCreateUTF8):
  6749. (JSInternalStringRetain):
  6750. (JSInternalStringRelease):
  6751. (JSValueCopyStringValue):
  6752. (JSInternalStringGetLength):
  6753. (JSInternalStringGetCharactersPtr):
  6754. (JSInternalStringGetCharacters):
  6755. (JSInternalStringGetMaxLengthUTF8):
  6756. (JSInternalStringGetCharactersUTF8):
  6757. (JSInternalStringIsEqual):
  6758. (JSInternalStringIsEqualUTF8):
  6759. (JSInternalStringCreateCF):
  6760. (CFStringCreateWithJSInternalString):
  6761. * API/JSInternalStringRef.h: Added.
  6762. * API/JSNode.c:
  6763. (JSNodePrototype_appendChild):
  6764. (JSNode_getNodeType):
  6765. (JSNode_getChildNodes):
  6766. (JSNode_getFirstChild):
  6767. * API/JSNodeList.c:
  6768. (JSNodeList_length):
  6769. (JSNodeList_getProperty):
  6770. * API/JSObjectRef.cpp:
  6771. (JSFunctionMakeWithBody):
  6772. (JSObjectGetDescription):
  6773. (JSObjectHasProperty):
  6774. (JSObjectGetProperty):
  6775. (JSObjectSetProperty):
  6776. (JSObjectDeleteProperty):
  6777. (JSPropertyEnumeratorGetNext):
  6778. (JSPropertyListAdd):
  6779. * API/JSObjectRef.h:
  6780. * API/JSStringBufferRef.cpp: Removed.
  6781. * API/JSStringBufferRef.h: Removed.
  6782. * API/JSValueRef.h:
  6783. * API/JavaScriptCore.h:
  6784. * API/minidom.c:
  6785. (main):
  6786. (print):
  6787. * API/testapi.c:
  6788. (assertEqualsAsUTF8String):
  6789. (assertEqualsAsCharactersPtr):
  6790. (assertEqualsAsCharacters):
  6791. (MyObject_hasProperty):
  6792. (MyObject_getProperty):
  6793. (MyObject_setProperty):
  6794. (MyObject_deleteProperty):
  6795. (MyObject_getPropertyList):
  6796. (print_callAsFunction):
  6797. (myConstructor_callAsConstructor):
  6798. (main):
  6799. * JavaScriptCore.exp:
  6800. * JavaScriptCore.xcodeproj/project.pbxproj:
  6801. 2006-07-08 Tim Omernick <timo@apple.com>
  6802. Reviewed by Maciej.
  6803. Added an OpenGL drawing model to the Netscape Plug-in API.
  6804. * bindings/npapi.h:
  6805. 2006-07-08 Timothy Hatcher <timothy@apple.com>
  6806. Reviewed by Maciej.
  6807. Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
  6808. Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
  6809. now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
  6810. are deprecated in Leopard.
  6811. * JavaScriptCore.exp:
  6812. * JavaScriptCore.xcodeproj/project.pbxproj:
  6813. * bindings/jni/jni_utility.cpp:
  6814. (KJS::Bindings::KJS_GetCreatedJavaVMs):
  6815. * bindings/softlinking.c: Removed.
  6816. * bindings/softlinking.h: Removed.
  6817. 2006-07-08 Geoffrey Garen <ggaren@apple.com>
  6818. Reviewed by Anders.
  6819. - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
  6820. * API/JSObjectRef.cpp:
  6821. (JSObjectGetProperty):
  6822. * API/JSObjectRef.h:
  6823. * API/testapi.c:
  6824. (main):
  6825. 2006-07-08 Geoffrey Garen <ggaren@apple.com>
  6826. Style change -- no review necessary.
  6827. Use 0 instead of NULL in API .cpp files, to match our style guidelines.
  6828. * API/JSContextRef.cpp:
  6829. (JSEvaluate):
  6830. * API/JSObjectRef.cpp:
  6831. (JSFunctionMakeWithBody):
  6832. (JSObjectCallAsFunction):
  6833. (JSObjectCallAsConstructor):
  6834. * API/JSValueRef.cpp:
  6835. (JSValueToObject):
  6836. 2006-07-08 Geoffrey Garen <ggaren@apple.com>
  6837. Reviewed by TimO.
  6838. - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
  6839. to match JSEvaluate.
  6840. * API/JSObjectRef.cpp:
  6841. (JSObjectCallAsFunction):
  6842. * API/JSObjectRef.h:
  6843. * API/testapi.c:
  6844. (main):
  6845. === Safari-521.15 ===
  6846. 2006-07-07 Geoffrey Garen <ggaren@apple.com>
  6847. Reviewed by Maciej.
  6848. - Standardized which functions take a JSContext as an argument. The rule is:
  6849. if you might execute JavaScript, you take a JSContext, otherwise you don't.
  6850. The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
  6851. but not API changes, so I'm putting it off until later.
  6852. * API/JSCallbackObject.cpp:
  6853. (KJS::JSCallbackObject::JSCallbackObject):
  6854. (KJS::JSCallbackObject::init):
  6855. * API/JSCallbackObject.h:
  6856. * API/JSContextRef.cpp:
  6857. (JSContextCreate):
  6858. * API/JSContextRef.h:
  6859. * API/JSObjectRef.cpp:
  6860. (JSObjectMake):
  6861. (JSPropertyEnumeratorGetNext):
  6862. * API/JSObjectRef.h:
  6863. * API/testapi.c:
  6864. (MyObject_initialize):
  6865. (main):
  6866. * JavaScriptCore.exp:
  6867. * kjs/array_object.cpp:
  6868. (ArrayInstance::setLength):
  6869. (ArrayInstance::pushUndefinedObjectsToEnd):
  6870. * kjs/nodes.cpp:
  6871. (ForInNode::execute):
  6872. * kjs/reference.cpp:
  6873. (KJS::Reference::getPropertyName):
  6874. (KJS::Reference::getValue):
  6875. * kjs/reference.h:
  6876. * kjs/scope_chain.cpp:
  6877. (KJS::ScopeChain::print):
  6878. 2006-07-06 Geoffrey Garen <ggaren@apple.com>
  6879. Reviewed by Maciej.
  6880. More API action.
  6881. - Headerdoc finished
  6882. Semantic Changes:
  6883. - Added a JSContextRef argument to many functions, because you need a
  6884. JSContextRef for doing virtually anything. I expect to add this argument
  6885. to even more functions in a future patch.
  6886. - Removed the globalObjectPrototype argument to JSContextCreate because
  6887. you can't create an object until you have a context, so it's impossible
  6888. to pass a prototype object to JSContextCreate. That's OK because (1) there's
  6889. no reason to give the global object a prototype and (2) if you really want
  6890. to, you can just use a separate call to JSObjectSetPrototype.
  6891. - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
  6892. and you need to be able to make the global object's class before you've
  6893. created a JSContext.
  6894. - Added an optional exception parameter to JSFunctionMakeWithBody because anything
  6895. less would be uncivilized.
  6896. - Made the return value parameter to JSObjectGetProperty optional to match
  6897. all other return value parameters in the API.
  6898. - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
  6899. and JSCallbackConstructors. You could use an abstract base class or strategic
  6900. placement of m_privateData in the class structure to implement this, but
  6901. the former seemed like overkill, and the latter seemed too dangerous.
  6902. - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
  6903. Cosmetic Changes:
  6904. - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
  6905. - Removed function names from @function declarations because headeroc
  6906. can parse them automatically, and I wanted to rule out manual mismatch.
  6907. - Changed Error::create to take a const UString& instead of a UString*
  6908. because it was looking at me funny.
  6909. - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
  6910. because the latter is more concise and it matches JSStringBufferCreateUTF8.
  6911. * API/JSCallbackObject.cpp:
  6912. (KJS::JSCallbackObject::getOwnPropertySlot):
  6913. (KJS::JSCallbackObject::put):
  6914. (KJS::JSCallbackObject::deleteProperty):
  6915. (KJS::JSCallbackObject::getPropertyList):
  6916. (KJS::JSCallbackObject::toBoolean):
  6917. (KJS::JSCallbackObject::toNumber):
  6918. (KJS::JSCallbackObject::toString):
  6919. * API/JSClassRef.cpp:
  6920. (JSClassCreate):
  6921. * API/JSContextRef.cpp:
  6922. (JSContextCreate):
  6923. (JSContextSetException):
  6924. * API/JSContextRef.h:
  6925. * API/JSNode.c:
  6926. (JSNodePrototype_class):
  6927. (JSNode_class):
  6928. * API/JSNodeList.c:
  6929. (JSNodeListPrototype_class):
  6930. (JSNodeList_class):
  6931. * API/JSObjectRef.cpp:
  6932. (JSObjectGetProperty):
  6933. (JSObjectGetPrivate):
  6934. (JSObjectSetPrivate):
  6935. (JSObjectCallAsFunction):
  6936. (JSObjectCallAsConstructor):
  6937. (JSPropertyEnumeratorGetNext):
  6938. * API/JSObjectRef.h:
  6939. * API/JSStringBufferRef.cpp:
  6940. (JSStringBufferCreateCF):
  6941. * API/JSStringBufferRef.h:
  6942. * API/JSValueRef.cpp:
  6943. (JSValueIsInstanceOf):
  6944. * API/JSValueRef.h:
  6945. * API/minidom.c:
  6946. (main):
  6947. * API/minidom.js:
  6948. * API/testapi.c:
  6949. (MyObject_hasProperty):
  6950. (MyObject_setProperty):
  6951. (MyObject_deleteProperty):
  6952. (MyObject_getPropertyList):
  6953. (MyObject_convertToType):
  6954. (MyObject_class):
  6955. (main):
  6956. * JavaScriptCore.exp:
  6957. 2006-07-07 Geoffrey Garen <ggaren@apple.com>
  6958. Reviewed by John.
  6959. - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
  6960. * API/JSClassRef.cpp:
  6961. (JSClassCreate):
  6962. (JSClassRelease):
  6963. * API/testapi.c: Added test for NULL parameters.
  6964. (main):
  6965. 2006-07-07 Geoffrey Garen <ggaren@apple.com>
  6966. Reviewed by John, mocked by Darin.
  6967. - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
  6968. "this," since "this" must be an object.
  6969. * API/JSContextRef.cpp:
  6970. (JSEvaluate):
  6971. * API/JSContextRef.h:
  6972. 2006-07-07 Geoffrey Garen <ggaren@apple.com>
  6973. Reviewed by John.
  6974. - More headerdoc
  6975. * API/JSBase.h:
  6976. * JavaScriptCore.xcodeproj/project.pbxproj:
  6977. 2006-07-05 Geoffrey Garen <ggaren@apple.com>
  6978. RS by Beth.
  6979. Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
  6980. which, hopefully, will be less unpopular.
  6981. * API/APICast.h:
  6982. (toJS):
  6983. (toRef):
  6984. * API/JSBase.h:
  6985. * API/JSCallbackObject.cpp:
  6986. (KJS::JSCallbackObject::getOwnPropertySlot):
  6987. (KJS::JSCallbackObject::put):
  6988. (KJS::JSCallbackObject::deleteProperty):
  6989. (KJS::JSCallbackObject::staticValueGetter):
  6990. (KJS::JSCallbackObject::callbackGetter):
  6991. * API/JSCharBufferRef.cpp: Removed.
  6992. * API/JSCharBufferRef.h: Removed.
  6993. * API/JSContextRef.cpp:
  6994. (JSEvaluate):
  6995. (JSCheckSyntax):
  6996. * API/JSContextRef.h:
  6997. * API/JSNode.c:
  6998. (JSNodePrototype_appendChild):
  6999. (JSNode_getNodeType):
  7000. (JSNode_getChildNodes):
  7001. (JSNode_getFirstChild):
  7002. * API/JSNodeList.c:
  7003. (JSNodeList_length):
  7004. (JSNodeList_getProperty):
  7005. * API/JSObjectRef.cpp:
  7006. (JSFunctionMakeWithBody):
  7007. (JSObjectGetDescription):
  7008. (JSObjectHasProperty):
  7009. (JSObjectGetProperty):
  7010. (JSObjectSetProperty):
  7011. (JSObjectDeleteProperty):
  7012. (JSPropertyEnumeratorGetNext):
  7013. (JSPropertyListAdd):
  7014. * API/JSObjectRef.h:
  7015. * API/JSStringBufferRef.cpp: Added.
  7016. (JSStringMake):
  7017. (JSStringBufferCreate):
  7018. (JSStringBufferCreateUTF8):
  7019. (JSStringBufferRetain):
  7020. (JSStringBufferRelease):
  7021. (JSValueCopyStringValue):
  7022. (JSStringBufferGetLength):
  7023. (JSStringBufferGetCharactersPtr):
  7024. (JSStringBufferGetCharacters):
  7025. (JSStringBufferGetMaxLengthUTF8):
  7026. (JSStringBufferGetCharactersUTF8):
  7027. (JSStringBufferIsEqual):
  7028. (JSStringBufferIsEqualUTF8):
  7029. (JSStringBufferCreateWithCFString):
  7030. (CFStringCreateWithJSStringBuffer):
  7031. * API/JSStringBufferRef.h: Added.
  7032. * API/JSValueRef.h:
  7033. * API/JavaScriptCore.h:
  7034. * API/minidom.c:
  7035. (main):
  7036. (print):
  7037. * API/testapi.c:
  7038. (assertEqualsAsUTF8String):
  7039. (assertEqualsAsCharactersPtr):
  7040. (assertEqualsAsCharacters):
  7041. (MyObject_hasProperty):
  7042. (MyObject_getProperty):
  7043. (MyObject_setProperty):
  7044. (MyObject_deleteProperty):
  7045. (MyObject_getPropertyList):
  7046. (print_callAsFunction):
  7047. (myConstructor_callAsConstructor):
  7048. (main):
  7049. * JavaScriptCore.exp:
  7050. * JavaScriptCore.xcodeproj/project.pbxproj:
  7051. 2006-07-05 Geoffrey Garen <ggaren@apple.com>
  7052. RS by Beth.
  7053. Moved some code around for more logical file separation.
  7054. * API/JSBase.h:
  7055. * API/JSContextRef.h:
  7056. * API/JSObjectRef.cpp:
  7057. * API/JSValueRef.cpp:
  7058. (JSValueToObject):
  7059. * API/JSValueRef.h:
  7060. 2006-07-03 Geoffrey Garen <ggaren@apple.com>
  7061. Reviewed by Maciej.
  7062. Implemented JSFunctionMakeWithBody, which parses a script as a function body
  7063. in the global scope, and returns the resulting anonymous function.
  7064. I also removed private data from JSCallbackFunction. It never worked,
  7065. since JSCallbackFunction doesn't inherit from JSCallbackObject.
  7066. * API/JSCallbackConstructor.cpp: Removed.
  7067. * API/JSCallbackConstructor.h: Removed.
  7068. * API/JSCallbackFunction.cpp:
  7069. (KJS::JSCallbackFunction::JSCallbackFunction):
  7070. (KJS::JSCallbackFunction::implementsConstruct):
  7071. (KJS::JSCallbackFunction::construct):
  7072. (KJS::JSCallbackFunction::implementsCall):
  7073. (KJS::JSCallbackFunction::callAsFunction):
  7074. * API/JSCallbackFunction.h:
  7075. * API/JSCallbackObject.cpp:
  7076. (KJS::JSCallbackObject::staticFunctionGetter):
  7077. * API/JSObjectRef.cpp:
  7078. (JSFunctionMake):
  7079. (JSFunctionMakeWithCallbacks):
  7080. * API/JSObjectRef.h:
  7081. * API/JSValueRef.h:
  7082. * API/minidom.c:
  7083. (main):
  7084. * API/testapi.c:
  7085. (main):
  7086. * JavaScriptCore.exp: Programmatically added all symbols exported by
  7087. API object files, and sorted results
  7088. * JavaScriptCore.xcodeproj/project.pbxproj:
  7089. 2006-07-03 Geoffrey Garen <ggaren@apple.com>
  7090. Reviewed by Maciej.
  7091. - Return syntax error in JSCheckSyntax through a JSValueRef* exception
  7092. argument
  7093. * API/JSBase.h:
  7094. * API/JSContextRef.cpp:
  7095. (JSCheckSyntax):
  7096. * API/testapi.c:
  7097. (main):
  7098. * JavaScriptCore.exp:
  7099. * kjs/interpreter.cpp:
  7100. (KJS::Interpreter::checkSyntax):
  7101. * kjs/interpreter.h:
  7102. 2006-07-04 Darin Adler <darin@apple.com>
  7103. - fixed build
  7104. * wtf/MathExtras.h: Oops. Added missing #endif.
  7105. 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
  7106. Reviewed by Maciej.
  7107. Tweaked a bit by Darin.
  7108. - http://bugs.webkit.org/show_bug.cgi?id=9678
  7109. work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
  7110. * wtf/MathExtras.h: Added include of <float.h>.
  7111. (isinf): Fix to return false for NAN.
  7112. (wtf_fmod): Added. An inline that works around the bug.
  7113. * kjs/nodes.cpp:
  7114. * kjs/number_object.cpp:
  7115. * kjs/operations.cpp:
  7116. * kjs/value.cpp:
  7117. Added includes of MathExtras.h to all files using fmod.
  7118. * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
  7119. the project.
  7120. 2006-07-01 Geoffrey Garen <ggaren@apple.com>
  7121. Reviewed by Darin.
  7122. - Refined value conversions in the API:
  7123. - failed toNumber returns NaN
  7124. - failed toObject returns NULL
  7125. - failed toString returns empty string
  7126. - Refined excpetion handling in the API:
  7127. - failed value conversions do not throw exceptions
  7128. - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
  7129. JSObjectCallAsConstructor are returned through a JSValueRef* exception
  7130. argument
  7131. - removed JSContextHasException, because JSContextGetException does
  7132. the same job
  7133. * API/JSBase.h:
  7134. * API/JSCharBufferRef.cpp:
  7135. (JSValueCopyStringValue):
  7136. * API/JSContextRef.cpp:
  7137. (JSEvaluate):
  7138. * API/JSContextRef.h:
  7139. * API/JSNodeList.c: Added test code demonstrating how you would use
  7140. toNumber, and why you probably don't need toUInt32, etc.
  7141. (JSNodeListPrototype_item):
  7142. (JSNodeList_getProperty):
  7143. * API/JSObjectRef.cpp:
  7144. (JSValueToObject):
  7145. (JSObjectCallAsFunction):
  7146. (JSObjectCallAsConstructor):
  7147. * API/JSObjectRef.h:
  7148. * API/JSValueRef.cpp:
  7149. (JSValueToNumber):
  7150. * API/JSValueRef.h:
  7151. * API/minidom.c:
  7152. (main):
  7153. * API/testapi.c:
  7154. (main): Added tests for new rules, and call to JSGCProtect to fix Intel
  7155. crash
  7156. * JavaScriptCore.exp:
  7157. 2006-07-03 Darin Adler <darin@apple.com>
  7158. - Rolled out HashMap implementation of NPRuntime, at least temporarily.
  7159. Fixes hang in the bindings section of layout tests seen on the
  7160. buildbot.
  7161. This code was using HashMap<const char*, PrivateIdentifier*>.
  7162. But that hashes based on pointer identity, not string value.
  7163. The default hash for any pointer type is to hash based on the pointer.
  7164. And WTF doesn't currently have a string hash for char*.
  7165. We'll need to fix that before re-landing this patch.
  7166. (Formatting was also incorrect -- extra spaces in parentheses.)
  7167. * bindings/npruntime.cpp: Rolled out last change.
  7168. 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
  7169. Reviewed, tweaked, landed by ggaren.
  7170. - Port NPRuntime from CFDictionary to HashMap.
  7171. * bindings/npruntime.cpp:
  7172. (getStringIdentifierDictionary):
  7173. (getIntIdentifierDictionary):
  7174. (_NPN_GetStringIdentifier):
  7175. (_NPN_GetIntIdentifier):
  7176. * bindings/npruntime.h:
  7177. 2006-07-01 Geoffrey Garen <ggaren@apple.com>
  7178. Reviewed by Adele.
  7179. - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
  7180. fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
  7181. * JavaScriptCore.exp: Export symbols used by liveconnect
  7182. 2006-06-29 Geoffrey Garen <ggaren@apple.com>
  7183. Reviewed by Maciej.
  7184. - Phase 2 in the JS API.
  7185. - Added support for specifying static tables of values -- this should
  7186. obviate the need for using complicated callbacks for most lookups.
  7187. - API objects are now created with classes (JSClassRef) -- in order to support
  7188. static values, and in order to prevent API objects from storing their
  7189. data inline, and thus falling into the oversized (read: slow and prone to
  7190. giving Maciej the frowny face) heap.
  7191. - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
  7192. to allow JSFunctionMake and JSConstructorMake to continue to work with
  7193. the new class model. Another solution to this problem would be to create
  7194. a custom class object for each function and constructor you make. This
  7195. solution is more code but also more efficient.
  7196. - Substantially beefed up the minidom example to demonstrate and test a
  7197. lot of these techniques. Its output is still pretty haphazard, though.
  7198. - Gave the <kjs/ preface to some includes -- I'm told this matters to
  7199. building on some versions of Linux.
  7200. - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
  7201. - Removed GetDescription callback. Something in the class datastructure
  7202. should take care of this.
  7203. * API/JSBase.h:
  7204. * API/JSCallbackConstructor.cpp: Added.
  7205. (KJS::):
  7206. (KJS::JSCallbackConstructor::JSCallbackConstructor):
  7207. (KJS::JSCallbackConstructor::implementsConstruct):
  7208. (KJS::JSCallbackConstructor::construct):
  7209. (KJS::JSCallbackConstructor::setPrivate):
  7210. (KJS::JSCallbackConstructor::getPrivate):
  7211. * API/JSCallbackConstructor.h: Added.
  7212. (KJS::JSCallbackConstructor::classInfo):
  7213. * API/JSCallbackFunction.cpp: Added.
  7214. (KJS::):
  7215. (KJS::JSCallbackFunction::JSCallbackFunction):
  7216. (KJS::JSCallbackFunction::implementsCall):
  7217. (KJS::JSCallbackFunction::callAsFunction):
  7218. (KJS::JSCallbackFunction::setPrivate):
  7219. (KJS::JSCallbackFunction::getPrivate):
  7220. * API/JSCallbackFunction.h: Added.
  7221. (KJS::JSCallbackFunction::classInfo):
  7222. * API/JSCallbackObject.cpp:
  7223. (KJS::):
  7224. (KJS::JSCallbackObject::JSCallbackObject):
  7225. (KJS::JSCallbackObject::init):
  7226. (KJS::JSCallbackObject::~JSCallbackObject):
  7227. (KJS::JSCallbackObject::className):
  7228. (KJS::JSCallbackObject::getOwnPropertySlot):
  7229. (KJS::JSCallbackObject::put):
  7230. (KJS::JSCallbackObject::deleteProperty):
  7231. (KJS::JSCallbackObject::implementsConstruct):
  7232. (KJS::JSCallbackObject::construct):
  7233. (KJS::JSCallbackObject::implementsCall):
  7234. (KJS::JSCallbackObject::callAsFunction):
  7235. (KJS::JSCallbackObject::getPropertyList):
  7236. (KJS::JSCallbackObject::toBoolean):
  7237. (KJS::JSCallbackObject::toNumber):
  7238. (KJS::JSCallbackObject::toString):
  7239. (KJS::JSCallbackObject::inherits):
  7240. (KJS::JSCallbackObject::staticValueGetter):
  7241. (KJS::JSCallbackObject::staticFunctionGetter):
  7242. (KJS::JSCallbackObject::callbackGetter):
  7243. * API/JSCallbackObject.h:
  7244. * API/JSCharBufferRef.cpp:
  7245. * API/JSClassRef.cpp: Added.
  7246. (JSClassCreate):
  7247. (JSClassRetain):
  7248. (JSClassRelease):
  7249. * API/JSClassRef.h: Added.
  7250. (StaticValueEntry::StaticValueEntry):
  7251. (StaticFunctionEntry::StaticFunctionEntry):
  7252. (__JSClass::__JSClass):
  7253. * API/JSContextRef.cpp:
  7254. (JSContextCreate):
  7255. (JSEvaluate):
  7256. * API/JSContextRef.h:
  7257. * API/JSNode.c: Added.
  7258. (JSNodePrototype_appendChild):
  7259. (JSNodePrototype_removeChild):
  7260. (JSNodePrototype_replaceChild):
  7261. (JSNodePrototype_class):
  7262. (JSNode_getNodeType):
  7263. (JSNode_getChildNodes):
  7264. (JSNode_getFirstChild):
  7265. (JSNode_finalize):
  7266. (JSNode_class):
  7267. (JSNode_prototype):
  7268. (JSNode_new):
  7269. (JSNode_construct):
  7270. * API/JSNode.h: Added.
  7271. * API/JSNodeList.c: Added.
  7272. (JSNodeListPrototype_item):
  7273. (JSNodeListPrototype_class):
  7274. (JSNodeList_length):
  7275. (JSNodeList_getProperty):
  7276. (JSNodeList_finalize):
  7277. (JSNodeList_class):
  7278. (JSNodeList_prototype):
  7279. (JSNodeList_new):
  7280. * API/JSNodeList.h: Added.
  7281. * API/JSObjectRef.cpp:
  7282. (JSObjectMake):
  7283. (JSFunctionMake):
  7284. (JSConstructorMake):
  7285. (__JSPropertyEnumerator::__JSPropertyEnumerator):
  7286. (JSObjectCreatePropertyEnumerator):
  7287. (JSPropertyEnumeratorGetNext):
  7288. (JSPropertyEnumeratorRetain):
  7289. (JSPropertyEnumeratorRelease):
  7290. * API/JSObjectRef.h:
  7291. (__JSObjectCallbacks::):
  7292. * API/JSValueRef.cpp:
  7293. (JSValueIsObjectOfClass):
  7294. (JSValueIsInstanceOf):
  7295. * API/JSValueRef.h:
  7296. * API/Node.c: Added.
  7297. (Node_new):
  7298. (Node_appendChild):
  7299. (Node_removeChild):
  7300. (Node_replaceChild):
  7301. (Node_ref):
  7302. (Node_deref):
  7303. * API/Node.h: Added.
  7304. * API/NodeList.c: Added.
  7305. (NodeList_new):
  7306. (NodeList_length):
  7307. (NodeList_item):
  7308. (NodeList_ref):
  7309. (NodeList_deref):
  7310. * API/NodeList.h: Added.
  7311. * API/minidom.c:
  7312. (main):
  7313. (print):
  7314. (createStringWithContentsOfFile):
  7315. * API/minidom.js:
  7316. * API/testapi.c:
  7317. (assertEqualsAsCharacters):
  7318. (MyObject_getProperty):
  7319. (MyObject_class):
  7320. (myConstructor_callAsConstructor):
  7321. (main):
  7322. * API/testapi.js:
  7323. * JavaScriptCore.xcodeproj/project.pbxproj:
  7324. 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
  7325. Reviewed and tweaked by Darin.
  7326. - Compile fixes for wx port / gcc 4.0.2
  7327. * kjs/array_object.cpp:
  7328. Added missing headers.
  7329. * kjs/ExecState.h:
  7330. gcc needs class prototypes before defining those classes as friend classes
  7331. 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
  7332. Reviewed by Darin.
  7333. Compilation fixes for Linux/Gdk.
  7334. * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
  7335. * JavaScriptCore/kjs/ExecState.h: added missing class declaration
  7336. * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
  7337. * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
  7338. === Safari-521.14 ===
  7339. 2006-06-29 Maciej Stachowiak <mjs@apple.com>
  7340. Reviewed by Geoff.
  7341. - add headerdoc comments to some of the new JS API headers
  7342. * API/JSBase.h:
  7343. * API/JSValueRef.h:
  7344. 2006-06-28 Timothy Hatcher <timothy@apple.com>
  7345. Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
  7346. * JavaScriptCore.xcodeproj/project.pbxproj:
  7347. 2006-06-27 Timothy Hatcher <timothy@apple.com>
  7348. Reviewed by Tim O.
  7349. <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
  7350. Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
  7351. Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
  7352. Lots of code style cleanup.
  7353. * JavaScriptCore.xcodeproj/project.pbxproj:
  7354. * bindings/objc/objc_class.h:
  7355. * bindings/objc/objc_class.mm:
  7356. (KJS::Bindings::ObjcClass::~ObjcClass):
  7357. (KJS::Bindings::_createClassesByIsAIfNecessary):
  7358. (KJS::Bindings::ObjcClass::classForIsA):
  7359. (KJS::Bindings::ObjcClass::name):
  7360. (KJS::Bindings::ObjcClass::methodsNamed):
  7361. (KJS::Bindings::ObjcClass::fieldNamed):
  7362. (KJS::Bindings::ObjcClass::fallbackObject):
  7363. * bindings/objc/objc_header.h:
  7364. * bindings/objc/objc_instance.h:
  7365. * bindings/objc/objc_instance.mm:
  7366. (ObjcInstance::ObjcInstance):
  7367. (ObjcInstance::~ObjcInstance):
  7368. (ObjcInstance::operator=):
  7369. (ObjcInstance::begin):
  7370. (ObjcInstance::end):
  7371. (ObjcInstance::getClass):
  7372. (ObjcInstance::invokeMethod):
  7373. (ObjcInstance::invokeDefaultMethod):
  7374. (ObjcInstance::setValueOfField):
  7375. (ObjcInstance::supportsSetValueOfUndefinedField):
  7376. (ObjcInstance::setValueOfUndefinedField):
  7377. (ObjcInstance::getValueOfField):
  7378. (ObjcInstance::getValueOfUndefinedField):
  7379. (ObjcInstance::defaultValue):
  7380. (ObjcInstance::stringValue):
  7381. (ObjcInstance::numberValue):
  7382. (ObjcInstance::booleanValue):
  7383. (ObjcInstance::valueOf):
  7384. * bindings/objc/objc_runtime.h:
  7385. * bindings/objc/objc_runtime.mm:
  7386. (ObjcMethod::ObjcMethod):
  7387. (ObjcMethod::name):
  7388. (ObjcMethod::getMethodSignature):
  7389. (ObjcMethod::setJavaScriptName):
  7390. (ObjcField::name):
  7391. (ObjcField::type):
  7392. (ObjcField::valueFromInstance):
  7393. (convertValueToObjcObject):
  7394. (ObjcField::setValueToInstance):
  7395. (ObjcArray::operator=):
  7396. (ObjcArray::setValueAt):
  7397. (ObjcArray::valueAt):
  7398. (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
  7399. (ObjcFallbackObjectImp::callAsFunction):
  7400. (ObjcFallbackObjectImp::defaultValue):
  7401. 2006-06-28 Anders Carlsson <acarlsson@apple.com>
  7402. Reviewed by Geoff.
  7403. http://bugs.webkit.org/show_bug.cgi?id=8636
  7404. REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
  7405. * bindings/jni/jni_objc.mm:
  7406. (KJS::Bindings::dispatchJNICall):
  7407. Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
  7408. containing the applet (which is what we used to do).
  7409. 2006-06-27 Timothy Hatcher <timothy@apple.com>
  7410. Reviewed by Darin.
  7411. <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
  7412. * JavaScriptCore.exp: Added.
  7413. * JavaScriptCore.xcodeproj/project.pbxproj:
  7414. 2006-06-25 Geoffrey Garen <ggaren@apple.com>
  7415. Reviewed by Adele.
  7416. - Added JSConstructorMake to match JSFunctionMake, along with test code.
  7417. [ I checked in the ChangeLog before without the actual files. ]
  7418. * API/JSObjectRef.cpp:
  7419. (JSConstructorMake):
  7420. * API/JSObjectRef.h:
  7421. * API/testapi.c:
  7422. (myConstructor_callAsConstructor):
  7423. (main):
  7424. * API/testapi.js:
  7425. * ChangeLog:
  7426. * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
  7427. target -- this was an oversight in my earlier check-in.
  7428. 2006-06-25 Timothy Hatcher <timothy@apple.com>
  7429. Reviewed by Darin.
  7430. Bug 9574: Drosera should show inline scripts within the original HTML
  7431. http://bugs.webkit.org/show_bug.cgi?id=9574
  7432. Pass the starting line number and error message to the debugger.
  7433. * kjs/debugger.cpp:
  7434. (Debugger::sourceParsed):
  7435. * kjs/debugger.h:
  7436. * kjs/function.cpp:
  7437. (KJS::GlobalFuncImp::callAsFunction):
  7438. * kjs/function_object.cpp:
  7439. (FunctionObjectImp::construct):
  7440. * kjs/interpreter.cpp:
  7441. (KJS::Interpreter::evaluate):
  7442. 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
  7443. Rubber-stamped by Eric.
  7444. Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
  7445. a symlink was created inside the source directory on second build).
  7446. * JavaScriptCore.xcodeproj/project.pbxproj:
  7447. 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
  7448. Reviewed by Timothy.
  7449. * Info.plist: Fixed copyright to include 2003-2006.
  7450. 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
  7451. Reviewed by Darin.
  7452. - http://bugs.webkit.org/show_bug.cgi?id=9418
  7453. WebKit will not build when Space exists in path
  7454. * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
  7455. avoid passing paths with spaces to make.
  7456. 2006-06-23 Timothy Hatcher <timothy@apple.com>
  7457. Reviewed by Darin.
  7458. Adding more operator[] overloads for long and short types.
  7459. * wtf/Vector.h:
  7460. (WTF::Vector::operator[]):
  7461. === JavaScriptCore-521.13 ===
  7462. 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
  7463. Build fix.
  7464. - http://bugs.webkit.org/show_bug.cgi?id=9539
  7465. Another case error preventing build
  7466. * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
  7467. 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
  7468. Build fix.
  7469. http://bugs.webkit.org/show_bug.cgi?id=9539
  7470. Another case error preventing build
  7471. * API/APICast.h: Changed "UString.h" to "ustring.h".
  7472. 2006-06-21 Geoffrey Garen <ggaren@apple.com>
  7473. Fixed release build, fixed accidental infinite recursion due to
  7474. last minute global replace gone awry.
  7475. * API/APICast.h:
  7476. (toRef):
  7477. * API/testapi.c:
  7478. (assertEqualsAsBoolean):
  7479. (assertEqualsAsNumber):
  7480. (assertEqualsAsUTF8String):
  7481. (assertEqualsAsCharactersPtr):
  7482. * JavaScriptCore.xcodeproj/project.pbxproj:
  7483. 2006-06-21 Geoffrey Garen <ggaren@apple.com>
  7484. Reviewed by Anders.
  7485. - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
  7486. and the outline of a test app, 'minidom.c'.
  7487. Includes one change to JSC internals: Rename propList to getPropertyList and have it
  7488. take its target property list by reference so that subclasses can
  7489. add properties to the list before calling through to their superclasses.
  7490. Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
  7491. to give a shout-out to that.
  7492. * API/APICast.h: Added.
  7493. (toJS):
  7494. (toRef):
  7495. * API/JSBase.h: Added.
  7496. * API/JSCallbackObject.cpp: Added.
  7497. (KJS::):
  7498. (KJS::JSCallbackObject::JSCallbackObject):
  7499. (KJS::JSCallbackObject::~JSCallbackObject):
  7500. (KJS::JSCallbackObject::className):
  7501. (KJS::JSCallbackObject::getOwnPropertySlot):
  7502. (KJS::JSCallbackObject::put):
  7503. (KJS::JSCallbackObject::deleteProperty):
  7504. (KJS::JSCallbackObject::implementsConstruct):
  7505. (KJS::JSCallbackObject::construct):
  7506. (KJS::JSCallbackObject::implementsCall):
  7507. (KJS::JSCallbackObject::callAsFunction):
  7508. (KJS::JSCallbackObject::getPropertyList):
  7509. (KJS::JSCallbackObject::toBoolean):
  7510. (KJS::JSCallbackObject::toNumber):
  7511. (KJS::JSCallbackObject::toString):
  7512. (KJS::JSCallbackObject::setPrivate):
  7513. (KJS::JSCallbackObject::getPrivate):
  7514. (KJS::JSCallbackObject::cachedValueGetter):
  7515. (KJS::JSCallbackObject::callbackGetter):
  7516. * API/JSCallbackObject.h: Added.
  7517. (KJS::JSCallbackObject::classInfo):
  7518. * API/JSCharBufferRef.cpp: Added.
  7519. (JSStringMake):
  7520. (JSCharBufferCreate):
  7521. (JSCharBufferCreateUTF8):
  7522. (JSCharBufferRetain):
  7523. (JSCharBufferRelease):
  7524. (JSValueCopyStringValue):
  7525. (JSCharBufferGetLength):
  7526. (JSCharBufferGetCharactersPtr):
  7527. (JSCharBufferGetCharacters):
  7528. (JSCharBufferGetMaxLengthUTF8):
  7529. (JSCharBufferGetCharactersUTF8):
  7530. (JSCharBufferIsEqual):
  7531. (JSCharBufferIsEqualUTF8):
  7532. (JSCharBufferCreateWithCFString):
  7533. (CFStringCreateWithJSCharBuffer):
  7534. * API/JSCharBufferRef.h: Added.
  7535. * API/JSContextRef.cpp: Added.
  7536. (JSContextCreate):
  7537. (JSContextDestroy):
  7538. (JSContextGetGlobalObject):
  7539. (JSEvaluate):
  7540. (JSCheckSyntax):
  7541. (JSContextHasException):
  7542. (JSContextGetException):
  7543. (JSContextClearException):
  7544. (JSContextSetException):
  7545. * API/JSContextRef.h: Added.
  7546. * API/JSObjectRef.cpp: Added.
  7547. (JSValueToObject):
  7548. (JSObjectMake):
  7549. (JSFunctionMake):
  7550. (JSObjectGetDescription):
  7551. (JSObjectGetPrototype):
  7552. (JSObjectSetPrototype):
  7553. (JSObjectHasProperty):
  7554. (JSObjectGetProperty):
  7555. (JSObjectSetProperty):
  7556. (JSObjectDeleteProperty):
  7557. (JSObjectGetPrivate):
  7558. (JSObjectSetPrivate):
  7559. (JSObjectIsFunction):
  7560. (JSObjectCallAsFunction):
  7561. (JSObjectIsConstructor):
  7562. (JSObjectCallAsConstructor):
  7563. (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
  7564. (JSObjectCreatePropertyEnumerator):
  7565. (JSPropertyEnumeratorGetNext):
  7566. (JSPropertyEnumeratorRetain):
  7567. (JSPropertyEnumeratorRelease):
  7568. (JSPropertyListAdd):
  7569. * API/JSObjectRef.h: Added.
  7570. * API/JSValueRef.cpp: Added.
  7571. (JSValueGetType):
  7572. (JSValueIsUndefined):
  7573. (JSValueIsNull):
  7574. (JSValueIsBoolean):
  7575. (JSValueIsNumber):
  7576. (JSValueIsString):
  7577. (JSValueIsObject):
  7578. (JSValueIsEqual):
  7579. (JSValueIsStrictEqual):
  7580. (JSUndefinedMake):
  7581. (JSNullMake):
  7582. (JSBooleanMake):
  7583. (JSNumberMake):
  7584. (JSValueToBoolean):
  7585. (JSValueToNumber):
  7586. (JSGCProtect):
  7587. (JSGCUnprotect):
  7588. (JSGCCollect):
  7589. * API/JSValueRef.h: Added.
  7590. * API/JavaScriptCore.h: Added.
  7591. * API/minidom.c: Added.
  7592. (main):
  7593. * API/minidom.html: Added.
  7594. * API/minidom.js: Added.
  7595. * API/testapi.c: Added.
  7596. (assertEqualsAsBoolean):
  7597. (assertEqualsAsNumber):
  7598. (assertEqualsAsUTF8String):
  7599. (assertEqualsAsCharactersPtr):
  7600. (assertEqualsAsCharacters):
  7601. (MyObject_initialize):
  7602. (MyObject_copyDescription):
  7603. (MyObject_hasProperty):
  7604. (MyObject_getProperty):
  7605. (MyObject_setProperty):
  7606. (MyObject_deleteProperty):
  7607. (MyObject_getPropertyList):
  7608. (MyObject_callAsFunction):
  7609. (MyObject_callAsConstructor):
  7610. (MyObject_convertToType):
  7611. (MyObject_finalize):
  7612. (print_callAsFunction):
  7613. (main):
  7614. (createStringWithContentsOfFile):
  7615. * API/testapi.js: Added.
  7616. * ChangeLog:
  7617. * JavaScriptCore.xcodeproj/project.pbxproj:
  7618. * bindings/npruntime_impl.h:
  7619. * kjs/array_instance.h:
  7620. * kjs/array_object.cpp:
  7621. (ArrayInstance::getPropertyList):
  7622. * kjs/interpreter.cpp:
  7623. (KJS::Interpreter::evaluate):
  7624. * kjs/nodes.cpp:
  7625. (ForInNode::execute):
  7626. * kjs/object.cpp:
  7627. (KJS::JSObject::put):
  7628. (KJS::JSObject::canPut):
  7629. (KJS::JSObject::deleteProperty):
  7630. (KJS::JSObject::propertyIsEnumerable):
  7631. (KJS::JSObject::getPropertyAttributes):
  7632. (KJS::JSObject::getPropertyList):
  7633. * kjs/object.h:
  7634. * kjs/property_map.cpp:
  7635. (KJS::PropertyMap::get):
  7636. * kjs/property_map.h:
  7637. * kjs/scope_chain.cpp:
  7638. (KJS::ScopeChain::print):
  7639. * kjs/string_object.cpp:
  7640. (StringInstance::getPropertyList):
  7641. * kjs/string_object.h:
  7642. * kjs/ustring.h:
  7643. (KJS::UString::Rep::ref):
  7644. 2006-06-20 Timothy Hatcher <timothy@apple.com>
  7645. Reviewed by Geoff.
  7646. Make sure we clear the exception before returning so
  7647. that future calls will not fail because of an earlier
  7648. exception state. Assert on entry that the WebScriptObject
  7649. is working with an ExecState that dose not have an exception.
  7650. Document that evaluateWebScript and callWebScriptMethod return
  7651. WebUndefined when an exception is thrown.
  7652. * bindings/objc/WebScriptObject.h:
  7653. * bindings/objc/WebScriptObject.mm:
  7654. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  7655. (-[WebScriptObject evaluateWebScript:]):
  7656. (-[WebScriptObject setValue:forKey:]):
  7657. (-[WebScriptObject valueForKey:]):
  7658. (-[WebScriptObject removeWebScriptKey:]):
  7659. (-[WebScriptObject webScriptValueAtIndex:]):
  7660. (-[WebScriptObject setWebScriptValueAtIndex:value:]):
  7661. 2006-06-19 Anders Carlsson <acarlsson@apple.com>
  7662. Reviewed by John.
  7663. * kjs/interpreter.cpp:
  7664. (KJS::TimeoutChecker::pauseTimeoutCheck):
  7665. (KJS::TimeoutChecker::resumeTimeoutCheck):
  7666. Fix argument order in setitimer calls.
  7667. 2006-06-18 Anders Carlsson <acarlsson@apple.com>
  7668. Reviewed by Geoff.
  7669. * kjs/interpreter.cpp:
  7670. (KJS::TimeoutChecker::pauseTimeoutCheck):
  7671. Do nothing if the timeout check hasn't been started.
  7672. (KJS::TimeoutChecker::resumeTimeoutCheck):
  7673. Do nothing if the timeout check hasn't been started.
  7674. Use the right signal handler when unblocking.
  7675. (KJS::Interpreter::handleTimeout):
  7676. pause/resume the timeout check around the call to
  7677. shouldInterruptScript().
  7678. 2006-06-16 Ben Goodger <beng@google.com>
  7679. Reviewed by Maciej
  7680. http://bugs.webkit.org/show_bug.cgi?id=9491
  7681. Windows build breaks in interpreter.cpp
  7682. * kjs/interpreter.cpp
  7683. (KJS::TimeoutChecker::pauseTimeoutCheck):
  7684. (KJS::TimeoutChecker::resumeTimeoutCheck):
  7685. Make sure to only assert equality with s_executingInterpreter when it
  7686. is being used (i.e. when HAVE(SYS_TIME_H) == true)
  7687. 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
  7688. Reviewed by darin.
  7689. http://bugs.webkit.org/show_bug.cgi?id=9477
  7690. REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
  7691. * kjs/function.cpp:
  7692. (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
  7693. in case the WebFrame it was running in has since been destroyed.
  7694. 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
  7695. Reviewed by ggaren.
  7696. http://bugs.webkit.org/show_bug.cgi?id=9476
  7697. REGRESSION: Reproducible crash after closing window after viewing
  7698. css2.1/t0803-c5501-imrgn-t-00-b-ag.html
  7699. * kjs/debugger.cpp:
  7700. (Debugger::detach): Call setDebugger(0) for all interpreters removed from
  7701. the 'attached to a debugger' list.
  7702. 2006-06-17 Anders Carlsson <acarlsson@apple.com>
  7703. Reviewed by Maciej and Geoff.
  7704. http://bugs.webkit.org/show_bug.cgi?id=7080
  7705. Provide some way to stop a JavaScript infinite loop
  7706. * kjs/completion.h:
  7707. (KJS::):
  7708. Add Interrupted completion type.
  7709. * kjs/function.cpp:
  7710. (KJS::FunctionImp::callAsFunction):
  7711. (KJS::GlobalFuncImp::callAsFunction):
  7712. Only set the exception on the new ExecState if the current one has had one.
  7713. * kjs/interpreter.cpp:
  7714. (KJS::TimeoutChecker::startTimeoutCheck):
  7715. (KJS::TimeoutChecker::stopTimeoutCheck):
  7716. (KJS::TimeoutChecker::alarmHandler):
  7717. (KJS::TimeoutChecker::pauseTimeoutCheck):
  7718. (KJS::TimeoutChecker::resumeTimeoutCheck):
  7719. New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
  7720. period of time. This currently only works on Unix platforms where setitimer and signals are used.
  7721. (KJS::Interpreter::Interpreter):
  7722. Initialize new member variables.
  7723. (KJS::Interpreter::~Interpreter):
  7724. Destroy the timeout checker.
  7725. (KJS::Interpreter::startTimeoutCheck):
  7726. (KJS::Interpreter::stopTimeoutCheck):
  7727. (KJS::Interpreter::pauseTimeoutCheck):
  7728. (KJS::Interpreter::resumeTimeoutCheck):
  7729. Call the timeout checker.
  7730. (KJS::Interpreter::handleTimeout):
  7731. Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
  7732. * kjs/interpreter.h:
  7733. (KJS::Interpreter::setTimeoutTime):
  7734. New function for setting the timeout time.
  7735. (KJS::Interpreter::shouldInterruptScript):
  7736. New function. The idea is that this should be overridden by subclasses in order to for example
  7737. pop up a dialog asking the user if the script should be interrupted.
  7738. (KJS::Interpreter::checkTimeout):
  7739. New function which checks the m_timedOut flag and calls handleTimeout if it's set.
  7740. * kjs/nodes.cpp:
  7741. (DoWhileNode::execute):
  7742. (WhileNode::execute):
  7743. (ForNode::execute):
  7744. Call Interpreter::checkTimeout after each iteration of the loop.
  7745. 2006-06-15 Timothy Hatcher <timothy@apple.com>
  7746. Reviewed by Geoff and Darin.
  7747. Prefer the DWARF debugging symbols format for use in Xcode 2.3.
  7748. * JavaScriptCore.xcodeproj/project.pbxproj:
  7749. 2006-06-14 Geoffrey Garen <ggaren@apple.com>
  7750. Reviewed by Beth.
  7751. - fixed http://bugs.webkit.org/show_bug.cgi?id=9438
  7752. Someone broke ToT: cannot build
  7753. * JavaScriptCore.xcodeproj/project.pbxproj:
  7754. * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
  7755. 2006-06-12 Geoffrey Garen <ggaren@apple.com>
  7756. build fix
  7757. * bindings/objc/WebScriptObject.mm:
  7758. (+[WebScriptObject throwException:]): Restore assignment I accidentally
  7759. deleted in previous commit
  7760. 2006-06-12 Geoffrey Garen <ggaren@apple.com>
  7761. Reviewed by TimO, Maciej.
  7762. - Merged InterpreterImp code into Interpreter, which implements
  7763. all interpreter functionality now. This is part of my continuing quest
  7764. to create an external notion of JS "execution context" that is unified and simple --
  7765. something to replace the mix of Context, ContextImp, ExecState, Interpreter,
  7766. InterpreterImp, and JSRun.
  7767. All tests pass. Leaks test has not regressed from its baseline ~207 leaks
  7768. with ~3460 leaked nodes.
  7769. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  7770. * JavaScriptCore.xcodeproj/project.pbxproj:
  7771. * bindings/NP_jsobject.cpp:
  7772. * bindings/objc/WebScriptObject.mm:
  7773. (+[WebScriptObject throwException:]):
  7774. * bindings/runtime_root.cpp:
  7775. * bindings/runtime_root.h:
  7776. * kjs/Context.cpp:
  7777. (KJS::Context::Context):
  7778. * kjs/ExecState.cpp: Added.
  7779. (KJS::ExecState::lexicalInterpreter):
  7780. * kjs/ExecState.h: Added.
  7781. (KJS::ExecState::dynamicInterpreter):
  7782. * kjs/SavedBuiltins.h: Added.
  7783. * kjs/bool_object.cpp:
  7784. (BooleanPrototype::BooleanPrototype):
  7785. * kjs/collector.cpp:
  7786. (KJS::Collector::collect):
  7787. (KJS::Collector::numInterpreters):
  7788. * kjs/context.h:
  7789. * kjs/debugger.cpp:
  7790. (Debugger::attach):
  7791. (Debugger::detach):
  7792. * kjs/function.cpp:
  7793. (KJS::FunctionImp::callAsFunction):
  7794. (KJS::GlobalFuncImp::callAsFunction):
  7795. * kjs/function_object.cpp:
  7796. (FunctionObjectImp::construct):
  7797. * kjs/internal.cpp:
  7798. * kjs/internal.h:
  7799. * kjs/interpreter.cpp:
  7800. (KJS::interpreterMap):
  7801. (KJS::Interpreter::Interpreter):
  7802. (KJS::Interpreter::init):
  7803. (KJS::Interpreter::~Interpreter):
  7804. (KJS::Interpreter::globalObject):
  7805. (KJS::Interpreter::initGlobalObject):
  7806. (KJS::Interpreter::globalExec):
  7807. (KJS::Interpreter::checkSyntax):
  7808. (KJS::Interpreter::evaluate):
  7809. (KJS::Interpreter::builtinObject):
  7810. (KJS::Interpreter::builtinFunction):
  7811. (KJS::Interpreter::builtinArray):
  7812. (KJS::Interpreter::builtinBoolean):
  7813. (KJS::Interpreter::builtinString):
  7814. (KJS::Interpreter::builtinNumber):
  7815. (KJS::Interpreter::builtinDate):
  7816. (KJS::Interpreter::builtinRegExp):
  7817. (KJS::Interpreter::builtinError):
  7818. (KJS::Interpreter::builtinObjectPrototype):
  7819. (KJS::Interpreter::builtinFunctionPrototype):
  7820. (KJS::Interpreter::builtinArrayPrototype):
  7821. (KJS::Interpreter::builtinBooleanPrototype):
  7822. (KJS::Interpreter::builtinStringPrototype):
  7823. (KJS::Interpreter::builtinNumberPrototype):
  7824. (KJS::Interpreter::builtinDatePrototype):
  7825. (KJS::Interpreter::builtinRegExpPrototype):
  7826. (KJS::Interpreter::builtinErrorPrototype):
  7827. (KJS::Interpreter::builtinEvalError):
  7828. (KJS::Interpreter::builtinRangeError):
  7829. (KJS::Interpreter::builtinReferenceError):
  7830. (KJS::Interpreter::builtinSyntaxError):
  7831. (KJS::Interpreter::builtinTypeError):
  7832. (KJS::Interpreter::builtinURIError):
  7833. (KJS::Interpreter::builtinEvalErrorPrototype):
  7834. (KJS::Interpreter::builtinRangeErrorPrototype):
  7835. (KJS::Interpreter::builtinReferenceErrorPrototype):
  7836. (KJS::Interpreter::builtinSyntaxErrorPrototype):
  7837. (KJS::Interpreter::builtinTypeErrorPrototype):
  7838. (KJS::Interpreter::builtinURIErrorPrototype):
  7839. (KJS::Interpreter::mark):
  7840. (KJS::Interpreter::interpreterWithGlobalObject):
  7841. (KJS::Interpreter::saveBuiltins):
  7842. (KJS::Interpreter::restoreBuiltins):
  7843. * kjs/interpreter.h:
  7844. (KJS::Interpreter::setCompatMode):
  7845. (KJS::Interpreter::compatMode):
  7846. (KJS::Interpreter::firstInterpreter):
  7847. (KJS::Interpreter::nextInterpreter):
  7848. (KJS::Interpreter::prevInterpreter):
  7849. (KJS::Interpreter::debugger):
  7850. (KJS::Interpreter::setDebugger):
  7851. (KJS::Interpreter::setContext):
  7852. (KJS::Interpreter::context):
  7853. * kjs/nodes.cpp:
  7854. (StatementNode::hitStatement):
  7855. (RegExpNode::evaluate):
  7856. * kjs/protect.h:
  7857. 2006-06-12 Geoffrey Garen <ggaren@apple.com>
  7858. Reviewed by Maciej.
  7859. - Have *.lut.h files #include lookup.h to eliminate surprising header
  7860. include order dependency.
  7861. * DerivedSources.make:
  7862. * kjs/array_object.cpp:
  7863. * kjs/date_object.cpp:
  7864. * kjs/date_object.h:
  7865. (KJS::DateProtoFunc::):
  7866. * kjs/lexer.cpp:
  7867. * kjs/math_object.cpp:
  7868. * kjs/number_object.cpp:
  7869. * kjs/regexp_object.cpp:
  7870. * kjs/string_object.cpp:
  7871. 2006-06-10 Geoffrey Garen <ggaren@apple.com>
  7872. - http://bugs.webkit.org/show_bug.cgi?id=8515
  7873. Linux porting compile bug
  7874. Fix by Mike Emmel, Reviewed by Darin.
  7875. * JavaScriptCoreSources.bkl:
  7876. * jscore.bkl:
  7877. * wtf/Platform.h:
  7878. 2006-06-09 Geoffrey Garen <ggaren@apple.com>
  7879. Build fix -- I think :).
  7880. * JavaScriptCore.xcodeproj/project.pbxproj:
  7881. * kjs/context.h:
  7882. 2006-06-09 Geoffrey Garen <ggaren@apple.com>
  7883. Reviewed by Eric (yay!).
  7884. - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
  7885. split Context into its own file -- Context.cpp -- renamed _var to m_var,
  7886. change ' *' to '* '.
  7887. * JavaScriptCore.xcodeproj/project.pbxproj:
  7888. * kjs/Context.cpp: Added.
  7889. (KJS::Context::Context):
  7890. (KJS::Context::~Context):
  7891. (KJS::Context::mark):
  7892. * kjs/context.h:
  7893. (KJS::Context::scopeChain):
  7894. (KJS::Context::variableObject):
  7895. (KJS::Context::setVariableObject):
  7896. (KJS::Context::thisValue):
  7897. (KJS::Context::callingContext):
  7898. (KJS::Context::activationObject):
  7899. (KJS::Context::currentBody):
  7900. (KJS::Context::function):
  7901. (KJS::Context::arguments):
  7902. (KJS::Context::pushScope):
  7903. (KJS::Context::seenLabels):
  7904. * kjs/function.cpp:
  7905. (KJS::FunctionImp::callAsFunction):
  7906. (KJS::FunctionImp::processParameters):
  7907. (KJS::FunctionImp::argumentsGetter):
  7908. (KJS::GlobalFuncImp::callAsFunction):
  7909. * kjs/internal.cpp:
  7910. (KJS::InterpreterImp::evaluate):
  7911. * kjs/internal.h:
  7912. (KJS::InterpreterImp::setContext):
  7913. (KJS::InterpreterImp::context):
  7914. * kjs/interpreter.cpp:
  7915. * kjs/interpreter.h:
  7916. (KJS::ExecState::context):
  7917. (KJS::ExecState::ExecState):
  7918. * kjs/nodes.cpp:
  7919. (currentSourceId):
  7920. (currentSourceURL):
  7921. (ThisNode::evaluate):
  7922. (ResolveNode::evaluate):
  7923. (FunctionCallResolveNode::evaluate):
  7924. (PostfixResolveNode::evaluate):
  7925. (DeleteResolveNode::evaluate):
  7926. (TypeOfResolveNode::evaluate):
  7927. (PrefixResolveNode::evaluate):
  7928. (AssignResolveNode::evaluate):
  7929. (VarDeclNode::evaluate):
  7930. (VarDeclNode::processVarDecls):
  7931. (DoWhileNode::execute):
  7932. (WhileNode::execute):
  7933. (ForNode::execute):
  7934. (ForInNode::execute):
  7935. (ContinueNode::execute):
  7936. (BreakNode::execute):
  7937. (ReturnNode::execute):
  7938. (WithNode::execute):
  7939. (SwitchNode::execute):
  7940. (LabelNode::execute):
  7941. (TryNode::execute):
  7942. (FuncDeclNode::processFuncDecl):
  7943. (FuncExprNode::evaluate):
  7944. 2006-06-07 Geoffrey Garen <ggaren@apple.com>
  7945. Removed API directory I prematurely/accidentally added.
  7946. * API: Removed.
  7947. 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
  7948. Reviewed and landed by Geoff.
  7949. - fix a regression in ecma_3/String/regress-104375.js
  7950. * kjs/string_object.cpp:
  7951. (substituteBackreferences): If a 2-digit back reference is out of range,
  7952. parse it as a 1-digit reference (followed by the other digit). This matches
  7953. Firefox's behavior.
  7954. 2006-06-05 Geoffrey Garen <ggaren@apple.com>
  7955. Reviewed By Maciej.
  7956. Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
  7957. - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
  7958. No test case because there's no behavior change.
  7959. * pcre/pcre_compile.c:
  7960. (read_repeat_counts): Check for integer overflow / out of bounds
  7961. 2006-06-05 Geoffrey Garen <ggaren@apple.com>
  7962. Reviewed by aliu.
  7963. - Changed CString length from int to size_t. We sould probably do this
  7964. for UString, too. (Darin, if you're reading this: Maciej said so.)
  7965. * kjs/function.cpp:
  7966. (KJS::encode):
  7967. * kjs/ustring.cpp:
  7968. (KJS::CString::CString):
  7969. (KJS::operator==):
  7970. * kjs/ustring.h:
  7971. (KJS::CString::size):
  7972. 2006-06-04 Geoffrey Garen <ggaren@apple.com>
  7973. Reviewed by Maciej.
  7974. - http://bugs.webkit.org/show_bug.cgi?id=9304
  7975. Minor cleanup in JavaScriptCore
  7976. * kjs/value.h: Removed redundant declarations
  7977. 2006-06-04 Darin Adler <darin@apple.com>
  7978. Reviewed by Anders.
  7979. - changed deleteAllValues so it can work on "const" collections
  7980. Deleting the values affects the values, not the pointers in the
  7981. collection, so it's legitimate to do it to a const collection,
  7982. and a case of that actually came up in the XPath code.
  7983. * wtf/HashMap.h:
  7984. (WTF::deleteAllPairSeconds): Use const iterators.
  7985. (WTF::deleteAllValues): Take const HashMap reference as a parameter.
  7986. * wtf/HashSet.h:
  7987. (WTF::deleteAllValues): Take const HashSet reference as a parameter,
  7988. and use const iterators.
  7989. * wtf/Vector.h:
  7990. (WTF::deleteAllValues): Take const Vector reference as a parameter.
  7991. - added more functions that are present in <math.h> on some platforms,
  7992. but not on others; moved here from various files in WebCore
  7993. * wtf/MathExtras.h:
  7994. (isinf): Added.
  7995. (isnan): Added.
  7996. (lround): Added.
  7997. (lroundf): Tweaked.
  7998. (round): Added.
  7999. (roundf): Tweaked.
  8000. (signbit): Added.
  8001. 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
  8002. Reviewed by ggaren.
  8003. - http://bugs.webkit.org/show_bug.cgi?id=9234
  8004. Implement $&, $' and $` replacement codes in String.prototype.replace
  8005. Test: fast/js/string-replace-3.html
  8006. * kjs/string_object.cpp:
  8007. (substituteBackreferences): Added support for $& (matched substring),
  8008. $` (everything preceding matched substring), $' (everything following
  8009. matched substring) and 2-digit back references, and cleaned up a little.
  8010. 2006-06-02 Adele Peterson <adele@apple.com>
  8011. Reviewed by Darin.
  8012. Set incremental linking to no. This seems to fix a build problem I was seeing
  8013. where dftables couldn't find a dll.
  8014. * JavaScriptCore.vcproj/dftables/dftables.vcproj:
  8015. 2006-05-26 Steve Falkenburg <sfalken@apple.com>
  8016. Build fixes/tweaks
  8017. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  8018. === JavaScriptCore-521.11 ===
  8019. 2006-05-24 Geoffrey Garen <ggaren@apple.com>
  8020. Reviewed by mjs.
  8021. - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
  8022. occurs when attempting to view image in slideshow mode at
  8023. http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
  8024. (KJS::ExecState*) + 312)
  8025. On alternate threads, DOMObjects remain in the
  8026. ScriptInterpreter's cache because they're not collected. So, they
  8027. need an opportunity to mark their children.
  8028. I'm not particularly happy with this solution because it fails to
  8029. resolve many outstanding issues with the DOM object cache. Since none
  8030. of those issues is a crasher or a serious compatibility concern,
  8031. and since the behavior of other browsers is not much to go on in this
  8032. case, I've filed <rdar://problem/4561439> about that, and I'm moving on
  8033. with my life.
  8034. * JavaScriptCore.xcodeproj/project.pbxproj:
  8035. * kjs/collector.cpp:
  8036. (KJS::Collector::collect):
  8037. * kjs/internal.cpp:
  8038. (KJS::InterpreterImp::mark):
  8039. * kjs/internal.h:
  8040. * kjs/interpreter.cpp:
  8041. (KJS::Interpreter::mark):
  8042. * kjs/interpreter.h:
  8043. === JavaScriptCore-521.10 ===
  8044. 2006-05-22 Timothy Hatcher <timothy@apple.com>
  8045. Reviewed by Eric, Kevin and Geoff.
  8046. Merge open source build fixes. <rdar://problem/4555500>
  8047. * kjs/collector.cpp: look at the rsp register in x86_64
  8048. (KJS::Collector::markOtherThreadConservatively):
  8049. * wtf/Platform.h: add x86_64 to the platform list
  8050. 2006-05-19 Anders Carlsson <acarlsson@apple.com>
  8051. Reviewed by Geoff.
  8052. http://bugs.webkit.org/show_bug.cgi?id=8993
  8053. Support function declaration in case statements
  8054. * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
  8055. * kjs/nodes.cpp:
  8056. (CaseClauseNode::evalStatements):
  8057. (CaseClauseNode::processVarDecls):
  8058. (CaseClauseNode::processFuncDecl):
  8059. (ClauseListNode::processFuncDecl):
  8060. (CaseBlockNode::processFuncDecl):
  8061. (SwitchNode::processFuncDecl):
  8062. * kjs/nodes.h:
  8063. (KJS::CaseClauseNode::CaseClauseNode):
  8064. (KJS::ClauseListNode::ClauseListNode):
  8065. (KJS::ClauseListNode::getClause):
  8066. (KJS::ClauseListNode::getNext):
  8067. (KJS::ClauseListNode::releaseNext):
  8068. (KJS::SwitchNode::SwitchNode):
  8069. Add processFuncDecl for the relevant nodes.
  8070. * kjs/nodes2string.cpp:
  8071. (CaseClauseNode::streamTo):
  8072. next got renamed to source.
  8073. 2006-05-17 George Staikos <staikos@kde.org>
  8074. Reviewed by Maciej, Alexey, and Eric.
  8075. * pcre/pcre_compile.c:
  8076. * pcre/pcre_get.c:
  8077. * pcre/pcre_exec.c:
  8078. * wtf/UnusedParam.h:
  8079. Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
  8080. * kjs/testkjs.cpp:
  8081. Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
  8082. * wtf/unicode/qt4/UnicodeQt4.h:
  8083. Use correct parentheses and correct mask for utf-32 support.
  8084. 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
  8085. Reviewed by Darin.
  8086. - fix http://bugs.webkit.org/show_bug.cgi?id=8870
  8087. Crash typing in Yahoo auto-complete widget.
  8088. Test: fast/js/regexp-stack-overflow.html
  8089. * pcre/pcre-config.h: Define NO_RECURSE.
  8090. 2006-05-16 George Staikos <staikos@kde.org>
  8091. Reviewed by Maciej.
  8092. Fix some warnings and strict compilation errors.
  8093. * kjs/nodes.cpp:
  8094. * kjs/value.cpp:
  8095. 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
  8096. * make-generated-sources.sh: Changed to be executable and removed
  8097. text in the file generated by "svn diff".
  8098. 2006-05-15 Geoffrey Garen <ggaren@apple.com>
  8099. Reviewed by Maciej.
  8100. - Fixed <rdar://problem/4534904> please do not treat "debugger" as
  8101. a reserved word while parsing JavaScript (and other ECMA reserved
  8102. words)
  8103. AKA
  8104. http://bugs.webkit.org/show_bug.cgi?id=6179
  8105. We treat "char" as a reserved word in JavaScript and firefox/IE do
  8106. not
  8107. (1) I unreserved most of the spec's "future reserved words" because
  8108. they're not reserved in IE or FF. (Most, but not all, because IE
  8109. somewhat randomly *does* reserve a few of them.)
  8110. (2) I made 'debugger' a legitimate statement that acts like an empty
  8111. statement because FF and IE support it.
  8112. * kjs/grammar.y:
  8113. * kjs/keywords.table:
  8114. 2006-05-15 Tim Omernick <timo@apple.com>
  8115. Reviewed by John Sullivan.
  8116. Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
  8117. Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
  8118. determines the kind of graphics context created by the browser for the plugin, as well as
  8119. the Mac types of various Netscape Plugin API data structures.
  8120. There is a drawing model to represent the old QuickDraw-based API. It is used by default
  8121. if QuickDraw is available on the system, unless the plugin specifies another drawing model.
  8122. The big change is the addition of the CoreGraphics drawing model. A plugin may request this
  8123. drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
  8124. * bindings/npapi.h:
  8125. Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
  8126. Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
  8127. variables.
  8128. Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
  8129. CoreGraphics.
  8130. NPRegion's type now depends on the drawing model specified by the plugin.
  8131. NP_Port is now only defined when QuickDraw is available.
  8132. Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
  8133. 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
  8134. Reviewed by Darin, landed by ap.
  8135. - http://bugs.webkit.org/show_bug.cgi?id=8528
  8136. Bakefiles (and generated Makefiles) for wx and gdk ports
  8137. * make-generated-sources.sh:
  8138. Added script to configure environment to run DerivedSources.make
  8139. * JavaScriptCoreSources.bkl:
  8140. Added JavaScriptCore sources list for Bakefile.
  8141. * jscore.bkl:
  8142. Bakefile used to generate JavaScriptCore project files
  8143. (currently only used by wx and gdk ports)
  8144. 2006-05-09 Steve Falkenburg <sfalken@apple.com>
  8145. Fix Windows build.
  8146. Minor fixes to WTF headers.
  8147. Reviewed by kevin.
  8148. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
  8149. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
  8150. * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
  8151. * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
  8152. 2006-05-09 Maciej Stachowiak <mjs@apple.com>
  8153. Rubber stamped by Anders.
  8154. - renamed kxmlcore to wtf
  8155. kxmlcore --> wtf
  8156. KXMLCore --> WTF
  8157. KXC --> WTF
  8158. * JavaScriptCore.xcodeproj/project.pbxproj:
  8159. * bindings/c/c_instance.cpp:
  8160. * bindings/objc/WebScriptObject.mm:
  8161. * kjs/JSImmediate.h:
  8162. * kjs/Parser.cpp:
  8163. * kjs/Parser.h:
  8164. * kjs/array_object.cpp:
  8165. * kjs/collector.cpp:
  8166. (KJS::Collector::registerThread):
  8167. * kjs/collector.h:
  8168. * kjs/config.h:
  8169. * kjs/function.cpp:
  8170. (KJS::isStrWhiteSpace):
  8171. * kjs/function.h:
  8172. * kjs/identifier.cpp:
  8173. * kjs/internal.cpp:
  8174. * kjs/internal.h:
  8175. * kjs/lexer.cpp:
  8176. (Lexer::shift):
  8177. (Lexer::isWhiteSpace):
  8178. (Lexer::isIdentStart):
  8179. (Lexer::isIdentPart):
  8180. * kjs/lookup.cpp:
  8181. * kjs/nodes.cpp:
  8182. * kjs/nodes.h:
  8183. * kjs/number_object.cpp:
  8184. * kjs/object.h:
  8185. * kjs/property_map.cpp:
  8186. * kjs/property_map.h:
  8187. * kjs/string_object.cpp:
  8188. (StringProtoFunc::callAsFunction):
  8189. * kjs/testkjs.cpp:
  8190. (testIsInteger):
  8191. * kjs/ustring.cpp:
  8192. * kjs/ustring.h:
  8193. * kxmlcore: Removed.
  8194. * kxmlcore/AlwaysInline.h: Removed.
  8195. * kxmlcore/Assertions.cpp: Removed.
  8196. * kxmlcore/Assertions.h: Removed.
  8197. * kxmlcore/FastMalloc.cpp: Removed.
  8198. * kxmlcore/FastMalloc.h: Removed.
  8199. * kxmlcore/FastMallocInternal.h: Removed.
  8200. * kxmlcore/Forward.h: Removed.
  8201. * kxmlcore/HashCountedSet.h: Removed.
  8202. * kxmlcore/HashFunctions.h: Removed.
  8203. * kxmlcore/HashMap.h: Removed.
  8204. * kxmlcore/HashSet.h: Removed.
  8205. * kxmlcore/HashTable.cpp: Removed.
  8206. * kxmlcore/HashTable.h: Removed.
  8207. * kxmlcore/HashTraits.h: Removed.
  8208. * kxmlcore/ListRefPtr.h: Removed.
  8209. * kxmlcore/Noncopyable.h: Removed.
  8210. * kxmlcore/OwnArrayPtr.h: Removed.
  8211. * kxmlcore/OwnPtr.h: Removed.
  8212. * kxmlcore/PassRefPtr.h: Removed.
  8213. * kxmlcore/Platform.h: Removed.
  8214. * kxmlcore/RefPtr.h: Removed.
  8215. * kxmlcore/TCPageMap.h: Removed.
  8216. * kxmlcore/TCSpinLock.h: Removed.
  8217. * kxmlcore/TCSystemAlloc.cpp: Removed.
  8218. * kxmlcore/TCSystemAlloc.h: Removed.
  8219. * kxmlcore/UnusedParam.h: Removed.
  8220. * kxmlcore/Vector.h: Removed.
  8221. * kxmlcore/VectorTraits.h: Removed.
  8222. * kxmlcore/unicode: Removed.
  8223. * kxmlcore/unicode/Unicode.h: Removed.
  8224. * kxmlcore/unicode/UnicodeCategory.h: Removed.
  8225. * kxmlcore/unicode/icu: Removed.
  8226. * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
  8227. * kxmlcore/unicode/posix: Removed.
  8228. * kxmlcore/unicode/qt3: Removed.
  8229. * kxmlcore/unicode/qt4: Removed.
  8230. * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
  8231. * pcre/pcre_get.c:
  8232. * wtf: Added.
  8233. * wtf/Assertions.cpp:
  8234. * wtf/Assertions.h:
  8235. * wtf/FastMalloc.cpp:
  8236. (WTF::TCMalloc_ThreadCache::Scavenge):
  8237. (WTF::do_malloc):
  8238. (WTF::do_free):
  8239. (WTF::TCMallocGuard::TCMallocGuard):
  8240. (WTF::malloc):
  8241. (WTF::free):
  8242. (WTF::calloc):
  8243. (WTF::cfree):
  8244. (WTF::realloc):
  8245. * wtf/FastMalloc.h:
  8246. * wtf/FastMallocInternal.h:
  8247. * wtf/Forward.h:
  8248. * wtf/HashCountedSet.h:
  8249. * wtf/HashFunctions.h:
  8250. * wtf/HashMap.h:
  8251. * wtf/HashSet.h:
  8252. * wtf/HashTable.cpp:
  8253. * wtf/HashTable.h:
  8254. * wtf/HashTraits.h:
  8255. * wtf/ListRefPtr.h:
  8256. * wtf/Noncopyable.h:
  8257. * wtf/OwnArrayPtr.h:
  8258. * wtf/OwnPtr.h:
  8259. * wtf/PassRefPtr.h:
  8260. * wtf/RefPtr.h:
  8261. * wtf/TCSystemAlloc.cpp:
  8262. (TCMalloc_SystemAlloc):
  8263. * wtf/Vector.h:
  8264. * wtf/VectorTraits.h:
  8265. * wtf/unicode/UnicodeCategory.h:
  8266. * wtf/unicode/icu/UnicodeIcu.h:
  8267. 2006-05-08 Timothy Hatcher <timothy@apple.com>
  8268. Reviewed by Tim O.
  8269. * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
  8270. 2006-05-07 Darin Adler <darin@apple.com>
  8271. Reviewed and landed by Maciej.
  8272. - fix http://bugs.webkit.org/show_bug.cgi?id=8765
  8273. Random crashes on TOT since the form state change
  8274. I haven't figured out how to construct a test for this, but this does seem to fix the
  8275. problem; Mitz mentioned that a double-destroy was occurring in these functions.
  8276. * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
  8277. ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
  8278. destroys the element based on the storage type. The RefCounter template correctly does work
  8279. only in cases where ValueType and ValueStorageType differ and this class is what's used
  8280. elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
  8281. * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
  8282. 2006-05-05 Darin Adler <darin@apple.com>
  8283. - http://bugs.webkit.org/show_bug.cgi?id=8722
  8284. IE compatibility fix in date parsing
  8285. * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
  8286. from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
  8287. 2006-05-04 Anders Carlsson <andersca@mac.com>
  8288. Reviewed by Maciej.
  8289. http://bugs.webkit.org/show_bug.cgi?id=8734
  8290. Would like a Vector::append that takes another Vector
  8291. * kxmlcore/Vector.h:
  8292. (KXMLCore::::append):
  8293. New function that takes another array.
  8294. 2006-05-02 Steve Falkenburg <sfalken@apple.com>
  8295. Reviewed by eric.
  8296. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
  8297. * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
  8298. 2006-05-02 Anders Carlsson <andersca@mac.com>
  8299. Reviewed by Maciej.
  8300. * kxmlcore/HashMap.h:
  8301. (KXMLCore::::operator):
  8302. Return *this
  8303. 2006-05-01 Tim Omernick <timo@apple.com>
  8304. Reviewed by Tim Hatcher.
  8305. <rdar://problem/4476875> Support printing for embedded Netscape plugins
  8306. * bindings/npapi.h:
  8307. Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
  8308. and Mac OS X systems, as this is what plugins expect.
  8309. 2006-05-01 Timothy Hatcher <timothy@apple.com>
  8310. Reviewed by Maciej.
  8311. <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
  8312. The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
  8313. imp->m_destructorIsThreadSafe" where we collect oversized cells.
  8314. We don't have a way to test PAC files yet, so there's no test attached.
  8315. * kjs/collector.cpp:
  8316. (KJS::Collector::collect): test the thread when we collect oversized cells
  8317. 2006-05-01 Tim Omernick <timo@apple.com>
  8318. Reviewed by Adele.
  8319. <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
  8320. * kxmlcore/Assertions.cpp:
  8321. Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
  8322. 2006-04-28 Steve Falkenburg <sfalken@apple.com>
  8323. Reviewed by kdecker
  8324. Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
  8325. * kjs/testkjs.cpp:
  8326. (main): Suppress C runtime alerts
  8327. 2006-04-28 Steve Falkenburg <sfalken@apple.com>
  8328. Reviewed by kdecker
  8329. Suppress error reporting dialog that blocks Javascript tests from completing.
  8330. Real error is due to an overflow in the date/time handling functions that needs
  8331. to be addressed, but this will prevent the hang running the Javascript tests
  8332. on the build bot (along with the related changes).
  8333. * kjs/testkjs.cpp:
  8334. (main): Suppress C runtime alerts
  8335. 2006-04-27 Geoffrey Garen <ggaren@apple.com>
  8336. Reviewed by Maciej
  8337. - Minor fixups I discovered while working on the autogenerator.
  8338. * kjs/lookup.cpp:
  8339. (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
  8340. compute a garbage address, and possibly crash.
  8341. * kjs/lookup.h:
  8342. (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
  8343. would be hidden entirely.
  8344. 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
  8345. Reviewed by Darin.
  8346. - http://bugs.webkit.org/show_bug.cgi?id=8507
  8347. Compilation fixes for building on gcc 4.0.2, and without precomp headers
  8348. * kjs/operations.h:
  8349. * kxmlcore/Assertions.cpp:
  8350. * kxmlcore/FastMalloc.cpp:
  8351. Added necessary headers to resolve compilation issues when not using
  8352. precompiled headers.
  8353. * kjs/value.h: Declare the JSCell class before friend declaration
  8354. to resolve compilation issues with gcc 4.0.2.
  8355. * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
  8356. other than KDE (previously only defined for Win and Mac OS)
  8357. 2006-04-18 Eric Seidel <eseidel@apple.com>
  8358. Reviewed by ggaren.
  8359. Fix "new Function()" to correctly use lexical scoping.
  8360. Add ScopeChain::print() function for debugging.
  8361. <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
  8362. * kjs/function_object.cpp:
  8363. (FunctionObjectImp::construct):
  8364. * kjs/scope_chain.cpp:
  8365. (KJS::ScopeChain::print):
  8366. * kjs/scope_chain.h:
  8367. 2006-04-14 James G. Speth <speth@end.com>
  8368. Reviewed by Timothy.
  8369. Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
  8370. http://bugs.webkit.org/show_bug.cgi?id=8389
  8371. Adds a category to WebScriptObject with array accessors for KVC/KVO.
  8372. If super valueForKey: fails it will call valueForUndefinedKey:, which is
  8373. important because it causes the right behavior to happen with bindings using
  8374. the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
  8375. * bindings/objc/WebScriptObject.mm:
  8376. (-[WebScriptObject valueForKey:]):
  8377. (-[WebScriptObject count]):
  8378. (-[WebScriptObject objectAtIndex:]):
  8379. (-[WebUndefined description]): return "undefined"
  8380. 2006-04-13 Geoffrey Garen <ggaren@apple.com>
  8381. Reviewed by Darin.
  8382. * kjs/internal.cpp:
  8383. (KJS::InterpreterImp::initGlobalObject): Add the built-in object
  8384. prototype to the end of the global object's prototype chain instead of
  8385. just blowing away its existing prototype. We need to do this because
  8386. the window object has a meaningful prototype now.
  8387. 2006-04-13 Maciej Stachowiak <mjs@apple.com>
  8388. Reviewed by Geoff.
  8389. - fix testkjs to not show false-positive KJS::Node leaks in debug builds
  8390. * kjs/testkjs.cpp:
  8391. (doIt):
  8392. (kjsmain):
  8393. 2006-04-11 Geoffrey Garen <ggaren@apple.com>
  8394. Reviewed by Maciej.
  8395. Minor code cleanup -- passes all the JS tests.
  8396. * kjs/object_object.cpp:
  8397. (ObjectObjectImp::construct):
  8398. (ObjectObjectImp::callAsFunction):
  8399. 2006-04-11 Darin Adler <darin@apple.com>
  8400. - another attempt to fix Windows build -- Vector in Forward.h was not working
  8401. * kxmlcore/Forward.h: Remove Vector.
  8402. * kxmlcore/Vector.h: Add back default arguments, remove include of
  8403. Forward.h.
  8404. 2006-04-11 Darin Adler <darin@apple.com>
  8405. - try to fix Windows build -- HashForward.h was not working
  8406. * kxmlcore/HashForward.h: Removed.
  8407. * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
  8408. * kjs/collector.h: Remove use of HashForward.h.
  8409. * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
  8410. default arguments.
  8411. * kxmlcore/HashMap.h: Ditto.
  8412. * kxmlcore/HashSet.h: Ditto.
  8413. 2006-04-11 David Harrison <harrison@apple.com>
  8414. Reviewed by Darin.
  8415. - fixed clean build, broken by Darin's check-in
  8416. * kjs/date_object.cpp: Add needed include of lookup.h.
  8417. * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
  8418. 2006-04-10 Darin Adler <darin@apple.com>
  8419. Rubber-stamped by John Sullivan.
  8420. - switched from a shell script to a makefile for generated files
  8421. - removed lots of unneeded includes
  8422. - added new Forward.h and HashForward.h headers that allow compiling with
  8423. fewer unneeded templates
  8424. * DerivedSources.make: Added.
  8425. * generate-derived-sources: Removed.
  8426. * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
  8427. DerivedSources.make.
  8428. * kxmlcore/Forward.h: Added.
  8429. * kxmlcore/HashForward.h: Added.
  8430. * kxmlcore/HashCountedSet.h: Include HashForward for default args.
  8431. * kxmlcore/HashMap.h: Ditto.
  8432. * kxmlcore/HashSet.h: Ditto.
  8433. * kjs/object.h:
  8434. * kjs/object.cpp:
  8435. Moved KJS_MAX_STACK into the .cpp file.
  8436. * bindings/NP_jsobject.cpp:
  8437. * bindings/c/c_instance.h:
  8438. * bindings/jni/jni_class.h:
  8439. * bindings/jni/jni_runtime.h:
  8440. * bindings/jni/jni_utility.h:
  8441. * bindings/objc/WebScriptObject.mm:
  8442. * bindings/objc/WebScriptObjectPrivate.h:
  8443. * bindings/objc/objc_class.h:
  8444. * bindings/objc/objc_class.mm:
  8445. * bindings/objc/objc_instance.h:
  8446. * bindings/objc/objc_instance.mm:
  8447. * bindings/objc/objc_runtime.mm:
  8448. * bindings/objc/objc_utility.mm:
  8449. * bindings/runtime.h:
  8450. * bindings/runtime_array.cpp:
  8451. * bindings/runtime_array.h:
  8452. * bindings/runtime_method.cpp:
  8453. * bindings/runtime_method.h:
  8454. * bindings/runtime_object.cpp:
  8455. * bindings/runtime_root.h:
  8456. * kjs/JSImmediate.cpp:
  8457. * kjs/Parser.h:
  8458. * kjs/array_object.cpp:
  8459. * kjs/array_object.h:
  8460. * kjs/bool_object.cpp:
  8461. * kjs/bool_object.h:
  8462. * kjs/collector.h:
  8463. * kjs/context.h:
  8464. * kjs/debugger.cpp:
  8465. * kjs/error_object.h:
  8466. * kjs/function_object.h:
  8467. * kjs/internal.h:
  8468. * kjs/lexer.cpp:
  8469. * kjs/math_object.cpp:
  8470. * kjs/math_object.h:
  8471. * kjs/nodes.cpp:
  8472. * kjs/nodes.h:
  8473. * kjs/number_object.cpp:
  8474. * kjs/number_object.h:
  8475. * kjs/object_object.cpp:
  8476. * kjs/operations.cpp:
  8477. * kjs/protected_reference.h:
  8478. * kjs/reference.h:
  8479. * kjs/reference_list.h:
  8480. * kjs/regexp_object.h:
  8481. * kjs/string_object.cpp:
  8482. * kjs/string_object.h:
  8483. * kjs/testkjs.cpp:
  8484. * kjs/value.cpp:
  8485. * kjs/value.h:
  8486. * kxmlcore/HashTable.h:
  8487. * kxmlcore/ListRefPtr.h:
  8488. * kxmlcore/TCPageMap.h:
  8489. * kxmlcore/Vector.h:
  8490. Removed unneeded header includes.
  8491. 2006-04-09 Geoffrey Garen <ggaren@apple.com>
  8492. Reviewed by eric.
  8493. - Fixed http://bugs.webkit.org/show_bug.cgi?id=8284
  8494. prevent unnecessary entries in the "nodes with extra refs" hash table
  8495. This patch switches manually RefPtr exchange with use of
  8496. RefPtr::release to ensure that a node's ref count never tops 1
  8497. (in the normal case).
  8498. * kjs/nodes.cpp:
  8499. (BlockNode::BlockNode):
  8500. (CaseBlockNode::CaseBlockNode):
  8501. * kjs/nodes.h:
  8502. (KJS::ArrayNode::ArrayNode):
  8503. (KJS::ObjectLiteralNode::ObjectLiteralNode):
  8504. (KJS::ArgumentsNode::ArgumentsNode):
  8505. (KJS::VarStatementNode::VarStatementNode):
  8506. (KJS::ForNode::ForNode):
  8507. (KJS::CaseClauseNode::CaseClauseNode):
  8508. (KJS::FuncExprNode::FuncExprNode):
  8509. (KJS::FuncDeclNode::FuncDeclNode):
  8510. 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
  8511. Reviewed by Darin.
  8512. One more attempt - use reinterpret_cast, rather than static_cast.
  8513. 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
  8514. Reviewed by Darin.
  8515. An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
  8516. * kxmlcore/unicode/icu/UnicodeIcu.h:
  8517. (KXMLCore::Unicode::toLower):
  8518. (KXMLCore::Unicode::toUpper):
  8519. 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
  8520. Reviewed by Darin.
  8521. - fix http://bugs.webkit.org/show_bug.cgi?id=8264
  8522. toLowerCase and toUpperCase don't honor special mappings
  8523. Test: fast/js/string-capitalization.html
  8524. * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
  8525. * icu/unicode/putil.h: Added (copied from WebCore).
  8526. * icu/unicode/uiter.h: Ditto.
  8527. * icu/unicode/ustring.h: Ditto.
  8528. * kjs/string_object.cpp:
  8529. (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
  8530. * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
  8531. * kjs/ustring.h: Ditto.
  8532. * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
  8533. * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
  8534. * kxmlcore/unicode/icu/UnicodeIcu.h:
  8535. (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
  8536. (KXMLCore::Unicode::toUpper): Ditto.
  8537. (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
  8538. (KXMLCore::Unicode::isSeparatorSpace): Ditto.
  8539. (KXMLCore::Unicode::category): Ditto.
  8540. * kxmlcore/unicode/qt4/UnicodeQt4.h:
  8541. (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
  8542. (KXMLCore::Unicode::toUpper): Ditto.
  8543. (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
  8544. (KXMLCore::Unicode::isSeparatorSpace): Ditto.
  8545. (KXMLCore::Unicode::category): Ditto.
  8546. * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
  8547. * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
  8548. 2006-04-05 Darin Adler <darin@apple.com>
  8549. - attempt to fix Windows build
  8550. * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
  8551. * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
  8552. 2006-04-05 Darin Adler <darin@apple.com>
  8553. - attempt to fix Windows build
  8554. * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
  8555. 2006-04-05 Darin Adler <darin@apple.com>
  8556. Reviewed by Maciej.
  8557. - fix memory leak introduced by the previous change
  8558. * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
  8559. the value in question is a pair where one of the pair needs a ref and the other
  8560. of the pair does not.
  8561. 2006-04-05 Darin Adler <darin@apple.com>
  8562. Reviewed by Maciej.
  8563. - JavaScriptCore part of fix for http://bugs.webkit.org/show_bug.cgi?id=8049
  8564. StringImpl hash traits deleted value creates an init routine for WebCore
  8565. <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
  8566. Change HashMap and HashSet implementation so they fold various types together.
  8567. This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
  8568. and WebCore::String in terms of the underlying raw pointer type, and hence use
  8569. -1 for the deleted value.
  8570. * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
  8571. type to be used when storing a value that has the same layout as the type itself.
  8572. This is used only for non-key cases. In the case of keys, the hash function must also
  8573. be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
  8574. Added a new bool to HashTraits, needsRef, which indicates whether the type needs
  8575. explicit reference counting. If the type itself has needsRef true, but the storage
  8576. type has needsRef false, then the HashSet or HashMap has to handle the reference
  8577. counting explicitly. Added hash trait specializations for all signed integer values
  8578. that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
  8579. integer type of the same size so int and long will share code. Gave all pointers and
  8580. RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
  8581. TraitType and emptyValue definitions in the pointer specialization for HashTraits.
  8582. Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
  8583. Useful for types where we don't want to force the existence of deletedValue, such as
  8584. the type of a pair in a HashMap which is not the actual storage type. Removed an
  8585. unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
  8586. template, which determines what type can be used to store a given hash key type with
  8587. a given hash function, and specialized it for pointers and RefPtr so that pointer
  8588. hash tables share an underlying HashTable that uses IntHash.
  8589. * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
  8590. NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
  8591. HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
  8592. tables where the type stored is not the same as the real value type.
  8593. * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
  8594. integer type given a sizeof value. Renamed pointerHash to intHash and made it
  8595. use overloading and take integer parameters. Added an IntHash struct which is
  8596. a hash function that works for integers. Changed PtrHash to call IntHash with
  8597. an appropriately sized integer. Made IntHash the default hash function for
  8598. many integer types. Made PtrHash the default hash function for RefPtr as well
  8599. as for raw pointers.
  8600. * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
  8601. derived from the new traits. The HashTable will use the storage type and all
  8602. necessary translation and ref/deref is done at the HashSet level. Also reorganized
  8603. the file so that the HashSet is at the top and has no inline implementation inside
  8604. it so it's easy to read the interface to HashSet.
  8605. * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
  8606. derived from the new traits. The HashTable will use the storage type and all
  8607. necessary translation and ref/deref is done at the HashMap level. Also reorganized
  8608. the file so that the HashMap is at the top and has no inline implementation inside
  8609. it so it's easy to read the interface to HashMap.
  8610. * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
  8611. * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
  8612. and also remove some unnecessary build settings from the aggregate target that
  8613. generates derived sources.
  8614. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
  8615. 2006-04-04 Timothy Hatcher <timothy@apple.com>
  8616. Reviewed by Darin.
  8617. The Debug and Release frameworks are now built with install paths relative to the build products directory.
  8618. This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
  8619. * JavaScriptCore.xcodeproj/project.pbxproj:
  8620. 2006-04-04 Eric Seidel <eseidel@apple.com>
  8621. Reviewed by ggaren.
  8622. Fix win32 build.
  8623. Disable ASSERT redefinition warnings for now.
  8624. * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
  8625. * kxmlcore/Assertions.h:
  8626. 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
  8627. Reviewed by ggaren & darin. Landed by eseidel.
  8628. Integrate CURL version of gettimeofday
  8629. http://bugs.webkit.org/show_bug.cgi?id=7399
  8630. Disable crash report dialogs for testkjs.exe in Release mode
  8631. http://bugs.webkit.org/show_bug.cgi?id=8113
  8632. * kjs/testkjs.cpp:
  8633. (StopWatch::start):
  8634. (StopWatch::stop):
  8635. (StopWatch::getElapsedMS):
  8636. (main):
  8637. (kjsmain):
  8638. 2006-04-04 Eric Seidel <eseidel@apple.com>
  8639. Reviewed by mjs.
  8640. * kjs/number_object.cpp:
  8641. (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
  8642. 2006-03-12 Maciej Stachowiak <mjs@apple.com>
  8643. Reviewed by Darin.
  8644. - fixed "toPrecision sometimes messes up the last digit on intel Macs"
  8645. http://bugs.webkit.org/show_bug.cgi?id=7748
  8646. * kjs/number_object.cpp:
  8647. (intPow10): Compute integer powers of 10 using exponentiation by squaring.
  8648. (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
  8649. plus a bit of refactoring.
  8650. 2006-04-03 Darin Adler <darin@apple.com>
  8651. - tweak config.h and Platform.h to try to get buildbot working
  8652. (making some small changes at the same time)
  8653. * kjs/config.h: Removed now-unneeded HAVE_ICU.
  8654. * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
  8655. USE stuff to the end.
  8656. 2006-04-03 George Staikos <staikos@opensource.apple.com>
  8657. Reviewed by Maciej.
  8658. Fix Win32 build breakage from previous commit, remove unused forward.
  8659. 2006-04-03 George Staikos <staikos@opensource.apple.com>
  8660. Reviewed by Maciej.
  8661. Implement a unicode abstraction layer to make JavaScriptCore much more
  8662. easily ported to other platforms without having to take in libicu. Also
  8663. makes the unicode related code easier to understand.
  8664. 2006-04-03 Timothy Hatcher <timothy@apple.com>
  8665. Reviewed by Adele.
  8666. Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
  8667. Other 64 bit build fixes.
  8668. * kjs/collector.cpp:
  8669. (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
  8670. * kjs/dtoa.cpp:
  8671. (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
  8672. * bindings/jni/jni_utility.cpp:
  8673. (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
  8674. (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
  8675. * bindings/runtime_root.cpp:
  8676. (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
  8677. (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
  8678. 2006-03-31 Darin Adler <darin@apple.com>
  8679. Reviewed by Geoff.
  8680. - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
  8681. * bindings/objc/WebScriptObject.h: Fixed comment.
  8682. 2006-03-31 Eric Seidel <eseidel@apple.com>
  8683. Reviewed by mjs.
  8684. A bit more code cleanup.
  8685. * bindings/c/c_utility.cpp:
  8686. (KJS::Bindings::convertValueToNPVariant):
  8687. * bindings/objc/objc_runtime.mm:
  8688. (convertValueToObjcObject):
  8689. * bindings/objc/objc_utility.mm:
  8690. (KJS::Bindings::convertValueToObjcValue):
  8691. * kjs/function.cpp:
  8692. (KJS::GlobalFuncImp::callAsFunction):
  8693. * kjs/interpreter.cpp:
  8694. (KJS::ExecState::lexicalInterpreter):
  8695. * kjs/interpreter.h:
  8696. * kjs/operations.cpp:
  8697. (KJS::equal):
  8698. 2006-03-30 Eric Seidel <eseidel@apple.com>
  8699. Reviewed by anders.
  8700. Small code-style update.
  8701. * kjs/operations.cpp:
  8702. (KJS::isNaN):
  8703. (KJS::isInf):
  8704. (KJS::isPosInf):
  8705. (KJS::isNegInf):
  8706. (KJS::equal):
  8707. (KJS::strictEqual):
  8708. (KJS::relation):
  8709. (KJS::maxInt):
  8710. (KJS::minInt):
  8711. (KJS::add):
  8712. (KJS::mult):
  8713. 2006-03-31 Anders Carlsson <andersca@mac.com>
  8714. Reviewed by Maciej.
  8715. Make sure the GetterSetterImp objects are marked as well.
  8716. * kjs/internal.cpp:
  8717. (KJS::GetterSetterImp::mark):
  8718. Call JSCell::mark().
  8719. 2006-03-30 Eric Seidel <eseidel@apple.com>
  8720. Reviewed by ggaren.
  8721. * kjs/nodes.h: Some various small style fixes.
  8722. 2006-03-30 Eric Seidel <eseidel@apple.com>
  8723. Reviewed by ggaren.
  8724. Clean-up style issues in node.h, remove redundant initializations.
  8725. * kjs/nodes.h:
  8726. (KJS::StatementNode::evaluate):
  8727. (KJS::ArrayNode::ArrayNode):
  8728. (KJS::ObjectLiteralNode::ObjectLiteralNode):
  8729. (KJS::ArgumentsNode::ArgumentsNode):
  8730. (KJS::NewExprNode::NewExprNode):
  8731. (KJS::CaseClauseNode::CaseClauseNode):
  8732. (KJS::FuncDeclNode::FuncDeclNode):
  8733. 2006-03-30 Tim Omernick <timo@apple.com>
  8734. Reviewed by Geoff.
  8735. <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
  8736. not object
  8737. * bindings/runtime.h:
  8738. (KJS::Bindings::Instance::implementsCall):
  8739. New method. Returns false by default. Concrete subclasses can override this return true when
  8740. the bound object may be called as a function.
  8741. (KJS::Bindings::Instance::invokeDefaultMethod):
  8742. Since bound objects are no longer treated as functions by default, we can return jsUndefined()
  8743. here instead of in concrete subclasses that decide not to implement the default method
  8744. functionality.
  8745. * bindings/runtime_object.cpp:
  8746. (RuntimeObjectImp::implementsCall):
  8747. Don't assume that the bound object is a function; instead, let the object instance decide whether
  8748. it is callable.
  8749. * bindings/c/c_instance.h:
  8750. * bindings/c/c_instance.cpp:
  8751. (KJS::Bindings::CInstance::implementsCall):
  8752. The object is callable if its class has an invokeDefault function.
  8753. * bindings/objc/objc_instance.h:
  8754. * bindings/objc/objc_instance.mm:
  8755. (ObjcInstance::implementsCall):
  8756. The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
  8757. * bindings/jni/jni_instance.h:
  8758. * bindings/jni/jni_instance.cpp:
  8759. Moved bogus invokeDefaultMethod() to superclass.
  8760. 2006-03-29 Geoffrey Garen <ggaren@apple.com>
  8761. Reviewed by Darin.
  8762. - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
  8763. Regression: crash in malloc_consolidate if you use a .PAC file
  8764. The crash was a result of threaded deallocation of thread-unsafe
  8765. objects. Pure JS objects are thread-safe because all JS execution
  8766. is synchronized through JSLock. However, JS objects that wrap WebCore
  8767. objects are thread-unsafe because JS and WebCore execution are not
  8768. synchronized. That unsafety comes into play when the collector
  8769. deallocates a JS object that wraps a WebCore object, thus causing the
  8770. WebCore object to be deallocated.
  8771. The solution here is to have each JSCell know whether it is safe to
  8772. collect on a non-main thread, and to avoid collecting unsafe cells
  8773. when on a non-main thread.
  8774. We don't have a way to test PAC files yet, so there's no test
  8775. attached to this patch.
  8776. * kjs/collector.cpp:
  8777. (KJS::Collector::collect):
  8778. (1) Added the test "currentThreadIsMainThread ||
  8779. imp->m_destructorIsThreadSafe".
  8780. * kjs/protect.h:
  8781. (KJS::gcProtectNullTolerant):
  8782. (KJS::gcUnprotectNullTolerant):
  8783. * kjs/value.h:
  8784. (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
  8785. m_destructorIsThreadSafe becomes another whole word, ruining the
  8786. collector optimizations we've made based on the size of a JSObject.
  8787. * kxmlcore/FastMalloc.cpp:
  8788. (KXMLCore::currentThreadIsMainThread):
  8789. (KXMLCore::fastMallocRegisterThread):
  8790. * kxmlcore/FastMalloc.h:
  8791. 2006-03-28 Darin Adler <darin@apple.com>
  8792. Reviewed by Geoff.
  8793. - change some code that resulted in init routines on Mac OS X -- if the framework has
  8794. init routines it will use memory and slow down applications that link with WebKit
  8795. even in cases where those applications don't use WebKit
  8796. * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
  8797. to use immediate numbers instead. Apparently, double constant expressions of the type we
  8798. had here are evaluated at load time.
  8799. * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
  8800. ListImp, so go back to using a plain old pointer.
  8801. (KJS::List::List): Set overflow to 0 when initializing ListImp.
  8802. (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
  8803. (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
  8804. a swap of OwnArrayPtr.
  8805. (KJS::List::copyFrom): Remove now-unneeded get().
  8806. (KJS::List::copyTail): Ditto.
  8807. * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
  8808. a static initializer routine. Had to get rid of one level of constant to get the compiler
  8809. to understand it could initialize without any code.
  8810. - added a build step that checks for init routines
  8811. * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
  8812. was replaced by the generate-derived-sources script a while back. Added a custom build
  8813. phase that invokes the check-for-global-initializers script.
  8814. 2006-03-28 Timothy Hatcher <timothy@apple.com>
  8815. Reviewed by Eric.
  8816. fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
  8817. * bindings/npapi.h: added #defines after the #ifndefs
  8818. 2006-03-27 Maciej Stachowiak <mjs@apple.com>
  8819. Reviewed by Anders.
  8820. - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
  8821. * kjs/nodes.cpp:
  8822. (Node::deref): take into account the case where the extra refcount table was never created
  8823. 2006-03-23 David Carson <dacarson@gmail.com>
  8824. Reviewed by Darin.
  8825. - JSObject in LiveConnect not working.
  8826. http://bugs.webkit.org/show_bug.cgi?id=7917
  8827. * bindings/jni_jsobject.cpp:
  8828. (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
  8829. class, and the GetFieldID was using the wrong signature.
  8830. 2006-03-23 Darin Adler <darin@apple.com>
  8831. Reviewed by Maciej.
  8832. - fix buildbot
  8833. * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
  8834. Also add -Y 3 option for linker.
  8835. 2006-03-23 Darin Adler <darin@apple.com>
  8836. Reviewed by Maciej.
  8837. - fix http://bugs.webkit.org/show_bug.cgi?id=7726
  8838. REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
  8839. * kjs/object.h: Take function name, as well as source URL and line number, when
  8840. using the special overloaded construct for making functions.
  8841. * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
  8842. * kjs/function_object.h: Ditto.
  8843. * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
  8844. constructing the function rather than null. Use "anonymous" when making a
  8845. function using the default function constructor.
  8846. * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
  8847. a function declaration.
  8848. - unrelated fix
  8849. * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
  8850. 2006-03-23 Darin Adler <darin@apple.com>
  8851. Reviewed by Maciej.
  8852. - fix http://bugs.webkit.org/show_bug.cgi?id=7805
  8853. LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
  8854. * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
  8855. * bindings/c/c_utility.cpp:
  8856. (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
  8857. BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
  8858. OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
  8859. one case and remove a _NPN_ReleaseObject in another because this
  8860. should return a retained value.
  8861. (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
  8862. NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
  8863. * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
  8864. CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
  8865. * bindings/c/c_runtime.cpp:
  8866. (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
  8867. method object.
  8868. (KJS::Bindings::CField::name): Added. Returns the string from inside the
  8869. field object.
  8870. (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
  8871. on the result of getProperty after using it to fix a storage leak.
  8872. (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
  8873. after pasing a value to setProperty now that the conversion function does a retain.
  8874. * bindings/c/c_instance.cpp:
  8875. (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
  8876. stack buffer. Removed special case for NPVARIANT_IS_VOID because the
  8877. convertNPVariantToValue function handles that properly.
  8878. (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
  8879. * bindings/NP_jsobject.h: Formatting changes only.
  8880. * bindings/NP_jsobject.cpp:
  8881. (jsDeallocate): Changed parameter type so we don't need a function cast.
  8882. (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
  8883. (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
  8884. (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
  8885. (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
  8886. * bindings/c/c_class.cpp: Formatting changes only.
  8887. * bindings/c/c_class.h: Formatting changes only.
  8888. * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
  8889. NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
  8890. NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
  8891. NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
  8892. NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
  8893. NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
  8894. NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
  8895. NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
  8896. NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
  8897. NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
  8898. * bindings/npruntime.cpp:
  8899. (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
  8900. integer dictionary since the default behavior is fine for integers.
  8901. 2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
  8902. Reviewed and landed by Maciej.
  8903. - WebKit no longer builds with bison 2.1
  8904. http://bugs.webkit.org/show_bug.cgi?id=7923
  8905. * generate-derived-sources: Handle generated header named either grammar.cpp.h
  8906. or grammar.hpp.
  8907. 2006-03-22 Maciej Stachowiak <mjs@apple.com>
  8908. - fix the build
  8909. * JavaScriptCore.xcodeproj/project.pbxproj:
  8910. 2006-03-21 Maciej Stachowiak <mjs@apple.com>
  8911. * kjs/generate-derived-sources: Set executable property.
  8912. 2006-03-21 Maciej Stachowiak <mjs@apple.com>
  8913. Reviewed by Darin.
  8914. Ensure that generated source dependencies are handled properly, as follows:
  8915. - Made an external script that generates the sources into a
  8916. DerivedSources dir in the build products directory.
  8917. - Added a new build target that builds all the generated sources
  8918. if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
  8919. - Added the DerivedSources dir in question to the include path.
  8920. - Added the new DerivedSources dir and its contents to the project as build-relative.
  8921. * JavaScriptCore.xcodeproj/project.pbxproj:
  8922. * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
  8923. can share more.
  8924. 2006-03-11 Maciej Stachowiak <mjs@apple.com>
  8925. Reviewed by Darin.
  8926. - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
  8927. http://bugs.webkit.org/show_bug.cgi?id=7745
  8928. * kjs/ustring.cpp:
  8929. (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
  8930. 2006-03-16 Maciej Stachowiak <mjs@apple.com>
  8931. Reviewed by Darin.
  8932. - tweaks to my change to redo KJS::Node refcounting
  8933. * kjs/nodes.cpp:
  8934. (Node::ref):
  8935. (Node::deref):
  8936. (Node::refcount):
  8937. (Node::clearNewNodes):
  8938. * kjs/nodes.h:
  8939. 2006-03-16 Darin Adler <darin@apple.com>
  8940. Reviewed by Maciej.
  8941. - fixed Vector so that you can pass a reference to something in the vector
  8942. to the append or insert functions
  8943. * kxmlcore/Vector.h:
  8944. (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
  8945. and return the adjusted value of the pointer.
  8946. (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
  8947. adding the new element. Makes the case where the element moves when the vector
  8948. is expanded work.
  8949. (KXMLCore::Vector::insert): Ditto.
  8950. 2006-03-15 Eric Seidel <eseidel@apple.com>
  8951. Reviewed by adele.
  8952. Build fix.
  8953. * kjs/date_object.cpp:
  8954. (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
  8955. 2006-03-15 Eric Seidel <eseidel@apple.com>
  8956. Reviewed by mjs.
  8957. Fix CString copy constructor, fixes Date.parse("") on Win32.
  8958. * kjs/date_object.cpp:
  8959. (KJS::DateProtoFunc::callAsFunction):
  8960. * kjs/ustring.cpp:
  8961. (KJS::CString::CString):
  8962. (KJS::CString::operator=):
  8963. 2006-03-13 Maciej Stachowiak <mjs@apple.com>
  8964. Reviewed by Anders.
  8965. - KJS::Node and KJS::StatementNode are bigger than they need to be
  8966. http://bugs.webkit.org/show_bug.cgi?id=7775
  8967. The memory usage of Node was reduced by 2 machine words per node:
  8968. - sourceURL was removed and only kept on FunctionBodyNode. The
  8969. source URL can only be distinct per function or top-level program node,
  8970. and you always have one.
  8971. - refcount was removed and kept in a separate hashtable when
  8972. greater than 1. newNodes set represents floating nodes with
  8973. refcount of 0. This helps because almost all nodes have a refcount of 1
  8974. for almost all of their lifetime.
  8975. * bindings/runtime_method.cpp:
  8976. (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
  8977. * kjs/Parser.cpp:
  8978. (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
  8979. them at the appropriate time.
  8980. * kjs/context.h:
  8981. (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
  8982. for current code.
  8983. (KJS::ContextImp::pushIteration): moved here from LabelStack
  8984. (KJS::ContextImp::popIteration): ditto
  8985. (KJS::ContextImp::inIteration): ditto
  8986. (KJS::ContextImp::pushSwitch): ditto
  8987. (KJS::ContextImp::popSwitch): ditto
  8988. (KJS::ContextImp::inSwitch): ditto
  8989. * kjs/function.cpp:
  8990. (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
  8991. (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
  8992. (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
  8993. (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
  8994. constructor.
  8995. (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
  8996. eval.
  8997. * kjs/function.h: Move body field from DeclaredFunctionImp to
  8998. FunctionImp.
  8999. * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
  9000. * kjs/internal.cpp:
  9001. (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
  9002. and m_switchDepth data members. New FunctionBodyNode* parameter - the
  9003. function body provides source URL and SourceId.
  9004. (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
  9005. (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
  9006. to use as the body.
  9007. * kjs/internal.h:
  9008. (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
  9009. statement label stacks don't need these and it bloats their size. Put them
  9010. in the ContextImp instead.
  9011. * kjs/interpreter.cpp:
  9012. (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
  9013. * kjs/interpreter.h:
  9014. (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
  9015. (KJS::ExecState::context): ditto
  9016. (KJS::ExecState::setException): Renamed _exception to m_exception
  9017. (KJS::ExecState::clearException): ditto
  9018. (KJS::ExecState::exception): ditto
  9019. (KJS::ExecState::hadException): ditto
  9020. (KJS::ExecState::ExecState): ditto both above renames
  9021. * kjs/nodes.cpp:
  9022. (Node::Node): Removed initialization of line, source URL and refcount. Add to
  9023. local newNodes set instead of involving parser.
  9024. (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
  9025. HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
  9026. 0.
  9027. (Node::deref): ditto
  9028. (Node::refcount): ditto
  9029. (Node::clearNewNodes): Destroy anything left in the new nodes set.
  9030. (currentSourceId): Inline helper to get sourceId from function body via context.
  9031. (currentSourceURL): ditto for sourceURL.
  9032. (Node::createErrorCompletion): use new helper
  9033. (Node::throwError): ditto
  9034. (Node::setExceptionDetailsIfNeeded): ditto
  9035. (StatementNode::StatementNode): remove initialization of l0 and sid, rename
  9036. l1 to m_lastLine.
  9037. (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
  9038. (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
  9039. (StatListNode::StatListNode): updated for setLoc changes
  9040. (BlockNode::BlockNode): ditto
  9041. (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
  9042. (WhileNode::execute): ditto
  9043. (ForNode::execute): ditto
  9044. (ForInNode::execute): ditto
  9045. (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
  9046. (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
  9047. (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
  9048. (FunctionBodyNode::FunctionBodyNode): update for new setLoc
  9049. (FunctionBodyNode::processFuncDecl): reindent
  9050. (SourceElementsNode::SourceElementsNode): update for new setLoc
  9051. * kjs/nodes.h:
  9052. (KJS::Node::lineNo): Renamed _line to m_line
  9053. (KJS::StatementNode::firstLine): Use lineNo()
  9054. (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
  9055. (KJS::FunctionBodyNode::sourceId): added
  9056. (KJS::FunctionBodyNode::sourceURL): added
  9057. * kjs/testkjs.cpp:
  9058. 2006-03-14 Geoffrey Garen <ggaren@apple.com>
  9059. - Fixed <rdar://problem/4478239> string sort puts "closed" before
  9060. "close"
  9061. Reviewed by Eric.
  9062. * kjs/ustring.cpp:
  9063. (KJS::compare): Inverted a < in order to treat the longer string as >
  9064. the shorter string.
  9065. 2006-03-12 Alexey Proskuryakov <ap@nypop.com>
  9066. Reviewed by Maciej.
  9067. - fix http://bugs.webkit.org/show_bug.cgi?id=7708
  9068. REGRESSION: Flash callback to JavaScript function not working.
  9069. Test: plugins/invoke.html
  9070. * bindings/c/c_utility.cpp:
  9071. (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
  9072. 2006-03-08 Eric Seidel <eseidel@apple.com>
  9073. Reviewed by darin.
  9074. Partially fix JS on win32 by fixing hash table generation.
  9075. * kjs/create_hash_table: limit << results to 32 bits.
  9076. * kjs/testkjs.cpp:
  9077. (TestFunctionImp::callAsFunction):
  9078. 2006-03-07 Darin Adler <darin@apple.com>
  9079. * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
  9080. 2006-03-07 Darin Adler <darin@apple.com>
  9081. Reviewed by Anders.
  9082. - fix http://bugs.webkit.org/show_bug.cgi?id=7655
  9083. unwanted output while running layout tests
  9084. * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
  9085. * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
  9086. to standard output. I think we should arrange for the error text to be in JavaScript
  9087. exceptions instead at some point.
  9088. * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
  9089. too-large size rather than allocating a buffer smaller than requested.
  9090. 2006-03-06 David Carson <dacarson@gmail.com>
  9091. Reviewed by Darin, landed by ap.
  9092. - Fixed http://bugs.webkit.org/show_bug.cgi?id=7582
  9093. c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
  9094. Tested with test case from:
  9095. http://bugs.webkit.org/show_bug.cgi?id=5163
  9096. * bindings/c_utility.cpp
  9097. (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
  9098. * icu/unicode/ucnv.h: Copied from WebCore.
  9099. * icu/unicode/ucnv_err.h: Ditto.
  9100. * icu/unicode/uenum.h: Ditto.
  9101. 2006-03-05 Darin Adler <darin@apple.com>
  9102. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
  9103. 2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
  9104. Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
  9105. - fix http://bugs.webkit.org/show_bug.cgi?id=7601
  9106. REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
  9107. * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
  9108. 2006-03-05 Darin Adler <darin@apple.com>
  9109. Reviewed by Maciej.
  9110. - http://bugs.webkit.org/show_bug.cgi?id=7616
  9111. get all references to KJS::Node out of internal.h
  9112. * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
  9113. * kjs/Parser.cpp: Added.
  9114. * kjs/Parser.h: Added.
  9115. * kjs/internal.cpp: Removed the Parser class.
  9116. * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
  9117. not used in this header.
  9118. * kjs/nodes.h: Added an include of "Parser.h".
  9119. * kjs/function.h: Added a declaration of FunctionBodyNode.
  9120. 2006-03-05 Geoffrey Garen <ggaren@apple.com>
  9121. Reviewed by Maciej.
  9122. - JSC support for the fix for <rdar://problem/4467143> JavaScript
  9123. enumeration of HTML element properties skips DOM node properties
  9124. * kjs/lookup.h:
  9125. (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
  9126. class definiton macro needs to know about the prototype's prototype so
  9127. that the class constructor properly sets it.
  9128. (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
  9129. implementation macro does not need to know about the prototype's
  9130. prototype, since getOwnPropertySlot should only look in the current
  9131. object's property map, and not its prototype's.
  9132. 2006-03-05 Andrew Wellington <proton@wiretapped.net>
  9133. Reviewed by Eric, landed by ap.
  9134. - Remove unused breakpoint bool from StatementNodes. No test provided as
  9135. there is no functionality change.
  9136. * kjs/nodes.cpp:
  9137. (StatementNode::StatementNode):
  9138. * kjs/nodes.h:
  9139. 2006-03-03 Geoffrey Garen <ggaren@apple.com>
  9140. Reviewed by Darin.
  9141. - Fixed <rdar://problem/4465598> REGRESSION (TOT): Crash occurs at
  9142. http://maps.google.com/?output=html ( KJS::Identifier::add(KJS::UString::Rep*)
  9143. This regression was caused by my fix for 4448098. I failed to account for the
  9144. deleted entry sentinel in the mehtod that saves the contents of a property map to
  9145. the back/forward cache.
  9146. Manual test in WebCore/manual-tests/property-map-save-crash.html
  9147. * kjs/property_map.cpp:
  9148. (KJS::deletedSentinel): Use 1 instead of -1 to facilitate an easy bit mask
  9149. (KJS::isValid): New function: checks if a key is null or the deleted sentinel
  9150. (KJS::PropertyMap::~PropertyMap): Fixed up the branch logic here for readability
  9151. and a slight performance win
  9152. (KJS::PropertyMap::clear):
  9153. (KJS::PropertyMap::rehash):
  9154. (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
  9155. (KJS::PropertyMap::save): Check keys with isValid()
  9156. 2006-03-02 Maciej Stachowiak <mjs@apple.com>
  9157. - now fix mac build again
  9158. * kjs/identifier.cpp:
  9159. 2006-03-02 Maciej Stachowiak <mjs@apple.com>
  9160. Rubber stamped by Anders and Eric.
  9161. - add fpconst.cpp to win32 build, it is now needed
  9162. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  9163. * kjs/fpconst.cpp:
  9164. 2006-03-02 Maciej Stachowiak <mjs@apple.com>
  9165. Reviewed by Eric.
  9166. - fix windows build, broken by my last patch
  9167. * kjs/JSImmediate.cpp:
  9168. * kjs/identifier.cpp:
  9169. * kxmlcore/FastMalloc.cpp:
  9170. * kxmlcore/Platform.h:
  9171. 2006-03-01 Maciej Stachowiak <mjs@apple.com>
  9172. Reviewed by Darin.
  9173. - Set up new prototype macros and avoid using #if without defined() in JSC
  9174. Added new PLATFORM macros and related, to make sure #if's all check if relevant macros
  9175. are defined, and to separate core OS-level dependencies from operating environment
  9176. dependencies so you can, e.g., build KDE on Mac or Windows.
  9177. * kxmlcore/Platform.h: Added.
  9178. - deploy them everywhere in JavaScriptCore
  9179. * JavaScriptCore.xcodeproj/project.pbxproj:
  9180. * bindings/jni/jni_utility.cpp:
  9181. (KJS::Bindings::convertValueToJValue):
  9182. * bindings/objc/WebScriptObject.mm:
  9183. * bindings/objc/objc_instance.mm:
  9184. (ObjcInstance::end):
  9185. * bindings/softlinking.h:
  9186. * bindings/testbindings.mm:
  9187. (main):
  9188. * kjs/JSLock.cpp:
  9189. * kjs/collector.cpp:
  9190. (KJS::Collector::markCurrentThreadConservatively):
  9191. (KJS::Collector::markOtherThreadConservatively):
  9192. (KJS::Collector::markStackObjectsConservatively):
  9193. * kjs/config.h:
  9194. * kjs/date_object.cpp:
  9195. (gmtoffset):
  9196. (KJS::formatTime):
  9197. (KJS::DateProtoFunc::callAsFunction):
  9198. (KJS::DateObjectImp::construct):
  9199. (KJS::makeTime):
  9200. * kjs/dtoa.cpp:
  9201. * kjs/fpconst.cpp:
  9202. (KJS::sizeof):
  9203. (KJS::):
  9204. * kjs/grammar.y:
  9205. * kjs/identifier.cpp:
  9206. * kjs/internal.cpp:
  9207. * kjs/interpreter.cpp:
  9208. (KJS::Interpreter::evaluate):
  9209. (KJS::Interpreter::createLanguageInstanceForValue):
  9210. * kjs/interpreter.h:
  9211. * kjs/lookup.cpp:
  9212. * kjs/lookup.h:
  9213. * kjs/math_object.cpp:
  9214. * kjs/object.cpp:
  9215. * kjs/object.h:
  9216. * kjs/operations.cpp:
  9217. (KJS::isNaN):
  9218. (KJS::isInf):
  9219. (KJS::isPosInf):
  9220. (KJS::isNegInf):
  9221. * kjs/operations.h:
  9222. * kjs/regexp.cpp:
  9223. (KJS::RegExp::RegExp):
  9224. (KJS::RegExp::~RegExp):
  9225. (KJS::RegExp::match):
  9226. * kjs/regexp.h:
  9227. * kjs/testkjs.cpp:
  9228. (StopWatch::start):
  9229. (StopWatch::stop):
  9230. (StopWatch::getElapsedMS):
  9231. * kjs/ustring.cpp:
  9232. * kjs/ustring.h:
  9233. * kxmlcore/AlwaysInline.h:
  9234. * kxmlcore/Assertions.cpp:
  9235. * kxmlcore/Assertions.h:
  9236. * kxmlcore/FastMalloc.cpp:
  9237. (KXMLCore::):
  9238. * kxmlcore/FastMalloc.h:
  9239. * kxmlcore/FastMallocInternal.h:
  9240. * kxmlcore/HashTable.h:
  9241. * kxmlcore/TCPageMap.h:
  9242. * kxmlcore/TCSpinLock.h:
  9243. (TCMalloc_SpinLock::Lock):
  9244. (TCMalloc_SpinLock::Unlock):
  9245. (TCMalloc_SlowLock):
  9246. * kxmlcore/TCSystemAlloc.cpp:
  9247. (TCMalloc_SystemAlloc):
  9248. * os-win32/stdint.h:
  9249. 2006-02-28 Geoffrey Garen <ggaren@apple.com>
  9250. Reviewed by Darin.
  9251. - Fixed <rdar://problem/4448098> Switch PropertyMap deleted entry
  9252. placeholder to -1 from UString::Rep::null
  9253. This turned out to be only a small speedup (.12%). That's within the
  9254. margin of error for super accurate JS iBench, but Shark confirms the
  9255. same, so I think it's worth landing.
  9256. FYI, I also confirmed that the single entry optimization in
  9257. PropertyMap is a 3.2% speedup.
  9258. * kjs/property_map.cpp:
  9259. (KJS::PropertyMap::~PropertyMap):
  9260. (KJS::PropertyMap::clear):
  9261. (KJS::PropertyMap::put):
  9262. (KJS::PropertyMap::insert):
  9263. (KJS::PropertyMap::rehash):
  9264. (KJS::PropertyMap::remove):
  9265. (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
  9266. (KJS::PropertyMap::checkConsistency):
  9267. * kjs/property_map.h:
  9268. (KJS::PropertyMap::deletedSentinel):
  9269. 2006-02-27 Eric Seidel <eseidel@apple.com>
  9270. Rubber-stamped by darin.
  9271. Remove fpconst.cpp, unused on win32 and the cause of linker warnings.
  9272. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  9273. 2006-02-27 Eric Seidel <eseidel@apple.com>
  9274. Reviewed by mjs.
  9275. Fix Assertions.cpp to compile on win32.
  9276. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  9277. * kxmlcore/Assertions.cpp:
  9278. 2006-02-27 Eric Seidel <eseidel@apple.com>
  9279. Reviewed by mjs.
  9280. Made Assertions.cpp platform independent.
  9281. Moved mac-specific logging logic up into WebCore.
  9282. http://bugs.webkit.org/show_bug.cgi?id=7503
  9283. * JavaScriptCore.xcodeproj/project.pbxproj:
  9284. * kxmlcore/Assertions.cpp: Added.
  9285. * kxmlcore/Assertions.h:
  9286. * kxmlcore/Assertions.mm: Removed.
  9287. 2006-02-27 Darin Adler <darin@apple.com>
  9288. - fixed Mac Debug build, there was an unused parameter
  9289. * kxmlcore/FastMalloc.cpp: (KXMLCore::fastMallocRegisterThread):
  9290. Remove parameter name.
  9291. * kjs/debugger.h: Fixed comment.
  9292. 2006-02-27 Eric Seidel <eseidel@apple.com>
  9293. Reviewed by darin.
  9294. * kxmlcore/Vector.h:
  9295. (KXMLCore::deleteAllValues): fix unused variable warning
  9296. 2006-02-21 Maciej Stachowiak <mjs@apple.com>
  9297. Reviewed by Darin.
  9298. - Turn off -Wno-unused-param for JavaScriptCore and get rid of unused params
  9299. http://bugs.webkit.org/show_bug.cgi?id=7384
  9300. * JavaScriptCore.xcodeproj/project.pbxproj:
  9301. * bindings/NP_jsobject.cpp:
  9302. (jsAllocate):
  9303. (_NPN_InvokeDefault):
  9304. (_NPN_Evaluate):
  9305. (_NPN_GetProperty):
  9306. (_NPN_SetProperty):
  9307. (_NPN_RemoveProperty):
  9308. (_NPN_HasProperty):
  9309. (_NPN_HasMethod):
  9310. * bindings/c/c_class.h:
  9311. (KJS::Bindings::CClass::constructorAt):
  9312. * bindings/c/c_utility.cpp:
  9313. (KJS::Bindings::convertNPVariantToValue):
  9314. * bindings/jni/jni_class.cpp:
  9315. (JavaClass::methodsNamed):
  9316. (JavaClass::fieldNamed):
  9317. * bindings/jni/jni_instance.cpp:
  9318. (JavaInstance::invokeDefaultMethod):
  9319. * bindings/jni/jni_jsobject.cpp:
  9320. * bindings/jni/jni_objc.mm:
  9321. (-[NSObject KJS::Bindings::]):
  9322. * bindings/objc/WebScriptObject.mm:
  9323. (+[WebUndefined allocWithZone:]):
  9324. (-[WebUndefined initWithCoder:]):
  9325. (-[WebUndefined encodeWithCoder:]):
  9326. (-[WebUndefined copyWithZone:]):
  9327. * bindings/objc/objc_class.h:
  9328. (KJS::Bindings::ObjcClass::constructorAt):
  9329. * bindings/objc/objc_class.mm:
  9330. (KJS::Bindings::ObjcClass::methodsNamed):
  9331. (KJS::Bindings::ObjcClass::fallbackObject):
  9332. * bindings/objc/objc_instance.mm:
  9333. (ObjcInstance::getValueOfUndefinedField):
  9334. * bindings/objc/objc_runtime.mm:
  9335. (ObjcFallbackObjectImp::getOwnPropertySlot):
  9336. (ObjcFallbackObjectImp::put):
  9337. (ObjcFallbackObjectImp::canPut):
  9338. (ObjcFallbackObjectImp::deleteProperty):
  9339. (ObjcFallbackObjectImp::toBoolean):
  9340. * bindings/runtime.cpp:
  9341. (KJS::Bindings::Instance::createLanguageInstanceForValue):
  9342. * bindings/runtime.h:
  9343. (KJS::Bindings::Instance::getValueOfUndefinedField):
  9344. (KJS::Bindings::Instance::setValueOfUndefinedField):
  9345. * bindings/runtime_array.cpp:
  9346. (RuntimeArray::lengthGetter):
  9347. (RuntimeArray::indexGetter):
  9348. (RuntimeArray::put):
  9349. (RuntimeArray::deleteProperty):
  9350. * bindings/runtime_method.cpp:
  9351. (RuntimeMethod::lengthGetter):
  9352. (RuntimeMethod::execute):
  9353. * bindings/runtime_object.cpp:
  9354. (RuntimeObjectImp::fallbackObjectGetter):
  9355. (RuntimeObjectImp::fieldGetter):
  9356. (RuntimeObjectImp::methodGetter):
  9357. (RuntimeObjectImp::put):
  9358. (RuntimeObjectImp::canPut):
  9359. (RuntimeObjectImp::deleteProperty):
  9360. (RuntimeObjectImp::defaultValue):
  9361. (RuntimeObjectImp::callAsFunction):
  9362. * bindings/runtime_root.cpp:
  9363. (performJavaScriptAccess):
  9364. * kjs/array_object.cpp:
  9365. (ArrayInstance::lengthGetter):
  9366. (ArrayInstance::getOwnPropertySlot):
  9367. (ArrayPrototype::ArrayPrototype):
  9368. (ArrayPrototype::getOwnPropertySlot):
  9369. * kjs/bool_object.cpp:
  9370. (BooleanObjectImp::BooleanObjectImp):
  9371. * kjs/date_object.cpp:
  9372. (KJS::DateObjectFuncImp::DateObjectFuncImp):
  9373. (KJS::DateObjectFuncImp::callAsFunction):
  9374. * kjs/error_object.cpp:
  9375. (ErrorObjectImp::ErrorObjectImp):
  9376. (NativeErrorPrototype::NativeErrorPrototype):
  9377. (NativeErrorImp::NativeErrorImp):
  9378. * kjs/function.cpp:
  9379. (KJS::FunctionImp::argumentsGetter):
  9380. (KJS::FunctionImp::lengthGetter):
  9381. (KJS::Arguments::mappedIndexGetter):
  9382. (KJS::ActivationImp::argumentsGetter):
  9383. (KJS::ActivationImp::put):
  9384. * kjs/function_object.cpp:
  9385. (FunctionObjectImp::FunctionObjectImp):
  9386. * kjs/internal.cpp:
  9387. (KJS::GetterSetterImp::toPrimitive):
  9388. (KJS::GetterSetterImp::toBoolean):
  9389. * kjs/interpreter.cpp:
  9390. (KJS::Interpreter::evaluate):
  9391. * kjs/interpreter.h:
  9392. (KJS::Interpreter::isGlobalObject):
  9393. (KJS::Interpreter::interpreterForGlobalObject):
  9394. (KJS::Interpreter::isSafeScript):
  9395. * kjs/lexer.cpp:
  9396. (Lexer::makeIdentifier):
  9397. (Lexer::makeUString):
  9398. * kjs/lookup.h:
  9399. (KJS::staticFunctionGetter):
  9400. (KJS::staticValueGetter):
  9401. * kjs/nodes.cpp:
  9402. (StatementNode::processFuncDecl):
  9403. (PropertyNode::evaluate):
  9404. (PropertyNameNode::evaluate):
  9405. * kjs/number_object.cpp:
  9406. (NumberObjectImp::NumberObjectImp):
  9407. (NumberObjectImp::getOwnPropertySlot):
  9408. * kjs/object.cpp:
  9409. (KJS::JSObject::defineGetter):
  9410. (KJS::JSObject::defineSetter):
  9411. (KJS::JSObject::hasInstance):
  9412. (KJS::JSObject::propertyIsEnumerable):
  9413. * kjs/object_object.cpp:
  9414. (ObjectObjectImp::ObjectObjectImp):
  9415. * kjs/property_slot.cpp:
  9416. (KJS::PropertySlot::undefinedGetter):
  9417. (KJS::PropertySlot::functionGetter):
  9418. * kjs/reference.cpp:
  9419. (KJS::Reference::getPropertyName):
  9420. * kjs/reference_list.cpp:
  9421. (ReferenceListIterator::operator++):
  9422. * kjs/regexp_object.cpp:
  9423. (RegExpObjectImp::RegExpObjectImp):
  9424. (RegExpObjectImp::getValueProperty):
  9425. (RegExpObjectImp::putValueProperty):
  9426. * kjs/string_object.cpp:
  9427. (StringInstance::lengthGetter):
  9428. (StringInstance::indexGetter):
  9429. (StringPrototype::StringPrototype):
  9430. * kxmlcore/Assertions.mm:
  9431. * kxmlcore/FastMalloc.cpp:
  9432. (KXMLCore::TCMalloc_PageHeap::CheckList):
  9433. * kxmlcore/HashTable.h:
  9434. (KXMLCore::HashTableConstIterator::checkValidity):
  9435. (KXMLCore::IdentityHashTranslator::translate):
  9436. * pcre/pcre_get.c:
  9437. (pcre_get_stringnumber):
  9438. 2006-02-23 Darin Adler <darin@apple.com>
  9439. - try to fix buildbot failure
  9440. * bindings/c/c_utility.cpp: Touch this file, which seems to not have been
  9441. recompiled after additional inlining was introduced (Xcode bug?).
  9442. 2006-02-23 Geoffrey Garen <ggaren@apple.com>
  9443. Reviewed by Darin, Maciej.
  9444. - Inline some functions suggested by Shark. 2.9% speedup on super
  9445. accurate JS iBench.
  9446. http://bugs.webkit.org/show_bug.cgi?id=7411
  9447. <rdar://problem/4448116>
  9448. * kjs/nodes.h:
  9449. (KJS::ArgumentsNode::evaluateList):
  9450. * kjs/object.cpp:
  9451. * kjs/object.h:
  9452. (KJS::ScopeChain::release):
  9453. (KJS::JSObject::toPrimitive):
  9454. * kjs/scope_chain.cpp:
  9455. * kjs/ustring.cpp:
  9456. * kjs/ustring.h:
  9457. (KJS::UString::toArrayIndex):
  9458. * kjs/value.cpp:
  9459. * kjs/value.h:
  9460. (KJS::JSValue::toObject):
  9461. * kxmlcore/FastMalloc.cpp:
  9462. (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
  9463. (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
  9464. 2006-02-21 Eric Seidel <eseidel@apple.com>
  9465. Added *.user to ignore list.
  9466. 2006-02-21 Eric Seidel <eseidel@apple.com>
  9467. Reviewed by ggaren.
  9468. Add grammarWrapper.cpp to work around visual studio bug plaguing buildbot.
  9469. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  9470. * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Added.
  9471. 2006-02-21 Eric Seidel <eseidel@apple.com>
  9472. Reviewed by ggaren.
  9473. * kjs/testkjs.cpp: #if out timeval code on win32
  9474. 2006-02-21 Michael Emmel <mike.emmel@gmail.com>
  9475. Reviewed by Darin.
  9476. - fix http://bugs.webkit.org/show_bug.cgi?id=7397
  9477. TCPageMap.h would not compile for me because string.h was missing
  9478. * kxmlcore/TCPageMap.h: Added <string.h> include.
  9479. 2006-02-21 Darin Adler <darin@apple.com>
  9480. Reviewed by John Sullivan.
  9481. - http://bugs.webkit.org/show_bug.cgi?id=7404
  9482. remove a bunch of extra implementsCall overrides
  9483. * JavaScriptCore.xcodeproj/project.pbxproj: Sorted files.
  9484. * kjs/internal.h: Made InternalFunctionImp::callAsFunction pure virtual so that
  9485. we'll get a compile error if some derived class neglects to implement it.
  9486. * kjs/function.cpp: (KJS::FunctionImp::FunctionImp): Remove unneeded initialization
  9487. of param, which is an OwnPtr so it gets initialized by default.
  9488. * bindings/runtime_method.cpp:
  9489. * bindings/runtime_method.h:
  9490. * kjs/array_object.cpp:
  9491. * kjs/array_object.h:
  9492. * kjs/bool_object.cpp:
  9493. * kjs/bool_object.h:
  9494. * kjs/date_object.cpp:
  9495. * kjs/date_object.h:
  9496. * kjs/error_object.cpp:
  9497. * kjs/error_object.h:
  9498. * kjs/function.cpp:
  9499. * kjs/function.h:
  9500. * kjs/function_object.cpp:
  9501. * kjs/function_object.h:
  9502. * kjs/math_object.cpp:
  9503. * kjs/math_object.h:
  9504. * kjs/number_object.cpp:
  9505. * kjs/number_object.h:
  9506. * kjs/object_object.cpp:
  9507. * kjs/object_object.h:
  9508. * kjs/regexp_object.cpp:
  9509. * kjs/regexp_object.h:
  9510. * kjs/string_object.cpp:
  9511. * kjs/string_object.h:
  9512. Removed many rendundant implementations of implementsCall from subclasses of
  9513. InternalFunctionImp.
  9514. 2006-02-21 Darin Adler <darin@apple.com>
  9515. - fixed build
  9516. * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsCall):
  9517. Oops, fixed name.
  9518. 2006-02-21 Darin Adler <darin@apple.com>
  9519. Change suggested by Mitz.
  9520. - http://bugs.webkit.org/show_bug.cgi?id=7402
  9521. REGRESSION: Methods do not execute
  9522. * kjs/internal.h: Add implementsHasCall to InternalFunctionImp.
  9523. * kjs/internal.cpp: (KJS::InternalFunctionImp::implementsHasCall):
  9524. Return true. All the classes derived from InternalFunctionImp need
  9525. to return true from this -- later we can remove all the extra
  9526. implementations too.
  9527. 2006-02-21 Maciej Stachowiak <mjs@apple.com>
  9528. - fix build breakage caused by last-minute change to my patch
  9529. * kjs/lookup.h:
  9530. 2006-02-20 Maciej Stachowiak <mjs@apple.com>
  9531. Reviewed by Geoff and Darin.
  9532. Patch from Maks Orlovich, based on work by David Faure, hand-applied and
  9533. significantly reworked by me.
  9534. - Patch: give internal function names (KJS merge)
  9535. http://bugs.webkit.org/show_bug.cgi?id=6279
  9536. * tests/mozilla/expected.html: Updated for newly fixed test.
  9537. * kjs/array_object.cpp:
  9538. (ArrayProtoFunc::ArrayProtoFunc):
  9539. * kjs/array_object.h:
  9540. * kjs/bool_object.cpp:
  9541. (BooleanPrototype::BooleanPrototype):
  9542. (BooleanProtoFunc::BooleanProtoFunc):
  9543. * kjs/bool_object.h:
  9544. * kjs/date_object.cpp:
  9545. (KJS::DateProtoFunc::DateProtoFunc):
  9546. (KJS::DateObjectImp::DateObjectImp):
  9547. (KJS::DateObjectFuncImp::DateObjectFuncImp):
  9548. * kjs/error_object.cpp:
  9549. (ErrorPrototype::ErrorPrototype):
  9550. (ErrorProtoFunc::ErrorProtoFunc):
  9551. * kjs/error_object.h:
  9552. * kjs/function.cpp:
  9553. (KJS::FunctionImp::FunctionImp):
  9554. (KJS::GlobalFuncImp::GlobalFuncImp):
  9555. * kjs/function.h:
  9556. * kjs/function_object.cpp:
  9557. (FunctionPrototype::FunctionPrototype):
  9558. (FunctionProtoFunc::FunctionProtoFunc):
  9559. (FunctionProtoFunc::callAsFunction):
  9560. * kjs/function_object.h:
  9561. * kjs/internal.cpp:
  9562. (KJS::InterpreterImp::initGlobalObject):
  9563. (KJS::InternalFunctionImp::InternalFunctionImp):
  9564. * kjs/internal.h:
  9565. (KJS::InternalFunctionImp::functionName):
  9566. * kjs/lookup.h:
  9567. (KJS::staticFunctionGetter):
  9568. (KJS::HashEntryFunction::HashEntryFunction):
  9569. (KJS::HashEntryFunction::implementsCall):
  9570. (KJS::HashEntryFunction::toBoolean):
  9571. (KJS::HashEntryFunction::implementsHasInstance):
  9572. (KJS::HashEntryFunction::hasInstance):
  9573. * kjs/math_object.cpp:
  9574. (MathFuncImp::MathFuncImp):
  9575. * kjs/math_object.h:
  9576. * kjs/number_object.cpp:
  9577. (NumberPrototype::NumberPrototype):
  9578. (NumberProtoFunc::NumberProtoFunc):
  9579. * kjs/number_object.h:
  9580. * kjs/object.cpp:
  9581. (KJS::JSObject::putDirectFunction):
  9582. (KJS::Error::create):
  9583. * kjs/object.h:
  9584. * kjs/object_object.cpp:
  9585. (ObjectPrototype::ObjectPrototype):
  9586. (ObjectProtoFunc::ObjectProtoFunc):
  9587. * kjs/object_object.h:
  9588. * kjs/regexp_object.cpp:
  9589. (RegExpPrototype::RegExpPrototype):
  9590. (RegExpProtoFunc::RegExpProtoFunc):
  9591. * kjs/regexp_object.h:
  9592. * kjs/string_object.cpp:
  9593. (StringProtoFunc::StringProtoFunc):
  9594. (StringObjectImp::StringObjectImp):
  9595. (StringObjectFuncImp::StringObjectFuncImp):
  9596. * kjs/string_object.h:
  9597. 2006-02-20 Geoffrey Garen <ggaren@apple.com>
  9598. Reviewed by Darin, with help from Eric, Maciej.
  9599. - More changes to support super-accurate JS iBench. Doesn't work on
  9600. Windows. (Doesn't break Windows, either.) I've filed
  9601. [http://bugs.webkit.org/show_bug.cgi?id=7399] about that.
  9602. * kjs/interpreter.cpp:
  9603. (KJS::Interpreter::evaluate): Print line numbers with exception output
  9604. * kjs/testkjs.cpp: Changed " *" to "* " because Eric says that's the
  9605. way we roll with .cpp files.
  9606. (StopWatch::StopWatch): New class. Provides microsecond-accurate
  9607. timings.
  9608. (StopWatch::~StopWatch):
  9609. (StopWatch::start):
  9610. (StopWatch::stop):
  9611. (StopWatch::getElapsedMS):
  9612. (TestFunctionImp::callAsFunction): Added missing return statement.
  9613. Fixed up "run" to use refactored helper functions. Removed bogus
  9614. return statement from "quit" case. Made "print" output to stdout
  9615. instead of stderr because that makes more sense, and PERL handles
  9616. stdout better.
  9617. (main): Factored out KXMLCore unit tests. Removed custom exception
  9618. printing code because the interpreter prints exceptions for you. Added
  9619. a "delete" call for the GlobalImp we allocate.
  9620. (testIsInteger): New function, result of refacotring.
  9621. (createStringWithContentsOfFile): New function, result of refactoring.
  9622. Renamed "code" to "buffer" to match factored-out-ness.
  9623. 2006-02-20 Eric Seidel <eseidel@apple.com>
  9624. Reviewed by hyatt.
  9625. Fix "Copy ICU DLLs..." phase.
  9626. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  9627. * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
  9628. 2006-02-19 Darin Adler <darin@apple.com>
  9629. - renamed ERROR to LOG_ERROR to fix build
  9630. presumably Maciej had this change and forgot to land it
  9631. * kjs/collector.cpp: Removed now-unneeded #undef ERROR.
  9632. * kxmlcore/Assertions.h: Renamed ERROR to LOG_ERROR.
  9633. * kxmlcore/FastMalloc.cpp: Changed MESSAGE macro to use LOG_ERROR.
  9634. 2006-02-18 Mitz Pettel <opendarwin.org@mitzpettel.com>
  9635. Test: fast/js/toString-exception.html
  9636. Reviewed by Maciej.
  9637. - fix http://bugs.webkit.org/show_bug.cgi?id=7343
  9638. REGRESSION: fast/js/toString-overrides.html fails when run multiple times
  9639. * kjs/array_object.cpp:
  9640. (ArrayProtoFunc::callAsFunction): Remove the object from the visited elements set before
  9641. returning an error.
  9642. 2006-02-18 Darin Adler <darin@apple.com>
  9643. Reviewed by Maciej.
  9644. - http://bugs.webkit.org/show_bug.cgi?id=7345
  9645. add insert and remove to KXMLCore::Vector
  9646. * kxmlcore/Vector.h: Added "moveOverlapping", which is used in both
  9647. insert and remove to slide elements within the vector. Also added
  9648. "insert" and "remove" functions.
  9649. 2006-02-16 Geoffrey Garen <ggaren@apple.com>
  9650. Reviewed by John.
  9651. - Fixed <rdar://problem/4448534> TOT REGRESSION: crash in KJS::
  9652. Bindings::Instance::deref when leaving page @ gigaom.com
  9653. * bindings/c/c_instance.cpp:
  9654. (KJS::Bindings::CInstance::~CInstance): Since we cache the class object
  9655. globally, we shouldn't delete it, so don't.
  9656. 2006-02-16 Timothy Hatcher <timothy@apple.com>
  9657. Added -Wno-deprecated-declarations to all the ObjC binding files to prevent deprecation
  9658. warnings. Using <rdar://problem/4448350> to track this.
  9659. * JavaScriptCore.xcodeproj/project.pbxproj:
  9660. * bindings/objc/objc_jsobject.h: Removed empty file.
  9661. * bindings/objc/objc_jsobject.mm: Removed empty file.
  9662. 2006-02-16 Tim Omernick <timo@apple.com>
  9663. Reviewed by Geoff.
  9664. <rdar://problem/4428609> Flash Player 8.0.22 can crash Safari (and WebKit apps) with
  9665. javascript disabled (7015)
  9666. * bindings/NP_jsobject.cpp:
  9667. (_NPN_CreateNoScriptObject):
  9668. Returns an NPObject which is not bound to a JavaScript object. This kind of NPObject
  9669. can be given to a plugin as the "window script object" when JavaScript is disabled.
  9670. The object has a custom NPClass, NPNoScriptObjectClass, which has no defined methods.
  9671. Because of this, none of the NPN_* functions called by the plugin on this "no script
  9672. object" will cause entry into JavaScript code.
  9673. (_NPN_InvokeDefault):
  9674. Make sure the NPVariant is filled before returning from this function. This never
  9675. mattered before because we never reached this case, having only created NPObjects of
  9676. the class NPScriptObjectClass.
  9677. (_NPN_Invoke):
  9678. ditto
  9679. (_NPN_Evaluate):
  9680. ditto
  9681. (_NPN_GetProperty):
  9682. ditto
  9683. * bindings/NP_jsobject.h:
  9684. Declared _NPN_CreateNoScriptObject().
  9685. 2006-02-16 Darin Adler <darin@apple.com>
  9686. Reviewed by me, change by Peter Kuemmel.
  9687. * kjs/operations.cpp: (KJS::isNegInf): Fix Windows code, which was
  9688. checking for positive infinity (rolling in fix from KDE side).
  9689. 2006-02-15 Geoffrey Garen <ggaren@apple.com>
  9690. Reviewed by Maciej, Eric.
  9691. - JavaScriptCore half of fix for <rdar://problem/4176077> CrashTracer: 6569
  9692. crashes in DashboardClient at com.apple.JavaScriptCore:
  9693. KJS::Bindings::ObjcFallbackObjectImp::type()
  9694. WebCore and JavaScriptCore weren't sharing Instance objects very
  9695. nicely. I made them use RefPtrs, and sent them to bed without dessert.
  9696. * bindings/jni/jni_instance.cpp: Made _instance a RefPtr
  9697. (JavaInstance::~JavaInstance):
  9698. (JObjectWrapper::JObjectWrapper):
  9699. * bindings/jni/jni_instance.h:
  9700. (KJS::Bindings::JObjectWrapper::ref):
  9701. (KJS::Bindings::JObjectWrapper::deref):
  9702. * bindings/jni/jni_runtime.cpp: Made _array a RefPtr
  9703. (JavaArray::~JavaArray):
  9704. (JavaArray::JavaArray):
  9705. * bindings/jni/jni_runtime.h:
  9706. (KJS::Bindings::JavaArray::operator=):
  9707. * bindings/objc/objc_runtime.h:
  9708. - Prohibited copying because that would muss the ref count.
  9709. - Prohibited construction without instance because an instance wrapper
  9710. without an instance is almost certainly a bug.
  9711. * bindings/objc/objc_runtime.mm:
  9712. (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
  9713. * bindings/runtime.cpp:
  9714. (KJS::Bindings::Instance::Instance):
  9715. (KJS::Bindings::Instance::createBindingForLanguageInstance):
  9716. (KJS::Bindings::Instance::createRuntimeObject):
  9717. * bindings/runtime.h:
  9718. (KJS::Bindings::Instance::ref):
  9719. (KJS::Bindings::Instance::deref):
  9720. * bindings/runtime_object.cpp:
  9721. (RuntimeObjectImp::RuntimeObjectImp):
  9722. (RuntimeObjectImp::fallbackObjectGetter):
  9723. (RuntimeObjectImp::fieldGetter):
  9724. (RuntimeObjectImp::methodGetter):
  9725. (RuntimeObjectImp::getOwnPropertySlot):
  9726. (RuntimeObjectImp::put):
  9727. (RuntimeObjectImp::canPut):
  9728. * bindings/runtime_object.h:
  9729. - Removed ownsInstance data member because RefPtr takes care of
  9730. instance lifetime now.
  9731. - Prohibited copying because that would muss the ref count.
  9732. - Prohibited construction without instance because an instance wrapper
  9733. without an instance is almost certainly a bug.
  9734. (KJS::RuntimeObjectImp::getInternalInstance):
  9735. 2006-02-15 Geoffrey Garen <ggaren@apple.com>
  9736. Reviewed by John.
  9737. - Applied the 4330457 change to CClass and ObjcClass as well.
  9738. Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
  9739. will catch this.
  9740. This change isn't as critical because CClass and ObjcClass objects get
  9741. cached globally and never deleted, but it's good practice, in case we
  9742. ever do decide to delete CClass and ObjcClass objects.
  9743. This change requires prohibiting copying, because we don't do any
  9744. intelligent ref-counting -- when a Class is destroyed, it destroys its
  9745. methods and fields unconditionally. (Java classes already prohibited
  9746. copying.)
  9747. * bindings/c/c_class.cpp:
  9748. - Merged _commonInit and _commonDelete into constructor and destructor.
  9749. (CClass::CClass):
  9750. (CClass::~CClass):
  9751. (CClass::methodsNamed): Added delete callbacks
  9752. (CClass::fieldNamed): Added delete callbacks
  9753. * bindings/c/c_class.h: Prohibited copying
  9754. * bindings/c/c_instance.cpp:
  9755. (KJS::Bindings::CInstance::getClass): Changed to use the preferred
  9756. class factory method, to take advantage of the global cache.
  9757. [ Repeated changes applied to CClass for ObjcClass: ]
  9758. * bindings/objc/objc_class.h:
  9759. * bindings/objc/objc_class.mm:
  9760. (KJS::Bindings::ObjcClass::ObjcClass):
  9761. (KJS::Bindings::ObjcClass::~ObjcClass):
  9762. (KJS::Bindings::ObjcClass::methodsNamed):
  9763. (KJS::Bindings::ObjcClass::fieldNamed):
  9764. * bindings/objc/objc_runtime.h:
  9765. (KJS::Bindings::ObjcMethod::ObjcMethod): Initialized uninitialized
  9766. variable to prevent bad CFRelease.
  9767. (KJS::Bindings::ObjcMethod::~ObjcMethod): Removed erroneous ';' from
  9768. if statement to prevent bad CFRelease.
  9769. * bindings/objc/objc_runtime.cpp: Changed to use the preferred
  9770. ObjectStructPtr, for clarity.
  9771. 2006-02-14 Geoffrey Garen <ggaren@apple.com>
  9772. Reviewed by John.
  9773. - Fixed <rdar://problem/4330457> CrashTracer: [REGRESSION] 3763 crashes
  9774. in Safari at com.apple.JavaScriptCore: KJS::Bindings::JavaInstance::
  9775. getClass const + 56
  9776. Once plugins work in DumpRenderTree, running run-webkit-tests --leaks
  9777. will catch this.
  9778. This was a memory leak in the bindings code. The leak was so extreme
  9779. that it would cause Safari or the JVM to abort from lack of memory.
  9780. Upon construction, Class objects create field and method objects,
  9781. storing them in CFDictionaries. The bug was that upon destruction, the
  9782. class objects released the dictionaries but didn't destroy the stored
  9783. objects.
  9784. The fix is to supply CFDictionary callbacks for destroying the values
  9785. added to the dictionary.
  9786. * bindings/jni/jni_class.cpp:
  9787. (JavaClass::JavaClass): Added delete callbacks
  9788. * bindings/runtime.cpp: Added definitions for delete callbacks
  9789. (KJS::Bindings::deleteMethodList):
  9790. (KJS::Bindings::deleteMethod):
  9791. (KJS::Bindings::deleteField):
  9792. * bindings/runtime.h: Added declarations for delete callbacks
  9793. 2006-02-14 Timothy Hatcher <timothy@apple.com>
  9794. Reviewed by Justin.
  9795. Fixed <rdar://problem/4415050> STD: WebCore build steps use echo -n, which will change
  9796. behavior due to POSIX version of sh
  9797. * JavaScriptCore.xcodeproj/project.pbxproj: removed the use of echo -n, replaced with printf ""
  9798. 2006-02-13 Dave Hyatt <hyatt@apple.com>
  9799. Fix Win32 bustage in JavaScriptCore.
  9800. Reviewed by darin
  9801. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  9802. Add JSImmediate to the Win32 project.
  9803. * kjs/JSImmediate.h:
  9804. (KJS::JSImmediate::fromDouble):
  9805. (KJS::JSImmediate::toDouble):
  9806. (KJS::JSImmediate::NanAsBits):
  9807. (KJS::JSImmediate::oneAsBits):
  9808. Win32 needs explicit returns after abort() for non-void functions.
  9809. * kjs/testkjs.cpp:
  9810. (run):
  9811. Win32 catches a bug in testkjs! The "return 2" should actually
  9812. have been a return false.
  9813. * kjs/value.h:
  9814. The extern decls of NaN and Inf need to be const.
  9815. === JavaScriptCore-521.7 ===
  9816. 2006-02-13 Timothy Hatcher <timothy@apple.com>
  9817. Reviewed by Darin.
  9818. Replaced the old NS_DURING exception blocking with @try/@catch.
  9819. * JavaScriptCorePrefix.h: undef try and catch to workaround a C++ conflict
  9820. * bindings/objc/objc_instance.mm:
  9821. (ObjcInstance::invokeMethod):
  9822. (ObjcInstance::invokeDefaultMethod):
  9823. (ObjcInstance::setValueOfUndefinedField):
  9824. (ObjcInstance::getValueOfUndefinedField):
  9825. * bindings/objc/objc_runtime.mm:
  9826. (ObjcField::valueFromInstance):
  9827. (ObjcField::setValueToInstance):
  9828. (ObjcArray::setValueAt):
  9829. (ObjcArray::valueAt):
  9830. 2006-02-13 Darin Adler <darin@apple.com>
  9831. - fix a couple problems building on Windows, based on requests
  9832. from Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  9833. * kjs/JSImmediate.h: Change code using non-standard u_int32/64_t types
  9834. to the standard uint32/64_t. Also removed curious "isIEEE()" function
  9835. that checked the sizes of some types (and type sizes alone don't tell you if
  9836. the floating point conforms to the IEEE-standard). Added missing include
  9837. of <stdint.h>.
  9838. * kjs/property_slot.h: Added missing include of <assert.h>.
  9839. 2006-02-12 Geoffrey Garen <ggaren@apple.com>
  9840. Reviewed by darin.
  9841. Cleaned up testkjs, added new "run" functionality to allow scripting
  9842. tests from within JS. ("run" is a part of my new super-accurate
  9843. JS iBench.)
  9844. No regressions in run-javascriptcore-tests.
  9845. * kjs/testkjs.cpp:
  9846. (GlobalImp::className):
  9847. (TestFunctionImp::):
  9848. (TestFunctionImp::callAsFunction):
  9849. (main):
  9850. (run):
  9851. 2006-02-11 Alexey Proskuryakov <ap@nypop.com>
  9852. Reviewed by Darin.
  9853. - improve fix for http://bugs.webkit.org/show_bug.cgi?id=5163
  9854. RealPlayer.GetTitle() Crashes Safari/Dashboard
  9855. * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
  9856. Use kCFStringEncodingISOLatin1 rather than kCFStringEncodingWindowsLatin1,
  9857. because the latter encoding has holes, and conversion can still fail.
  9858. 2006-02-10 Geoffrey Garen <ggaren@apple.com>
  9859. Reviewed by Darin.
  9860. - Inlined RefPtr assignment operators. .7% performance win on
  9861. super-accurate JS iBench.
  9862. * kxmlcore/RefPtr.h:
  9863. (KXMLCore::::operator):
  9864. 2006-02-10 Geoffrey Garen <ggaren@apple.com>
  9865. No review needed, just a build fix. This time for sure.
  9866. * kjs/JSType.h:
  9867. 2006-02-10 Geoffrey Garen <ggaren@apple.com>
  9868. Reviewed by eric.
  9869. - Fixed build. As it goes without saying, I will not mention that I
  9870. blame Kevin.
  9871. * JavaScriptCore.xcodeproj/project.pbxproj:
  9872. * kjs/JSImmediate.cpp:
  9873. (KJS::JSImmediate::toObject):
  9874. 2006-02-09 Geoffrey Garen <ggaren@apple.com>
  9875. Reviewed by mjs.
  9876. - Fixed <rdar://problem/4343730> Should switch ConstantValues (null,
  9877. undefined, true, false) from JS objects to immediate values similar to
  9878. SimpleNumber
  9879. 2.0% performance gain on my new super-accurate version of JS iBench.
  9880. (I promise to land a version of it soon.)
  9881. The gist of the change:
  9882. (1) The SimpleNumber class (simple_number.h) is now the JSImmediate
  9883. class (JSImmediate.h/.cpp), and it handles not only numbers but also
  9884. null, undefined, true, and false.
  9885. (2) JSImmediate provides convenience methods for the bit masking
  9886. necessary to encode and decode immediate values.
  9887. (3) ConstantValues, BooleanImp, NullImp, and UndefinedImp are gone.
  9888. (4) JSCell no longer implements functions like getBoolean, because
  9889. only a JSImmediate can be a boolean.
  9890. (5) JSImmediate no longer uses ALWAYS_INLINE because there's no need,
  9891. and ALWAYS_INLINE is a non-portable option of last resort.
  9892. (6) Type is now JSType, and it resides in its own file, JSType.h.
  9893. Since I was there, I did some header include sorting as part of this
  9894. change.
  9895. The rest pretty much explains itself.
  9896. * JavaScriptCore.xcodeproj/project.pbxproj: Removed simple_number.h,
  9897. added JSImmediate.h/.cpp.
  9898. * bindings/c/c_instance.cpp:
  9899. (KJS::Bindings::CInstance::defaultValue):
  9900. * bindings/c/c_instance.h:
  9901. * bindings/c/c_utility.cpp:
  9902. (KJS::Bindings::convertValueToNPVariant):
  9903. * bindings/jni/jni_instance.cpp:
  9904. (JavaInstance::defaultValue):
  9905. * bindings/jni/jni_instance.h:
  9906. * bindings/jni/jni_jsobject.cpp:
  9907. (JavaJSObject::convertValueToJObject):
  9908. * bindings/objc/WebScriptObject.mm:
  9909. (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
  9910. Standardized calls to use getXXX instead of hand-rolling JSValue
  9911. functionality.
  9912. * bindings/objc/objc_instance.h:
  9913. * bindings/objc/objc_instance.mm:
  9914. (ObjcInstance::getValueOfUndefinedField):
  9915. (ObjcInstance::defaultValue):
  9916. * bindings/objc/objc_runtime.h:
  9917. * bindings/objc/objc_runtime.mm:
  9918. (ObjcFallbackObjectImp::type):
  9919. (ObjcFallbackObjectImp::defaultValue):
  9920. * bindings/runtime.h:
  9921. (KJS::Bindings::Instance::getValueOfUndefinedField):
  9922. * bindings/runtime_object.cpp:
  9923. (RuntimeObjectImp::defaultValue):
  9924. * bindings/runtime_object.h:
  9925. * kjs/JSImmediate.h: Added.
  9926. (KJS::JSImmediate::isImmediate):
  9927. (KJS::JSImmediate::isNumber):
  9928. (KJS::JSImmediate::isBoolean):
  9929. (KJS::JSImmediate::isUndefinedOrNull):
  9930. (KJS::JSImmediate::fromDouble):
  9931. (KJS::JSImmediate::toDouble):
  9932. (KJS::JSImmediate::toBoolean):
  9933. (KJS::JSImmediate::trueImmediate):
  9934. (KJS::JSImmediate::falseImmediate):
  9935. (KJS::JSImmediate::NaNImmediate):
  9936. (KJS::JSImmediate::undefinedImmediate):
  9937. (KJS::JSImmediate::nullImmediate):
  9938. (KJS::JSImmediate::tag):
  9939. (KJS::JSImmediate::unTag):
  9940. (KJS::JSImmediate::getTag):
  9941. (KJS::JSImmediate::):
  9942. (KJS::JSImmediate::isIEEE):
  9943. (KJS::JSImmediate::is32bit):
  9944. (KJS::JSImmediate::is64bit):
  9945. (KJS::JSImmediate::NanAsBits):
  9946. (KJS::JSImmediate::zeroAsBits):
  9947. (KJS::JSImmediate::oneAsBits):
  9948. * kjs/JSLock.cpp:
  9949. (KJS::JSLock::lock): Removed hack-o-rama to initialize ConstantValues.
  9950. * kjs/JSType.h: Added.
  9951. * kjs/collector.cpp:
  9952. (KJS::Collector::protect):
  9953. (KJS::Collector::unprotect):
  9954. (KJS::Collector::collect):
  9955. * kjs/internal.cpp:
  9956. (KJS::StringImp::toPrimitive):
  9957. (KJS::NumberImp::toPrimitive):
  9958. (KJS::NumberImp::toBoolean):
  9959. (KJS::GetterSetterImp::toPrimitive):
  9960. * kjs/internal.h:
  9961. (KJS::StringImp::type):
  9962. (KJS::NumberImp::type):
  9963. * kjs/object.cpp:
  9964. (KJS::JSObject::type):
  9965. (KJS::tryGetAndCallProperty): Replaced "Are you one of the six things
  9966. I'm looking for?" test with "Are you not the one thing I'm not looking
  9967. for" test.
  9968. (KJS::JSObject::defaultValue):
  9969. (KJS::JSObject::toPrimitive):
  9970. * kjs/object.h:
  9971. (KJS::GetterSetterImp::type):
  9972. (KJS::JSValue::isObject):
  9973. * kjs/operations.cpp:
  9974. (KJS::equal):
  9975. (KJS::strictEqual):
  9976. (KJS::add):
  9977. * kjs/reference.cpp:
  9978. (KJS::Reference::deleteValue):
  9979. * kjs/simple_number.h: Removed.
  9980. * kjs/string_object.cpp:
  9981. (StringInstance::getOwnPropertySlot): fixed indentation
  9982. * kjs/value.cpp:
  9983. (KJS::JSValue::toObject):
  9984. (KJS::jsNumberCell): New function to quarantine a PIC branch -- allows
  9985. us to inline jsNumber without adding PIC branches to callers.
  9986. * kjs/value.h:
  9987. (KJS::jsUndefined):
  9988. (KJS::jsNull):
  9989. (KJS::jsNaN):
  9990. (KJS::jsBoolean):
  9991. (KJS::jsNumber):
  9992. (KJS::JSValue::downcast):
  9993. (KJS::JSValue::isUndefinedOrNull):
  9994. (KJS::JSValue::isBoolean):
  9995. (KJS::JSValue::isNumber):
  9996. (KJS::JSValue::isString):
  9997. (KJS::JSValue::isObject):
  9998. (KJS::JSValue::getBoolean):
  9999. (KJS::JSValue::getNumber):
  10000. (KJS::JSValue::getString):
  10001. (KJS::JSValue::getObject):
  10002. (KJS::JSValue::getUInt32):
  10003. (KJS::JSValue::mark): Replaced !JSImmediate::is() test with assertion,
  10004. resulting in a slight performance gain. Callers should always check
  10005. !marked() before calling mark(), so it's impossible to call mark on
  10006. a JSImmediate.
  10007. (KJS::JSValue::marked):
  10008. (KJS::JSValue::type):
  10009. (KJS::JSValue::toPrimitive):
  10010. (KJS::JSValue::toBoolean):
  10011. (KJS::JSValue::toNumber):
  10012. (KJS::JSValue::toString):
  10013. 2006-02-06 Eric Seidel <eseidel@apple.com>
  10014. Add svn:ignore properties for visual studio internals.
  10015. 2006-02-06 Alexey Proskuryakov <ap@nypop.com>
  10016. Reviewed by Darin.
  10017. - Refactor DateInstance to provide direct access to data. Several WIN32 modifications.
  10018. http://bugs.webkit.org/show_bug.cgi?id=7107
  10019. - No tests added - only changed functionality on WIN32, which should be covered by
  10020. existing tests.
  10021. * kjs/date_object.cpp:
  10022. (gmtoffset): On WIN32, use the recommended global (_timezone rather than timezone).
  10023. Updated comments.
  10024. (KJS::timeZoneOffset): Removed, was basically the same as the above.
  10025. (KJS::formatTime): Pass an UTC flag - UTC/local cannot be correctly selected on
  10026. Windows based on struct tm itself.
  10027. (KJS::DateInstance::getTime): Added.
  10028. (KJS::DateInstance::getUTCTime): Added.
  10029. (KJS::millisecondsToTM): Factored out from DateProtoFunc::callAsFunction().
  10030. (KJS::DateObjectImp::callAsFunction): Use the new parameter to formatTime().
  10031. (KJS::DateProtoFunc::callAsFunction): Updated for the other changes. The code for
  10032. GetTimezoneOffset was incorrect on WIN32 - _daylight global has nothing to do
  10033. with daylight savings time being in effect.
  10034. * kjs/date_object.h: Added prototypes for new functions.
  10035. 2006-02-05 Maciej Stachowiak <mjs@apple.com>
  10036. Reviewed by Anders.
  10037. - fixed ~1100 KJS::Node leaked on layout tests
  10038. http://bugs.webkit.org/show_bug.cgi?id=7097
  10039. * kjs/internal.cpp:
  10040. (KJS::Parser::noteNodeCycle):
  10041. (KJS::Parser::removeNodeCycle):
  10042. (KJS::clearNewNodes):
  10043. * kjs/internal.h:
  10044. * kjs/nodes.cpp:
  10045. (ElementNode::breakCycle):
  10046. (PropertyListNode::breakCycle):
  10047. (ArgumentListNode::breakCycle):
  10048. (StatListNode::StatListNode):
  10049. (StatListNode::breakCycle):
  10050. (VarDeclListNode::breakCycle):
  10051. (BlockNode::BlockNode):
  10052. (ClauseListNode::breakCycle):
  10053. (CaseBlockNode::CaseBlockNode):
  10054. (ParameterNode::breakCycle):
  10055. (SourceElementsNode::SourceElementsNode):
  10056. (SourceElementsNode::breakCycle):
  10057. * kjs/nodes.h:
  10058. (KJS::Node::breakCycle):
  10059. (KJS::ElementNode::ElementNode):
  10060. (KJS::ArrayNode::ArrayNode):
  10061. (KJS::PropertyListNode::PropertyListNode):
  10062. (KJS::ObjectLiteralNode::ObjectLiteralNode):
  10063. (KJS::ArgumentListNode::ArgumentListNode):
  10064. (KJS::ArgumentsNode::ArgumentsNode):
  10065. (KJS::VarDeclListNode::VarDeclListNode):
  10066. (KJS::VarStatementNode::VarStatementNode):
  10067. (KJS::ForNode::ForNode):
  10068. (KJS::CaseClauseNode::CaseClauseNode):
  10069. (KJS::ClauseListNode::ClauseListNode):
  10070. (KJS::ParameterNode::ParameterNode):
  10071. (KJS::FuncExprNode::FuncExprNode):
  10072. (KJS::FuncDeclNode::FuncDeclNode):
  10073. 2006-02-05 Maciej Stachowiak <mjs@apple.com>
  10074. Reviewed by Hyatt.
  10075. - fix default traits for classes to make sure default constructors get called
  10076. * kxmlcore/VectorTraits.h:
  10077. (KXMLCore::):
  10078. 2006-02-04 Darin Adler <darin@apple.com>
  10079. Reviewed by Maciej.
  10080. - fix http://bugs.webkit.org/show_bug.cgi?id=5210
  10081. REGRESSION: for/in loop with var changes global variable instead of making local
  10082. Test: fast/js/for-in-var-scope.html
  10083. * kjs/nodes.cpp:
  10084. (valueForReadModifyAssignment): Use ALWAYS_INLINE macro.
  10085. (ForInNode::execute): Break out of the scope chain loop once we find and set the
  10086. loop variable. We don't want to set multiple loop variables.
  10087. (ForInNode::processVarDecls): Process the declaration of the loop variable.
  10088. - other cleanup
  10089. * kjs/object.cpp: (KJS::tryGetAndCallProperty): Use ALWAYS_INLINE macro.
  10090. * kxmlcore/FastMalloc.cpp: Change to use ALWAYS_INLINE macro from AlwaysInline.h
  10091. instead of defining it here a second time.
  10092. 2006-02-04 Maciej Stachowiak <mjs@apple.com>
  10093. Reviewed by Hyatt.
  10094. - change JavaScript collector statistics calls to use HashCountedSet instead
  10095. of CFSet; other misc cleanup
  10096. http://bugs.webkit.org/show_bug.cgi?id=7072
  10097. * kjs/collector.cpp:
  10098. (KJS::Collector::numProtectedObjects): renamed from numReferencedObjects
  10099. (KJS::typeName):
  10100. (KJS::Collector::rootObjectTypeCounts): renamed from rootObjectClasses,
  10101. use HashSet
  10102. * kjs/collector.h:
  10103. (KJS::Collector::isOutOfMemory): Renamed from outOfMemory.
  10104. * kjs/nodes.cpp:
  10105. 2006-02-03 Timothy Hatcher <timothy@apple.com>
  10106. Reviewed by Justin.
  10107. Renamed configuration names to Debug, Release and Production.
  10108. * JavaScriptCore.xcodeproj/project.pbxproj:
  10109. 2006-02-02 George Staikos <staikos@opensource.apple.com>
  10110. Reviewed by Maciej.
  10111. * kjs/lookup.h: Fix compile, merged from KDE.
  10112. 2006-02-02 Darin Adler <darin@apple.com>
  10113. Reviewed by Maciej.
  10114. - http://bugs.webkit.org/show_bug.cgi?id=7005
  10115. add Noncopyable, OwnPtr, OwnArrayPtr to KXMLCore
  10116. * kxmlcore/Noncopyable.h: Added.
  10117. * kxmlcore/OwnArrayPtr.h: Added.
  10118. * kxmlcore/OwnPtr.h: Added.
  10119. * JavaScriptCore.xcodeproj/project.pbxproj: Added new files.
  10120. * kjs/function.h:
  10121. * kjs/function.cpp: Use OwnPtr for Parameter pointers.
  10122. * kjs/internal.h: Use Noncopyable for LabelStack.
  10123. * kjs/list.cpp: Use OwnArrayPtr for overflow.
  10124. * kjs/property_map.h:
  10125. * kjs/property_map.cpp: Use OwnArrayPtr for SavedProperties.
  10126. Use Vector for some stack buffers.
  10127. * kjs/regexp_object.h:
  10128. * kjs/regexp_object.cpp: Use OwnArrayPtr for lastOvector.
  10129. 2006-01-31 Maciej Stachowiak <mjs@apple.com>
  10130. Reviewed by Darin.
  10131. - fixed leak of hundreds of thousands of JS parser nodes on the layout tests, and added an exit counter
  10132. that would catch them
  10133. * kjs/nodes.cpp:
  10134. (NodeCounter::~NodeCounter): Added debug-only node counter.
  10135. (Node::Node):
  10136. (Node::~Node):
  10137. * kxmlcore/VectorTraits.h: Simple classes like RefPtr do in fact need destruction.
  10138. 2006-01-31 Darin Adler <darin@apple.com>
  10139. Reviewed by Maciej.
  10140. - added deleteAllValues for HashSet as well as HashMap
  10141. - fixed conversion from const_iterator to iterator, which I broke a while back
  10142. * kxmlcore/HashMap.h: Updated copyright date.
  10143. * kxmlcore/HashSet.h: (KXMLCore::deleteAllValues): Added.
  10144. * kxmlcore/HashTable.h: (KXMLCore::HashTableIterator::operator const_iterator): Added.
  10145. 2006-01-31 Tim Omernick <timo@apple.com>
  10146. Reviewed by Geoff Garen.
  10147. * bindings/c/c_utility.cpp:
  10148. (KJS::Bindings::convertUTF8ToUTF16):
  10149. Fixed an invalid assertion that UTF8Chars is not NULL. It is valid for it to be NULL as long as
  10150. UTF8Length is 0.
  10151. This fixes an assertion failure on TOT at <http://www.musicindiaonline.com/p/x/tJO0OOBME9.As1NMvHdW/>,
  10152. where JavaScript is getting a NULL string back from some call on the Real Player plugin.
  10153. 2006-01-30 Anders Carlsson <andersca@mac.com>
  10154. Reviewed by Darin.
  10155. Fix http://bugs.webkit.org/show_bug.cgi?id=6907
  10156. REGRESSION: United.com menus messed up due to document.all/MSIE sniff
  10157. * kjs/nodes.cpp:
  10158. (typeStringForValue):
  10159. Return "undefined" if the given object should masquerade as undefined.
  10160. * kjs/object.h:
  10161. (KJS::JSObject::masqueradeAsUndefined):
  10162. Rename from isEqualToNull.
  10163. * kjs/operations.cpp:
  10164. (KJS::equal):
  10165. Update for name change.
  10166. 2006-01-29 Maciej Stachowiak <mjs@apple.com>
  10167. Reviewed by Darin.
  10168. - properly define Vector assignment operator; the private version was accidentally left
  10169. in, and the template version is not enough to replace the default
  10170. * kxmlcore/Vector.h:
  10171. (KXMLCore::Vector::operator=):
  10172. 2006-01-29 Eric Seidel <eseidel@apple.com>
  10173. Reviewed by darin.
  10174. Fix the build by applying a GCC-specific namespace hack.
  10175. * kjs/lookup.h:
  10176. 2006-01-29 Eric Seidel <eseidel@apple.com>
  10177. Reviewed by hyatt.
  10178. Fix build on Win32.
  10179. * kjs/lookup.h: fixed ::cacheGlobalObject
  10180. * kxmlcore/Vector.h:
  10181. (KXMLCore::Vector::operator[]): use unsigned long
  10182. 2006-01-29 Maciej Stachowiak <mjs@apple.com>
  10183. Reviewed by Dave Hyatt.
  10184. * kxmlcore/Vector.h:
  10185. (KXMLCore::Vector::operator[]): Add unsigned overload
  10186. 2006-01-28 Darin Adler <darin@apple.com>
  10187. Reviewed by John Sullivan.
  10188. - http://bugs.webkit.org/show_bug.cgi?id=6895
  10189. include exception names in JavaScript form of DOM exception
  10190. * khtml/ecma/kjs_binding.cpp: (KJS::setDOMException): Include the name of the
  10191. exception in the error message.
  10192. 2006-01-28 Maciej Stachowiak <mjs@apple.com>
  10193. Reviewed by Darin.
  10194. - miscellaneous Vector improvements
  10195. * kxmlcore/Vector.h:
  10196. (KXMLCore::Vector::at): Add range-checking asserts.
  10197. (KXMLCore::Vector::first): Added as a convenience.
  10198. (KXMLCore::Vector::last): Convenience for stack-style use.
  10199. (KXMLCore::Vector::removeLast): ditto
  10200. 2006-01-28 Darin Adler <darin@apple.com>
  10201. Reviewed by John Sullivan
  10202. - fix http://bugs.webkit.org/show_bug.cgi?id=6870
  10203. REGRESSION: JavaScript Date constructor won't accept another Date object
  10204. Test: fast/js/date-constructor.html
  10205. * kjs/date_object.cpp: (KJS::DateObjectImp::construct):
  10206. Added a special case for constructing one date from another (to avoid losing
  10207. milliseconds, which are not in the text form, to match Firefox), and changed
  10208. the base code to convert to primitive before checking for string to match
  10209. the standard. Also corrected a couple silly things in the "construct from
  10210. current time" code path (removed a floor that does no good, and changed
  10211. the constant used to convert microseconds to milliseconds to be a 1000
  10212. rather than "msPerSecond").
  10213. 2006-01-28 Darin Adler <darin@apple.com>
  10214. * kjs/create_hash_table: Added missing license.
  10215. 2006-01-28 Maciej Stachowiak <mjs@apple.com>
  10216. Reviewed by Dave Hyatt.
  10217. - added a Vector class
  10218. http://bugs.webkit.org/show_bug.cgi?id=6894
  10219. * JavaScriptCore.xcodeproj/project.pbxproj:
  10220. * kjs/internal.cpp:
  10221. (KJS::Parser::saveNewNode): Apply Vector.
  10222. (KJS::clearNewNodes): ditto
  10223. * kjs/number_object.cpp:
  10224. (integer_part_noexp): ditto
  10225. (char_sequence): ditto
  10226. * kjs/ustring.cpp:
  10227. (KJS::UString::UTF8String): ditto
  10228. * kxmlcore/HashMap.h:
  10229. (KXMLCore::deleteAllValues): Tweaked this to only apply to HashMap,
  10230. other versions are useful for other containers.
  10231. * kxmlcore/Vector.h: Added. Implemented a Vector class, which should
  10232. be usable for all Array/QVector style purposes, and also as a stack buffer
  10233. with oversize handling. Also some helper classes to make vector operations
  10234. as efficient as possible for POD types and for simple non-PODs like RefPtr.
  10235. (KXMLCore::):
  10236. (KXMLCore::VectorTypeOperations::destruct):
  10237. (KXMLCore::VectorTypeOperations::initialize):
  10238. (KXMLCore::VectorTypeOperations::move):
  10239. (KXMLCore::VectorTypeOperations::uninitializedCopy):
  10240. (KXMLCore::VectorTypeOperations::uninitializedFill):
  10241. (KXMLCore::VectorBuffer::VectorBuffer):
  10242. (KXMLCore::VectorBuffer::~VectorBuffer):
  10243. (KXMLCore::VectorBuffer::deallocateBuffer):
  10244. (KXMLCore::VectorBuffer::inlineBuffer):
  10245. (KXMLCore::Vector::Vector):
  10246. (KXMLCore::Vector::~Vector):
  10247. (KXMLCore::Vector::size):
  10248. (KXMLCore::Vector::capacity):
  10249. (KXMLCore::Vector::isEmpty):
  10250. (KXMLCore::Vector::at):
  10251. (KXMLCore::Vector::operator[]):
  10252. (KXMLCore::Vector::data):
  10253. (KXMLCore::Vector::operator T*):
  10254. (KXMLCore::Vector::operator const T*):
  10255. (KXMLCore::Vector::begin):
  10256. (KXMLCore::Vector::end):
  10257. (KXMLCore::Vector::clear):
  10258. (KXMLCore::Vector::fill):
  10259. (KXMLCore::Vector::operator=):
  10260. (KXMLCore::::Vector):
  10261. (KXMLCore::::operator):
  10262. (KXMLCore::::fill):
  10263. (KXMLCore::::expandCapacity):
  10264. (KXMLCore::::resize):
  10265. (KXMLCore::::reserveCapacity):
  10266. (KXMLCore::::append):
  10267. (KXMLCore::deleteAllValues):
  10268. * kxmlcore/VectorTraits.h: Added.
  10269. (KXMLCore::VectorTraits): Traits to enable making Vector efficient for
  10270. simple types.
  10271. 2006-01-28 Alexey Proskuryakov <ap@nypop.com>
  10272. Reviewed by Darin.
  10273. - fix http://bugs.webkit.org/show_bug.cgi?id=5163
  10274. RealPlayer.GetTitle() Crashes Safari/Dashboard
  10275. * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16):
  10276. Fallback to kCFStringEncodingWindowsLatin1 if the passed buffer is not valid UTF-8, preventing crashes.
  10277. 2006-01-25 George Staikos <staikos@opensource.apple.com>
  10278. Reviewed by Darin.
  10279. * kxmlcore/HashFunctions.h: Merge build fix from KDE.
  10280. 2006-01-25 Darin Adler <darin@apple.com>
  10281. - removed an unused source file
  10282. * kjs/pointer_hash.h: Removed.
  10283. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed reference to pointer_hash.h.
  10284. 2006-01-23 Anders Carlsson <andersca@mac.com>
  10285. Reviewed by Maciej.
  10286. - fix http://bugs.webkit.org/show_bug.cgi?id=6737
  10287. KJS_DEFINE_PROTOTYPE should work outside of the KJS namespace
  10288. * kjs/lookup.h:
  10289. Prefix all KJS types with KJS:: in KJS_DEFINE_PROTOTYPE.
  10290. (cacheGlobalObject):
  10291. Move this out of the KJS namespace.
  10292. 2006-01-23 Maciej Stachowiak <mjs@apple.com>
  10293. Reviewed by Eric.
  10294. - renamed PointerHash to PtrHash
  10295. - made PtrHash the default hash function for int and pointer types that aren't further specialized
  10296. - added an AtomicStringImpl class to make it easier and more typesafe to identity hash atomic strings
  10297. - did appropriate consequent cleanup (very few places now need to declare a hash function)
  10298. http://bugs.webkit.org/show_bug.cgi?id=6752
  10299. * kjs/array_object.cpp:
  10300. (ArrayProtoFunc::callAsFunction): no need to mention PointerHash
  10301. * kjs/collector.cpp: ditto
  10302. * kjs/identifier.cpp:
  10303. (KXMLCore::): declare DefaultHash the new way
  10304. * kjs/internal.cpp: no need to mention PointerHash
  10305. * kjs/ustring.h:
  10306. * kxmlcore/HashCountedSet.h: change how we get the default hash to make it
  10307. easier to specialize on PtrHash
  10308. * kxmlcore/HashFunctions.h:
  10309. (KXMLCore::): renamed PointerHash to PtrHash; changed DefaultHash so that it has
  10310. a Hash typedef rather than being a hash function class itself; declared DefaultHash
  10311. for int and partializy specialized for pointer types
  10312. * kxmlcore/HashMapPtrSpec.h:
  10313. (KXMLCore::PtrHashIteratorAdapter::PtrHashIteratorAdapter): Slight tweaks for new
  10314. way of handling pointer hash
  10315. (KXMLCore::PtrHashConstIteratorAdapter::PtrHashConstIteratorAdapter): ditto
  10316. (KXMLCore::): ditto
  10317. * kxmlcore/HashMap.h: ditto
  10318. * kxmlcore/HashSet.h: ditto
  10319. 2006-01-23 Maciej Stachowiak <mjs@apple.com>
  10320. Reviewed by Tim Omernick.
  10321. - use classes instead of free functions for extractors, this better matches how other
  10322. things work and should avoid the need for hacky workarounds on other compilers
  10323. http://bugs.webkit.org/show_bug.cgi?id=6748
  10324. * kjs/array_object.cpp:
  10325. * kjs/identifier.cpp:
  10326. * kjs/internal.cpp:
  10327. * kxmlcore/HashMap.h:
  10328. (KXMLCore::PairFirstExtractor::extract):
  10329. * kxmlcore/HashMapPtrSpec.h:
  10330. (KXMLCore::):
  10331. * kxmlcore/HashSet.h:
  10332. (KXMLCore::IdentityExtractor::extract):
  10333. * kxmlcore/HashTable.h:
  10334. (KXMLCore::addIterator):
  10335. (KXMLCore::removeIterator):
  10336. (KXMLCore::HashTable::add):
  10337. (KXMLCore::HashTable::isEmptyBucket):
  10338. (KXMLCore::HashTable::isDeletedBucket):
  10339. (KXMLCore::HashTable::HashTable):
  10340. (KXMLCore::HashTable::lookup):
  10341. (KXMLCore::HashTable::add):
  10342. (KXMLCore::HashTable::reinsert):
  10343. (KXMLCore::HashTable::find):
  10344. (KXMLCore::HashTable::contains):
  10345. (KXMLCore::HashTable::remove):
  10346. (KXMLCore::HashTable::allocateTable):
  10347. (KXMLCore::HashTable::deallocateTable):
  10348. (KXMLCore::HashTable::expand):
  10349. (KXMLCore::HashTable::rehash):
  10350. (KXMLCore::HashTable::clear):
  10351. (KXMLCore::HashTable::swap):
  10352. (KXMLCore::HashTable::operator):
  10353. (KXMLCore::HashTable::checkTableConsistency):
  10354. (KXMLCore::HashTable::checkTableConsistencyExceptSize):
  10355. (KXMLCore::HashTable::invalidateIterators):
  10356. 2006-01-23 Maciej Stachowiak <mjs@apple.com>
  10357. Rubber stamped by Tim Hatcher.
  10358. - renamed inert() operation on HashSet, HashCountedSet and HashTable to add()
  10359. for consistency with HashMap
  10360. * kjs/array_object.cpp:
  10361. (ArrayProtoFunc::callAsFunction):
  10362. * kjs/collector.cpp:
  10363. (KJS::Collector::protect):
  10364. * kjs/identifier.cpp:
  10365. (KJS::Identifier::add):
  10366. * kxmlcore/HashCountedSet.h:
  10367. (KXMLCore::::add):
  10368. * kxmlcore/HashMap.h:
  10369. (KXMLCore::::inlineAdd):
  10370. * kxmlcore/HashSet.h:
  10371. (KXMLCore::::add):
  10372. * kxmlcore/HashTable.h:
  10373. (KXMLCore::HashTable::add):
  10374. (KXMLCore::::add):
  10375. (KXMLCore::::HashTable):
  10376. 2006-01-23 Justin Garcia <justin.garcia@apple.com>
  10377. Reviewed by thatcher
  10378. Turned on -O2 for B&I build.
  10379. * JavaScriptCore.xcodeproj/project.pbxproj:
  10380. 2006-01-23 Maciej Stachowiak <mjs@apple.com>
  10381. Reviewed by Tim Hatcher.
  10382. - it's "Franklin Street", not "Franklin Steet"
  10383. * kjs/array_instance.h:
  10384. * kjs/array_object.cpp:
  10385. * kjs/array_object.h:
  10386. * kjs/bool_object.cpp:
  10387. * kjs/bool_object.h:
  10388. * kjs/collector.cpp:
  10389. * kjs/collector.h:
  10390. * kjs/completion.h:
  10391. * kjs/context.h:
  10392. * kjs/date_object.cpp:
  10393. * kjs/date_object.h:
  10394. * kjs/debugger.cpp:
  10395. * kjs/debugger.h:
  10396. * kjs/dtoa.h:
  10397. * kjs/error_object.cpp:
  10398. * kjs/error_object.h:
  10399. * kjs/function.cpp:
  10400. * kjs/function.h:
  10401. * kjs/function_object.cpp:
  10402. * kjs/function_object.h:
  10403. * kjs/grammar.y:
  10404. * kjs/identifier.cpp:
  10405. * kjs/identifier.h:
  10406. * kjs/internal.cpp:
  10407. * kjs/internal.h:
  10408. * kjs/interpreter.cpp:
  10409. * kjs/interpreter.h:
  10410. * kjs/lexer.cpp:
  10411. * kjs/lexer.h:
  10412. * kjs/list.cpp:
  10413. * kjs/list.h:
  10414. * kjs/lookup.cpp:
  10415. * kjs/lookup.h:
  10416. * kjs/math_object.cpp:
  10417. * kjs/math_object.h:
  10418. * kjs/nodes.cpp:
  10419. * kjs/nodes.h:
  10420. * kjs/nodes2string.cpp:
  10421. * kjs/number_object.cpp:
  10422. * kjs/number_object.h:
  10423. * kjs/object.cpp:
  10424. * kjs/object.h:
  10425. * kjs/object_object.cpp:
  10426. * kjs/object_object.h:
  10427. * kjs/operations.cpp:
  10428. * kjs/operations.h:
  10429. * kjs/property_map.cpp:
  10430. * kjs/property_map.h:
  10431. * kjs/property_slot.cpp:
  10432. * kjs/property_slot.h:
  10433. * kjs/reference.cpp:
  10434. * kjs/reference.h:
  10435. * kjs/reference_list.cpp:
  10436. * kjs/reference_list.h:
  10437. * kjs/regexp.cpp:
  10438. * kjs/regexp.h:
  10439. * kjs/regexp_object.cpp:
  10440. * kjs/regexp_object.h:
  10441. * kjs/scope_chain.cpp:
  10442. * kjs/scope_chain.h:
  10443. * kjs/simple_number.h:
  10444. * kjs/string_object.cpp:
  10445. * kjs/string_object.h:
  10446. * kjs/testkjs.cpp:
  10447. * kjs/types.h:
  10448. * kjs/ustring.cpp:
  10449. * kjs/ustring.h:
  10450. * kjs/value.cpp:
  10451. * kjs/value.h:
  10452. * kxmlcore/AlwaysInline.h:
  10453. * kxmlcore/ListRefPtr.h:
  10454. * kxmlcore/PassRefPtr.h:
  10455. * kxmlcore/RefPtr.h:
  10456. 2006-01-23 Darin Adler <darin@apple.com>
  10457. Reviewed by John Sullivan.
  10458. - change needed for fix to http://bugs.webkit.org/show_bug.cgi?id=6617
  10459. REGRESSION: Crash in cloneChildNodes when clicking element
  10460. * kxmlcore/PassRefPtr.h: Fix assignment operator from RefPtr of a different
  10461. type by calling get() instead of going directly at m_ptr.
  10462. * kxmlcore/RefPtr.h: Ditto.
  10463. - other changes
  10464. * JavaScriptCore.xcodeproj/project.pbxproj: Xcode decided to change this file.
  10465. It's just a resorted list of keys in a dictionary.
  10466. * kjs/fpconst.cpp: Wrap this file in #if __APPLE__ since the alternate version
  10467. in internal.cpp is in #if !__APPLE__. This file is to give us the "no init
  10468. routine" property we want to have on OS X.
  10469. 2006-01-22 Maciej Stachowiak <mjs@apple.com>
  10470. Reviewed by Darin.
  10471. - Set up Page class and invert Frame / WebCoreFrameBridge ownership
  10472. http://bugs.webkit.org/show_bug.cgi?id=6577
  10473. * kjs/interpreter.h: make globalExec virtual so ScriptInterpreter can
  10474. override it
  10475. 2006-01-23 George Staikos <staikos@opensource.apple.com>
  10476. Reviewed by Maciej and Darin.
  10477. * kxmlcore/Assertions.h: This file only works with __APPLE__ right now
  10478. * kjs/interpreter.cpp: ditto
  10479. * kjs/simple_number.h: Add assert.h and remove from config.h
  10480. * kjs/array_object.cpp: Use relative paths for kxmlcore includes
  10481. * kjs/testkjs.cpp: Use relative paths for kxmlcore includes
  10482. 2006-01-23 George Staikos <staikos@opensource.apple.com>
  10483. Reviewed by Maciej.
  10484. * kjs/config.h: unbreak preprocessor change
  10485. 2006-01-23 George Staikos <staikos@opensource.apple.com>
  10486. Approved by Maciej and Darin.
  10487. * kjs/:
  10488. * kxmlcore/:
  10489. Update FSF address in license to make merging easier
  10490. 2006-01-22 George Staikos <staikos@opensource.apple.com>
  10491. Reviewed by Maciej.
  10492. * kjs/collector.cpp: merge major speedup from KDE on Linux
  10493. patch by Maks Orlovich, bug #6145
  10494. Also unify cpu detection
  10495. * kjs/config.h: define simpler CPU macros
  10496. 2006-01-22 George Staikos <staikos@opensource.apple.com>
  10497. Reviewed by Maciej.
  10498. * kjs/collector.cpp: merge FreeBSD compile fix from KDE
  10499. -> requires build magic for use
  10500. 2006-01-21 George Staikos <staikos@opensource.apple.com>
  10501. Reviewed by Maciej.
  10502. * kjs/nodes2string.cpp
  10503. * kjs/operations.h
  10504. * kjs/debugger.h
  10505. Fix pedantic compile with some gcc versions (Merge from KDE)
  10506. * kjs/create_hash_table:
  10507. Fix build with Perl 5.8.0 (Merge from KDE)
  10508. 2006-01-18 Darin Adler <darin@apple.com>
  10509. Reviewed by Hyatt.
  10510. - hash table fixes needed for my WebCore changes
  10511. * kxmlcore/HashTable.h: (KXMLCore::HashTableConstIterator::operator=):
  10512. Added a missing return statement.
  10513. * kxmlcore/HashTraits.h: Fix traits so they work properly for classes where you
  10514. can't instantiate with a 0 by using traits rather than ? : to select the default
  10515. emtpy value of hash table keys.
  10516. - small cleanup of "runtime" code left over from recent JavaScript crash fix
  10517. * bindings/runtime_root.h:
  10518. (KJS::Bindings::RootObject::RootObject): No explicit initialization of _imp needed
  10519. since it's now a ProtectedPtr.
  10520. (KJS::Bindings::RootObject::setRootObjectImp): Remove old code that relied on the
  10521. fact that _imp was 0 and replaced with use of ProtectedPtr.
  10522. (KJS::Bindings::RootObject::rootObjectImp): Updated since _imp is a ProtectedPtr.
  10523. 2006-01-17 Darin Adler <darin@apple.com>
  10524. Reviewed by Anders.
  10525. - http://bugs.webkit.org/show_bug.cgi?id=6611
  10526. add assertions to check correct use of hash table iterators
  10527. * kxmlcore/HashTable.h:
  10528. (KXMLCore::addIterator): Added. Helper function that adds an iterator to the list
  10529. maintained by the specified hash table.
  10530. (KXMLCore::removeIterator): Added. Helper function that removes an iterator from
  10531. the list maintained by the hash table it's in.
  10532. (KXMLCore::HashTableConstIterator::HashTableConstIterator): Added a HashTable
  10533. parameter, ignored when not debugging. Call addIterator.
  10534. (KXMLCore::HashTableConstIterator::~HashTableConstIterator):
  10535. (KXMLCore::HashTableConstIterator::operator=): Call removeIterator.
  10536. (KXMLCore::HashTableConstIterator::operator*): Call checkValidity.
  10537. (KXMLCore::HashTableConstIterator::operator->): Ditto.
  10538. (KXMLCore::HashTableConstIterator::operator++): Ditto.
  10539. (KXMLCore::HashTableConstIterator::operator==): Ditto.
  10540. (KXMLCore::HashTableConstIterator::operator!=): Ditto.
  10541. (KXMLCore::HashTableConstIterator::checkValidity): Checks that the hash table
  10542. pointer is not 0 and if there are two iterators that both point at the same table.
  10543. (KXMLCore::HashTableIterator::HashTableIterator): Changed to use the const iterator
  10544. as an implementation detail, to avoid having two separate iterator implementations.
  10545. (KXMLCore::HashTableIterator::operator*): Ditto.
  10546. (KXMLCore::HashTableIterator::operator->): Ditto.
  10547. (KXMLCore::HashTableIterator::operator++): Ditto.
  10548. (KXMLCore::HashTableIterator::operator==): Ditto.
  10549. (KXMLCore::HashTableIterator::operator!=): Ditto.
  10550. (KXMLCore::HashTable::HashTable): Initialize pointer to head of iterators list.
  10551. (KXMLCore::HashTable::~HashTable): Added call to invalidateIterators.
  10552. (KXMLCore::HashTable::makeIterator): Pass this pointer.
  10553. (KXMLCore::HashTable::makeConstIterator): Ditto.
  10554. (KXMLCore::HashTable::insert): Call invalidateIterators, since this is a public
  10555. entry point that modifies the hash table.
  10556. (KXMLCore::HashTable::remove): Ditto.
  10557. (KXMLCore::HashTable::clear): Ditto.
  10558. (KXMLCore::HashTable::swap): Ditto.
  10559. (KXMLCore::HashTable::invalidateIterators): Added. Walks the iterators list and
  10560. clears out the table, next, and previous pointers in all of them, and then clears
  10561. the head so we have an empty list.
  10562. (KXMLCore::addIterator): Added. Adds the iterator the the linked list in the
  10563. passed-in table, and points the iterator at the table.
  10564. (KXMLCore::removeIterator): Added. Removes the iterator from the linked list in
  10565. the passed-in table.
  10566. * kxmlcore/HashTraits.h: A bit of tweaking and formatting.
  10567. 2006-01-17 Justin Garcia <justin.garcia@apple.com>
  10568. Reviewed by eric
  10569. Deployment builds now use -O2
  10570. * JavaScriptCore.xcodeproj/project.pbxproj:
  10571. 2006-01-17 Darin Adler <darin@apple.com>
  10572. Reviewed by Anders.
  10573. - fix http://bugs.webkit.org/show_bug.cgi?id=6610
  10574. change RefPtr so that it works when deref ends up deleting the RefPtr
  10575. * kxmlcore/PassRefPtr.h: Always set m_ptr before calling deref.
  10576. * kxmlcore/RefPtr.h: Ditto.
  10577. 2006-01-16 Geoffrey Garen <ggaren@apple.com>
  10578. Reviewed by darin.
  10579. - Fixed http://bugs.webkit.org/show_bug.cgi?id=6322
  10580. DateProtoFuncImp::callAsFunction can crash due to lack of type checking
  10581. * kjs/date_object.cpp:
  10582. (KJS::DateProtoFunc::callAsFunction): Type check calls to all methods.
  10583. This matches section 15.9.5 in the spec.
  10584. 2006-01-16 Tim Omernick <timo@apple.com>
  10585. Reviewed by John Sullivan.
  10586. JavaScriptCore part of <rdar://problem/4211707> NPAPI ref count behavior differs with Mozilla
  10587. * bindings/npruntime.cpp:
  10588. (_NPN_ReleaseObject):
  10589. Refactored part of this function out into _NPN_DeallocateObject.
  10590. (_NPN_DeallocateObject):
  10591. Forcibly deallocates the passed object, even if its refcount is
  10592. greater than zero.
  10593. * bindings/npruntime_impl.h:
  10594. Declared _NPN_DeallocateObject().
  10595. 2006-01-16 Darin Adler <darin@apple.com>
  10596. Reviewed by Maciej.
  10597. - fix problem with ++, ==, and != on const iterators in
  10598. HashMaps that are using the pointer specialization
  10599. * kxmlcore/HashMapPtrSpec.h:
  10600. (KXMLCore::PointerHashConstIteratorAdapter::operator++): Change type to const_iterator.
  10601. (KXMLCore::PointerHashConstIteratorAdapter::operator==): Ditto.
  10602. (KXMLCore::PointerHashConstIteratorAdapter::operator!=): Ditto.
  10603. 2006-01-15 Alexey Proskuryakov <ap@nypop.com>
  10604. Reviewed by Anders.
  10605. - fix http://bugs.webkit.org/show_bug.cgi?id=6561
  10606. run-javascriptcore-tests doesn't work
  10607. * JavaScriptCore/tests/mozilla/Getopt/Mixed.pm:
  10608. Changed revision number to 1.8 (broken by svn migration).
  10609. 2006-01-14 David Kilzer <ddkilzer@kilzer.net>
  10610. Reviewed and landed by Anders.
  10611. * kjs/create_hash_table: Fixed comment typo.
  10612. 2006-01-13 Maks Orlovich <maksim@kde.org>
  10613. Mostly merging work by Peter Kelly. Reviewed by Maciej, landed by ap.
  10614. - fix http://bugs.webkit.org/show_bug.cgi?id=6261
  10615. Misc. array object fixes from KJS
  10616. * kjs/array_object.cpp: Don't treat 2^32-1 as a real array index property.
  10617. (ArrayInstance::getOwnPropertySlot): Ditto.
  10618. (ArrayInstance::deleteProperty): Ditto.
  10619. (ArrayInstance::put): Ditto.
  10620. (ArrayInstance::propList): Added a FIXME comment.
  10621. (ArrayInstance::put): Throw exception on trying to set invalid array length.
  10622. (ArrayProtoFunc::callAsFunction): Do not use a separator argument when doing toString/toLocalString.
  10623. * kjs/array_object.h: Added MAX_ARRAY_INDEX.
  10624. 2006-01-13 Darin Adler <darin@apple.com>
  10625. - Replaced tabs with spaces in source files that had less than 10 lines with tabs.
  10626. - Set allow-tabs Subversion property in source files that have more than 10 lines with tabs.
  10627. 2006-01-13 Anders Carlsson <andersca@mac.com>
  10628. Reviewed by Eric.
  10629. * kjs/create_hash_table:
  10630. Use correct size variables.
  10631. 2006-01-13 Anders Carlsson <andersca@mac.com>
  10632. Reviewed by Darin.
  10633. * kjs/create_hash_table:
  10634. Don't create an empty entry array, instead add a entry with all fields
  10635. set to null and set the hash table size to 1.
  10636. * kjs/lookup.cpp:
  10637. (findEntry):
  10638. Remove the hash table size check
  10639. 2006-01-12 Anders Carlsson <andersca@mac.com>
  10640. Reviewed by Maciej.
  10641. - fix http://bugs.webkit.org/show_bug.cgi?id=6494
  10642. Crash when assigning a new function to a DOMParser object
  10643. * JavaScriptCore.xcodeproj/project.pbxproj:
  10644. Move lookup.cpp before lookup.h
  10645. * kjs/lookup.cpp:
  10646. (findEntry):
  10647. If the hash table is empty, return 0 early.
  10648. 2006-01-12 George Staikos <staikos@kde.org>
  10649. Reviewed by Darin.
  10650. * kjs/interpreter.cpp:
  10651. * kjs/testkjs.cpp:
  10652. * kjs/interpreter.h:
  10653. Add helper to interpreter to call the collector in order to facilitate
  10654. visibility rules in KDE.
  10655. 2006-01-12 George Staikos <staikos@kde.org>
  10656. Reviewed by Maciej.
  10657. * kjs/kjs.pro: Updates to build the whole thing on Linux at least.
  10658. * kxmlcore/HashTable.h: Add missing assert.h
  10659. 2006-01-12 Darin Adler <darin@apple.com>
  10660. Reviewed by Geoff.
  10661. - fix http://bugs.webkit.org/show_bug.cgi?id=6505
  10662. retire APPLE_CHANGES from JavaScriptCore
  10663. * JavaScriptCore.xcodeproj/project.pbxproj: Removed both
  10664. APPLE_CHANGES and HAVE_CONFIG_H from all targets.
  10665. * README: Removed. This had obsolete information in it
  10666. and it wasn't clear what to replace it with.
  10667. * kjs/collector.h: Removed an APPLE_CHANGES if around something
  10668. that's not really platform-specific (although it does use a
  10669. platform-specific API at the moment).
  10670. * kjs/collector.cpp: Removed a mistaken comment.
  10671. * kjs/grammar.y:
  10672. * kjs/internal.cpp:
  10673. * kjs/object.h:
  10674. * kjs/operations.cpp:
  10675. * kjs/operations.h:
  10676. * kjs/ustring.h:
  10677. Use __APPLE__ instead of APPLE_CHANGES for code that should be
  10678. used only on Mac OS X.
  10679. * kjs/interpreter.cpp: Removed APPLE_CHANGES ifdef around the include
  10680. of the runtime.h header. Even though that header isn't needed at the
  10681. moment on platforms other than Mac OS X, the conditional stuff should
  10682. be in the header itself, not in this one client.
  10683. * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed some
  10684. code inside APPLE_CHANGES. I'm pretty sure this code isn't needed on
  10685. any platform where pow is implemented corrrectly according to the IEEE
  10686. standard. If it is needed on some, we can add it back with an appropriate
  10687. #if for the platforms where it is needed.
  10688. 2006-01-12 Justin Haygood <justin@xiondigital.net>
  10689. Reviewed, tweaked, and landed by Darin.
  10690. - fix http://bugs.webkit.org/show_bug.cgi?id=6416
  10691. lexer.cpp, grammar.y protect include of config.h with "HAVE_CONFIG_H"
  10692. * kjs/dtoa.cpp: Removed HAVE_CONFIG_H, changed config.h to use
  10693. quotes instead of angle brackets. Moved dtoa.h include to the top.
  10694. Changed system header includes to use angle brackets instead of quotes.
  10695. * kjs/grammar.y: Removed HAVE_CONFIG_H, changed config.h to use
  10696. quotes instead of angle brackets.
  10697. * kjs/lexer.cpp: Removed HAVE_CONFIG_H, changed config.h to use
  10698. quotes instead of angle brackets. Moved lexer.h include to the top.
  10699. * kjs/ustring.cpp: Removed HAVE_CONFIG_H, changed config.h to use
  10700. quotes instead of angle brackets. Moved ustring.h include to the top.
  10701. 2006-01-12 George Staikos <staikos@kde.org>
  10702. Reviewed by Maciej
  10703. - Import initial QMake file. Doesn't fully work yet.
  10704. 2006-01-11 Ricci Adams <ricciadams@apple.com>
  10705. Reviewed by Maciej and Darin, landed by Darin.
  10706. - fix http://bugs.webkit.org/show_bug.cgi?id=5939
  10707. final comma in javascript object prevents parsing
  10708. * kjs/grammar.y: Added rule to allow trailing comma in
  10709. object construction.
  10710. 2006-01-11 Ricci Adams <ricciadams@apple.com>
  10711. Reviewed by Geoff, landed by Darin.
  10712. - fix http://bugs.webkit.org/show_bug.cgi?id=5308
  10713. Number.toFixed doesn't include leading 0
  10714. * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
  10715. Fixed a "<" that should have been a "<=".
  10716. 2006-01-11 Ricci Adams <ricciadams@apple.com>
  10717. Reviewed by Geoff, landed by Darin.
  10718. - fix http://bugs.webkit.org/show_bug.cgi?id=5307
  10719. Number.toFixed doesn't round 0.5 up
  10720. * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction):
  10721. Fixed a ">" that should have been a ">=".
  10722. 2006-01-11 Justin Haygood <justin@xiondigital.net>
  10723. Reviewed and landed by Darin.
  10724. - fix http://bugs.webkit.org/show_bug.cgi?id=6486
  10725. JavaScriptCore should use system malloc on Windows
  10726. * kjs/config.h: Add USE_SYSTEM_MALLOC to the Win32 section.
  10727. 2006-01-10 Darin Adler <darin@apple.com>
  10728. * Makefile: Took out unneeded "export" line.
  10729. * <many-files>: Changed a lot of flags (cleared bogus executable bits, set
  10730. MIME types, other small corrections).
  10731. 2006-01-09 Darin Adler <darin@apple.com>
  10732. * Makefile.am: Removed.
  10733. 2006-01-07 Anders Carlsson <andersca@mac.com>
  10734. Reviewed by Maciej.
  10735. - fix http://bugs.webkit.org/show_bug.cgi?id=6373
  10736. REGRESSION: JavaScript hang when comparing large array to null
  10737. * kjs/object.h:
  10738. (KJS::JSObject::isEqualToNull):
  10739. Add new function which returns true if an object should be treated as null when
  10740. doing comparisons.
  10741. * kjs/operations.cpp:
  10742. (KJS::equal):
  10743. Use isEqualToNull.
  10744. 2006-01-07 Alexey Proskuryakov <ap@nypop.com>
  10745. Reviewed by Maciej.
  10746. - Fix WebCore development build
  10747. http://bugs.webkit.org/show_bug.cgi?id=6408
  10748. * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
  10749. 2006-01-06 Maciej Stachowiak <mjs@apple.com>
  10750. Reviewed by Darin.
  10751. - miscellaneous changes for 4% speedup on the JavaScript iBench
  10752. http://bugs.webkit.org/show_bug.cgi?id=6396
  10753. Changes mostly thanks to Maks Orlovich, tweaked a little by me.
  10754. * kjs/create_hash_table: Use the same hash as the one used by Identifier.
  10755. * kjs/function.cpp:
  10756. (KJS::FunctionImp::processParameters): Use the new List::copyFrom
  10757. (KJS::ActivationImp::ActivationImp): track variable while iterating
  10758. * kjs/internal.cpp:
  10759. (KJS::StringImp::toObject): create StringInstance directly
  10760. * kjs/list.cpp:
  10761. (KJS::List::copy): implement in terms of copyFrom
  10762. (KJS::List::copyFrom): more efficient way to copy in another list
  10763. * kjs/list.h:
  10764. * kjs/lookup.cpp:
  10765. (keysMatch): updated to work with identifier hash
  10766. (findEntry): ditto
  10767. (Lookup::findEntry): ditto
  10768. (Lookup::find): ditto
  10769. * kjs/lookup.h:
  10770. 2006-01-06 Maciej Stachowiak <mjs@apple.com>
  10771. - fix development build failure from the previous checkin
  10772. * kjs/function.cpp:
  10773. (KJS::ActivationImp::put): Use prototype() accessor in assert.
  10774. 2006-01-05 Maciej Stachowiak <mjs@apple.com>
  10775. Reviewed by Eric.
  10776. - fix remaining performance regression from Getter/Setter change
  10777. http://bugs.webkit.org/show_bug.cgi?id=6249
  10778. - Activation objects should not have __proto__ property
  10779. http://bugs.webkit.org/show_bug.cgi?id=6395
  10780. * kjs/function.cpp:
  10781. (KJS::ActivationImp::getOwnPropertySlot): Implement directly, thus
  10782. skipping getter/setter handling and __proto__ handling, as well
  10783. as inlining needed superclass stuff.
  10784. (KJS::ActivationImp::put): Implement directly, skipping getter/setter,
  10785. __proto__, and do canPut directly in PropertyMap::put since there's no
  10786. static property table either.
  10787. * kjs/function.h:
  10788. * kjs/property_map.cpp:
  10789. (KJS::PropertyMap::put): Allow optionally inlining canPut check.
  10790. * kjs/property_map.h:
  10791. 2006-01-04 Geoffrey Garen <ggaren@apple.com>
  10792. Patch by kimmo.t.kinnunen@nokia.com, reviewed by darin, tweaked by me.
  10793. - Fixed http://bugs.webkit.org/show_bug.cgi?id=4921
  10794. \u escape sequences in JavaScript identifiers
  10795. * kjs/function_object.cpp:
  10796. (FunctionObjectImp::construct):
  10797. * kjs/lexer.cpp:
  10798. (Lexer::shift):
  10799. (Lexer::lex):
  10800. (Lexer::isWhiteSpace):
  10801. (Lexer::isLineTerminator):
  10802. (Lexer::isIdentStart):
  10803. (Lexer::isIdentPart):
  10804. (isDecimalDigit):
  10805. (Lexer::scanRegExp):
  10806. * kjs/lexer.h:
  10807. (KJS::Lexer::):
  10808. * tests/mozilla/expected.html: Updated test results.
  10809. 2005-12-30 Maciej Stachowiak <mjs@apple.com>
  10810. No review, just test result update.
  10811. * tests/mozilla/expected.html: Updated for newly passing test from recent fixes.
  10812. 2005-12-30 Anders Carlsson <andersca@mac.com>
  10813. Reviewed by Maciej.
  10814. - Fix http://bugs.webkit.org/show_bug.cgi?id=6298
  10815. Getter setter test is failing
  10816. * kjs/object.cpp:
  10817. (KJS::JSObject::put):
  10818. Rework the getter setter part. We now walk the prototype chain, checking for
  10819. getter/setter properties and only take the slow path if any are found.
  10820. 2005-12-30 Maks Orlovich <maksim@kde.org>
  10821. Reviewed and committed by Maciej.
  10822. - Handle negative, FP numbers with non-10 radix in toString
  10823. http://bugs.webkit.org/show_bug.cgi?id=6259
  10824. (Merged from KJS, original work by Harri Porten)
  10825. * kjs/number_object.cpp:
  10826. (NumberProtoFunc::callAsFunction): rewrote Number.toString(radix) to work with
  10827. negative numbers, floating point and very large numbers.
  10828. 2005-12-29 Geoffrey Garen <ggaren@apple.com>
  10829. Patch by Maks Orlovich, reviewed and landed by me.
  10830. - http://bugs.webkit.org/show_bug.cgi?id=6267
  10831. Fix Number.prototype.toFixed/toExponential(undefined)
  10832. * kjs/number_object.cpp:
  10833. (NumberProtoFunc::callAsFunction):
  10834. 2005-12-29 Geoffrey Garen <ggaren@apple.com>
  10835. Patch by Maks Orlovich, Reviewed and landed by me.
  10836. - http://bugs.webkit.org/show_bug.cgi?id=6266
  10837. Minor object naming updates (to match Mozilla, KJS)
  10838. * kjs/number_object.cpp:
  10839. * kjs/regexp_object.cpp:
  10840. 2005-12-29 Geoffrey Garen <ggaren@apple.com>
  10841. Patch by Maks Orlovich, reviewed by mjs.
  10842. This has 2 very minor fixes, covered by KJS testsuite:
  10843. 1. Enumerates string indices in property list (with the same bug as array
  10844. object has in corresponding code). This is a mozilla emulation thing.
  10845. 2. Permits properties with integer names in prototypes to be found
  10846. * kjs/string_object.cpp:
  10847. (StringInstance::getOwnPropertySlot):
  10848. (StringInstanceImp::propList):
  10849. * kjs/string_object.h:
  10850. 2005-12-26 Geoffrey Garen <ggaren@apple.com>
  10851. Reviewed by mjs.
  10852. - Fixed <rdar://problem/4364705> run-javascriptcore-tests crashes in
  10853. KJS::BlockNode::deref
  10854. AKA
  10855. http://bugs.webkit.org/show_bug.cgi?id=6233
  10856. Reproducible stack-overflow crash in ~RefPtr<T> due to RefPtr<T> use in
  10857. linked lists
  10858. This patch does four things:
  10859. (1) Standardizes all our linked list nodes to use "next" as their next
  10860. pointers.
  10861. (2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
  10862. to iteratively deref "next" pointers.
  10863. (3) Standardizes our linked list nodes to use ListRefPtr<T> and
  10864. implement the releaseNext() function used by ~ListRefPtr<T>().
  10865. (4) Adds to RefPtr<T> the release() method used by releaseNext().
  10866. - Modified existing mozilla test to ensure it would make deployment
  10867. builds crash as well.
  10868. * JavaScriptCore.xcodeproj/project.pbxproj:
  10869. * kjs/nodes.cpp:
  10870. (ElementNode::evaluate):
  10871. (PropertyListNode::evaluate):
  10872. (ArgumentListNode::evaluateList):
  10873. (StatListNode::StatListNode):
  10874. (StatListNode::execute):
  10875. (StatListNode::processVarDecls):
  10876. (VarDeclListNode::evaluate):
  10877. (VarDeclListNode::processVarDecls):
  10878. (VarStatementNode::execute):
  10879. (VarStatementNode::processVarDecls):
  10880. (BlockNode::BlockNode):
  10881. (CaseClauseNode::evalStatements):
  10882. (CaseClauseNode::processVarDecls):
  10883. (ClauseListNode::processVarDecls):
  10884. (CaseBlockNode::CaseBlockNode):
  10885. (CaseBlockNode::evalBlock):
  10886. (SourceElementsNode::SourceElementsNode):
  10887. (SourceElementsNode::execute):
  10888. (SourceElementsNode::processFuncDecl):
  10889. (SourceElementsNode::processVarDecls):
  10890. * kjs/nodes.h:
  10891. (KJS::ElementNode::ElementNode):
  10892. (KJS::ElementNode::releaseNext):
  10893. (KJS::ArrayNode::ArrayNode):
  10894. (KJS::PropertyListNode::PropertyListNode):
  10895. (KJS::PropertyListNode::releaseNext):
  10896. (KJS::ObjectLiteralNode::ObjectLiteralNode):
  10897. (KJS::ArgumentListNode::ArgumentListNode):
  10898. (KJS::ArgumentListNode::releaseNext):
  10899. (KJS::ArgumentsNode::ArgumentsNode):
  10900. (KJS::StatListNode::releaseNext):
  10901. (KJS::VarDeclListNode::VarDeclListNode):
  10902. (KJS::VarDeclListNode::releaseNext):
  10903. (KJS::VarStatementNode::VarStatementNode):
  10904. (KJS::ForNode::ForNode):
  10905. (KJS::CaseClauseNode::CaseClauseNode):
  10906. (KJS::ClauseListNode::ClauseListNode):
  10907. (KJS::ClauseListNode::getClause):
  10908. (KJS::ClauseListNode::getNext):
  10909. (KJS::ClauseListNode::releaseNext):
  10910. (KJS::ParameterNode::ParameterNode):
  10911. (KJS::ParameterNode::releaseNext):
  10912. (KJS::SourceElementsNode::releaseNext):
  10913. * kjs/nodes2string.cpp:
  10914. (ElementNode::streamTo):
  10915. (PropertyListNode::streamTo):
  10916. (ArgumentListNode::streamTo):
  10917. (StatListNode::streamTo):
  10918. (VarDeclListNode::streamTo):
  10919. (VarStatementNode::streamTo):
  10920. (CaseClauseNode::streamTo):
  10921. (ClauseListNode::streamTo):
  10922. (CaseBlockNode::streamTo):
  10923. (SourceElementsNode::streamTo):
  10924. * kxmlcore/ListRefPtr.h: Added.
  10925. (KXMLCore::ListRefPtr::ListRefPtr):
  10926. (KXMLCore::ListRefPtr::~ListRefPtr):
  10927. (KXMLCore::ListRefPtr::operator=):
  10928. * kxmlcore/RefPtr.h:
  10929. (KXMLCore::RefPtr::release):
  10930. 2005-12-29 Geoffrey Garen <ggaren@apple.com>
  10931. Reviewed by mjs.
  10932. - Fixed http://bugs.webkit.org/show_bug.cgi?id=4026
  10933. Math.random() not seeded.
  10934. Added call to sranddev() -- it executes the first time a process
  10935. calls Math.random().
  10936. * kjs/math_object.cpp:
  10937. (MathFuncImp::callAsFunction):
  10938. 2005-12-29 Geoffrey Garen <ggaren@apple.com>
  10939. Reviewed by darin.
  10940. - Fixed http://bugs.webkit.org/show_bug.cgi?id=6265
  10941. Name change regression: Java doesn't know what JavaJSObject is
  10942. Changed strings passed to Java back to original "JSObject".
  10943. * bindings/jni/jni_jsobject.cpp:
  10944. (JavaJSObject::convertValueToJObject):
  10945. (JavaJSObject::convertJObjectToValue):
  10946. 2005-12-28 Anders Carlsson <andersca@mac.com>
  10947. Reviewed by Maciej.
  10948. - The JSC part of http://bugs.webkit.org/show_bug.cgi?id=6268
  10949. Add undetectable document.all
  10950. * kjs/operations.cpp:
  10951. (KJS::equal):
  10952. When comparing an object with null or undefined, call toPrimitive with
  10953. NullType as the preferred type.
  10954. 2005-12-27 Anders Carlsson <andersca@mac.com>
  10955. Reviewed by Darin.
  10956. * kjs/array_object.cpp:
  10957. (ArrayProtoFunc::callAsFunction):
  10958. Implement filter and map. Also, make the existing
  10959. array iteration functions not invoke the callback for
  10960. non-existing properties, just as Mozilla does now.
  10961. * kjs/array_object.h:
  10962. (KJS::ArrayProtoFunc::):
  10963. Add filter and map.
  10964. * tests/mozilla/expected.html:
  10965. Update, two 1.6 tests now pass.
  10966. 2005-12-27 Maciej Stachowiak <mjs@apple.com>
  10967. - updated test results for new JS 1.6 tests
  10968. * tests/mozilla/expected.html:
  10969. 2005-12-27 Anders Carlsson <andersca@mac.com>
  10970. Reviewed by Maciej.
  10971. Add Mozilla JS 1.6 tests.
  10972. * tests/mozilla/js1_6/Array/browser.js: Added.
  10973. * tests/mozilla/js1_6/Array/regress-290592.js: Added.
  10974. * tests/mozilla/js1_6/Array/regress-304828.js: Added.
  10975. * tests/mozilla/js1_6/Array/regress-305002.js: Added.
  10976. * tests/mozilla/js1_6/Array/regress-310425-01.js: Added.
  10977. * tests/mozilla/js1_6/Array/regress-310425-02.js: Added.
  10978. * tests/mozilla/js1_6/Array/regress-320887.js: Added.
  10979. * tests/mozilla/js1_6/Array/shell.js: Added.
  10980. * tests/mozilla/js1_6/README: Added.
  10981. * tests/mozilla/js1_6/Regress/browser.js: Added.
  10982. * tests/mozilla/js1_6/Regress/regress-301574.js: Added.
  10983. * tests/mozilla/js1_6/Regress/regress-309242.js: Added.
  10984. * tests/mozilla/js1_6/Regress/regress-311157-01.js: Added.
  10985. * tests/mozilla/js1_6/Regress/regress-311157-02.js: Added.
  10986. * tests/mozilla/js1_6/Regress/regress-314887.js: Added.
  10987. * tests/mozilla/js1_6/Regress/regress-320172.js: Added.
  10988. * tests/mozilla/js1_6/Regress/shell.js: Added.
  10989. * tests/mozilla/js1_6/String/browser.js: Added.
  10990. * tests/mozilla/js1_6/String/regress-306591.js: Added.
  10991. * tests/mozilla/js1_6/String/shell.js: Added.
  10992. * tests/mozilla/js1_6/browser.js: Added.
  10993. * tests/mozilla/js1_6/shell.js: Added.
  10994. * tests/mozilla/js1_6/template.js: Added.
  10995. 2005-12-27 Maks Orlovich <maksim@kde.org>
  10996. Reviewed and landed by Maciej.
  10997. - fixed 6234: Can delete array index property incorrectly.
  10998. http://bugs.webkit.org/show_bug.cgi?id=6234
  10999. * kjs/array_object.cpp:
  11000. (ArrayInstance::deleteProperty): use toArrayIndex instead of toUInt32 when
  11001. looking for array properties.
  11002. 2005-12-27 Anders Carlsson <andersca@mac.com>
  11003. Reviewed by Maciej.
  11004. * kjs/object.cpp:
  11005. (KJS::JSObject::defineSetter):
  11006. Remove duplicate call to putDirect.
  11007. 2005-12-26 Maciej Stachowiak <mjs@apple.com>
  11008. Reviewed by Darin and Geoff.
  11009. Changes by me and Anders.
  11010. - mostly fixed REGRESSION: 5-10% performance regression on JS iBench from getter/setter change
  11011. http://bugs.webkit.org/show_bug.cgi?id=6083
  11012. - also fixed some warnings reported by -Winline
  11013. * JavaScriptCorePrefix.h: Move new and delete definitions higher so there
  11014. aren't conflicts with use in standard C++ headers
  11015. * kjs/object.cpp:
  11016. (KJS::throwSetterError): Moved this piece of put into a seprate function
  11017. to avoid the PIC branch.
  11018. (KJS::JSObject::put): Use hasGetterSetterProperties to avoid expensive stuff
  11019. when not needed. Also use GetterSetter properties attribute.
  11020. (KJS::JSObject::deleteProperty): Recompute whether any properties are getter/setter
  11021. properties any more, if this one was one.
  11022. (KJS::JSObject::defineGetter): Let the PropertyMap know that it has getter/setter
  11023. properties now (and use the new attribute).
  11024. (KJS::JSObject::defineSetter): Ditto.
  11025. (KJS::JSObject::fillGetterPropertySlot): Out-of-line helper for getOwnPropertySlot,
  11026. to avoid global variable access in the hot code path.
  11027. * kjs/object.h:
  11028. (KJS::): Added GetterSetter attribute.
  11029. (KJS::JSCell::isObject): Moved lower to be after inline methods it uses.
  11030. (KJS::JSValue::isObject): ditto
  11031. (KJS::JSObject::getOwnPropertySlot): try to avoid impact of getters and setters
  11032. as much as possible in the case where they are not being used
  11033. * kjs/property_map.cpp:
  11034. (KJS::PropertyMap::containsGettersOrSetters): New method to help with this
  11035. * kjs/property_map.h:
  11036. (KJS::PropertyMap::hasGetterSetterProperties): Ditto
  11037. (KJS::PropertyMap::setHasGetterSetterProperties): Ditto
  11038. (KJS::PropertyMap::PropertyMap): Added a crazy hack to store the
  11039. global "has getter/setter properties" flag in the property map
  11040. single entry, to avoid making objects any bigger.
  11041. * kjs/value.h: Moved some things to object.h to make -Winline happier
  11042. 2005-12-24 Maciej Stachowiak <mjs@apple.com>
  11043. Reviewed by Eric and Dave Hyatt.
  11044. - make even const PassRefPtrs give transfer of ownership semantics
  11045. http://bugs.webkit.org/show_bug.cgi?id=6238
  11046. This is a somewhat cheesy change. Having to use PassRefPtr_Ref creates ambiguities
  11047. in assignment and copy construction. And this makes life way easier and removes
  11048. the need for pass(). It is not really correct, but we pretty much never need a real
  11049. const PassRefPtr, and this takes care of things for PassRefPtr temporaries.
  11050. * kjs/identifier.cpp:
  11051. (KJS::Identifier::add): No more need for pass()
  11052. * kjs/property_map.cpp:
  11053. (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): No more need for pass()
  11054. * kjs/ustring.cpp:
  11055. (KJS::UString::Rep::create): Use adoptRef
  11056. (KJS::UString::UString): No more need for pass
  11057. (KJS::UString::append): No more need for pass
  11058. (KJS::UString::substr): No more need for pass
  11059. * kxmlcore/PassRefPtr.h: made m_ptr mutable (ugh)
  11060. (KXMLCore::PassRefPtr::PassRefPtr): Take a const PassRefPtr reference
  11061. (KXMLCore::PassRefPtr::release): Made this a const method (ugh)
  11062. (KXMLCore::PassRefPtr::operator=): clean up appropriately
  11063. (KXMLCore::adoptRef): Added this to use instead of PassRefPtr<T>::adopt, I think
  11064. it makes the behavior more clear and it is less verbose.
  11065. (KXMLCore::static_pointer_cast): use adoptRef
  11066. (KXMLCore::const_pointer_cast): use adoptRef
  11067. * kxmlcore/RefPtr.h:
  11068. (KXMLCore::RefPtr::RefPtr): take const PassRefPtr&
  11069. (KXMLCore::PassRefPtr::operator=): take const PassRefPtr&
  11070. 2005-12-25 Eric Seidel <eseidel@apple.com>
  11071. Reviewed by mjs.
  11072. Unbreak HashTableConstIterator++ by returning const_iterator
  11073. * kxmlcore/HashTable.h:
  11074. (KXMLCore::HashTableConstIterator::operator++): use const_iterator
  11075. 2005-12-25 Eric Seidel <eseidel@apple.com>
  11076. Reviewed by mjs.
  11077. Un-break HashTable copy constructor.
  11078. * kxmlcore/HashTable.h:
  11079. (KXMLCore::::HashTable): use const_iterator instead
  11080. 2005-12-23 Maciej Stachowiak <mjs@apple.com>
  11081. Reviewed by Eric.
  11082. - fixed "HashMap does not work with const pointer keys or values"
  11083. http://bugs.webkit.org/show_bug.cgi?id=6222
  11084. * kxmlcore/HashMapPtrSpec.h:
  11085. (KXMLCore::HashMap): In all methods, explicitly cast all pointers
  11086. to void * before passing to internal implementation. Use C-style
  11087. casts instead of new-style casts, because the real solution would
  11088. require a combo of reinterpret_cast anc const_cast.
  11089. 2005-12-23 Maciej Stachowiak <mjs@apple.com>
  11090. - this time for sure
  11091. * kxmlcore/RefPtr.h:
  11092. (KXMLCore::::swap):
  11093. 2005-12-22 Maciej Stachowiak <mjs@apple.com>
  11094. - fix build problem from last commit.
  11095. * kxmlcore/RefPtr.h:
  11096. (KXMLCore::::swap):
  11097. 2005-12-21 Maciej Stachowiak <mjs@apple.com>
  11098. Reviewed by Darin.
  11099. - Make HashMap/HashSet support non-POD types
  11100. http://bugs.webkit.org/show_bug.cgi?id=5332
  11101. The changes for support are relatively simple, but I also made extensive changes to
  11102. avoid copying, so that there isn't refcount thrash when you put RefPtrs into a HashMap.
  11103. * kxmlcore/HashTable.h:
  11104. (KXMLCore::swap): specialize swap for pairs, to swap elements individually,
  11105. so that excess copies can be avoided.
  11106. (KXMLCore::Mover::move): Template function to either copy or swap, used
  11107. when transferring elements from old table to new.
  11108. (KXMLCore::IdentityHashTranslator::hash): The old "converting lookup" templates
  11109. that took two or three function parameters now take a class parameter, this is
  11110. the class used to do a normal lookup.
  11111. (KXMLCore::IdentityHashTranslator::equal): Ditto.
  11112. (KXMLCore::IdentityHashTranslator::translate): Ditto. Translate now takes a reference
  11113. to write into instead of returning a value to avoid redundant copies.
  11114. (KXMLCore::HashTable::~HashTable): Use deallocateTable instead of freeing directly.
  11115. (KXMLCore::HashTable::insert): Based on HashTranslator now instead of separate
  11116. functions. Added a FIXME about a remaining rare excess copy.
  11117. (KXMLCore::HashTable::isEmptyBucket): Use KeyTraits directly instead of unwrapping
  11118. the key from Traits, to avoid creating and destroying pair, which copies.
  11119. (KXMLCore::HashTable::isDeletedBucket): ditto
  11120. (KXMLCore::HashTable::lookup): Use HashTranslator now instead of separate functions.
  11121. (KXMLCore::HashTable::initializeBucket): Renamed from emptyBucket. Use placement new to
  11122. work right for non-POD types.
  11123. (KXMLCore::HashTable::deleteBucket): Use assignDeleted to avoid excess copies.
  11124. (KXMLCore::HashTable::reinsert): use Mover template to copy or swap as appropriate
  11125. (KXMLCore::HashTable::allocateTable): Initialize every bucket if calloc won't do.
  11126. (KXMLCore::HashTable::deallocateTable): Destruct every bucket if needed.
  11127. (KXMLCore::HashTable::rehash): Avoid copy before reinserting, so that swap can do its magic.
  11128. (KXMLCore::HashTable::clear): use deallocateTable instead of freeing directly.
  11129. (KXMLCore::HashTable::HashTable): be more dumb when copying to ensure that non-POD types
  11130. work right
  11131. * kxmlcore/HashFunctions.h:
  11132. (KXMLCore::PointerHash): Specialize PointerHash for RefPtr
  11133. * kxmlcore/HashMap.h:
  11134. (KXMLCore::extractFirst): Return a reference not a full object to avoid
  11135. copies.
  11136. (KXMLCore::HashMapTranslator::hash): Use a special translator for insertion
  11137. to defer making the pair as long as possible, thus avoiding needless copies.
  11138. (KXMLCore::HashMapTranslator::equal): ditto
  11139. (KXMLCore::HashMapTranslator::translate): ditto
  11140. (KXMLCore::::inlineAdd): Shared by set and add to insert using HashMapTranslator
  11141. (KXMLCore::::set): Use inlineAdd
  11142. (KXMLCore::::add): Use inlineAdd
  11143. * kxmlcore/HashMapPtrSpec.h:
  11144. (KXMLCore::): Pass KeyTraits along
  11145. * kxmlcore/HashSet.h:
  11146. (KXMLCore::identityExtract): Return a reference not a full object to avoid copies.
  11147. (KXMLCore::HashSetTranslatorAdapter::hash): Redo adapter stuff to work with
  11148. the new HashTranslator approach.
  11149. (KXMLCore::HashSetTranslatorAdapter::equal): ditto
  11150. (KXMLCore::HashSetTranslatorAdapter::translate): ditto
  11151. (KXMLCore::::insert): ditto
  11152. * kxmlcore/HashTraits.h:
  11153. (KXMLCore::GenericHashTraits): This is intended be used as a base class for
  11154. customized traits: sensible defaults.
  11155. (KXMLCore::): Use it a bunch
  11156. (KXMLCore::assignDeleted): template function to allow pairs to be assigned the
  11157. deleted value w/o excess copies.
  11158. (KXMLCore::PairHashTraits::emptyValue): Updated
  11159. (KXMLCore::PairHashTraits::deletedValue): Updated
  11160. (KXMLCore::PairHashTraits::assignDeletedValue): part of assignDeleted hack
  11161. (KXMLCore::DeletedValueAssigner::assignDeletedValue): Use template magic
  11162. to either use use deletedValue or assignDeletedValue for the cases where we care.
  11163. * kxmlcore/RefPtr.h:
  11164. (KXMLCore::RefPtr::swap): Added swap method.
  11165. (KXMLCore::swap): Added swap free function.
  11166. * kjs/identifier.cpp:
  11167. (KJS::CStringTranslator::hash): Use new HashTranslator class approach to
  11168. alternate type based insertion.
  11169. (KJS::CStringTranslator::equal): ditto
  11170. (KJS::CStringTranslator::translate): ditto
  11171. (KJS::Identifier::add): ditto
  11172. (KJS::UCharBufferTranslator::hash): ditto
  11173. (KJS::UCharBufferTranslator::equal): ditto
  11174. (KJS::UCharBufferTranslator::translate): ditto
  11175. - irrelevant change:
  11176. * kjs/array_object.cpp:
  11177. (ArrayProtoFunc::callAsFunction): Removed a stray space.
  11178. 2005-12-22 Anders Carlsson <andersca@mac.com>
  11179. Reviewed by Eric and Darin.
  11180. - fix http://bugs.webkit.org/show_bug.cgi?id=6196
  11181. Would like to be able to define prototypes in headers
  11182. * kjs/lookup.h:
  11183. Move ClassName from KJS_DECLARE_PROTOTYPE to KJS_IMPLEMENT_PROTOTYPE.
  11184. Also, namespace all macros by prefixing them with KJS_.
  11185. 2005-12-22 Darin Adler <darin@apple.com>
  11186. Reviewed by Maciej.
  11187. - fix http://bugs.webkit.org/show_bug.cgi?id=6191
  11188. RefPtr/PassRefPtr have a leak issue, operator== issues
  11189. * kxmlcore/PassRefPtr.h:
  11190. (KXMLCore::PassRefPtr::PassRefPtr): Remove non-template constructor that takes RefPtr
  11191. since the constructor template that takes RefPtr should be sufficient. Add a constructor
  11192. template that takes PassRefPtr&.
  11193. (KXMLCore::PassRefPtr::adopt): Use PassRefPtr_Ref to avoid setting pointer first to
  11194. 0 and then to the pointer.
  11195. (KXMLCore::PassRefPtr::operator=): Added template versions that take PassRefPtr& and
  11196. RefPtr parameters.
  11197. (KXMLCore::PassRefPtr::operator PassRefPtr<U>): Changed to fix leak -- old version
  11198. would release and then ref.
  11199. (KXMLCore::operator==): Make templates have two parameters so you can mix types.
  11200. Also remove unneeded const in raw pointer versions.
  11201. (KXMLCore::operator!=): Ditto.
  11202. * kxmlcore/RefPtr.h:
  11203. (KXMLCore::RefPtr::RefPtr): Add constructor template that takes PassRefPtr.
  11204. (KXMLCore::RefPtr::operator=): Add assignment operator templates that take
  11205. RefPtr and PassRefPtr.
  11206. (KXMLCore::operator==): Make templates have two parameters so you can mix types.
  11207. Also remove unneeded const in raw pointer versions.
  11208. (KXMLCore::operator!=): Ditto.
  11209. 2005-12-21 Timothy Hatcher <timothy@apple.com>
  11210. * JavaScriptCore.xcodeproj/project.pbxproj:
  11211. Set tab width to 8, indent width to 4 and uses tabs to false per file.
  11212. 2005-12-21 Geoffrey Garen <ggaren@apple.com>
  11213. Reviewed by Darin.
  11214. Removed evil hack for determining if a type is an integer, replaced
  11215. with template metaprogramming.
  11216. * JavaScriptCore.xcodeproj/project.pbxproj: Set tab size to 2 for
  11217. testkjs.cpp
  11218. * kjs/testkjs.cpp:
  11219. (main): Inserted asserts to test IsInteger. FIXME: Move these to
  11220. KXMLCore unit tests directory when we create one.
  11221. * kxmlcore/HashTraits.h:
  11222. (KXMLCore::): Added IsInteger class for querying types.
  11223. 2005-12-20 Maciej Stachowiak <mjs@apple.com>
  11224. Reviewed by Darin.
  11225. - made ALWAYS_INLINE declare things inline as well as __attribute__((always_inline))
  11226. http://bugs.webkit.org/show_bug.cgi?id=6159
  11227. * kxmlcore/AlwaysInline.h:
  11228. 2005-12-19 Maciej Stachowiak <mjs@apple.com>
  11229. Reviewed by Darin.
  11230. - fixed a leak in the assignment operator from PassRefPtr to RefPtr
  11231. http://bugs.webkit.org/show_bug.cgi?id=6158
  11232. * kxmlcore/RefPtr.h:
  11233. (KXMLCore::RefPtr::operator=):
  11234. - fix problem with PassRefPtr that darin spotted - it lacked a copy constructor
  11235. and therefore was using the default one, which can lead to excess derefs
  11236. I fixed this by adding a copy constructor from non-const
  11237. reference, and by adding a template pass() function that you have
  11238. to use when raw pointer or RefPtr are passed where PassRefPtr is
  11239. expected.
  11240. * kjs/identifier.cpp:
  11241. (KJS::Identifier::add): Changed to have PassRefPtr return type and
  11242. pass() the results.
  11243. * kjs/identifier.h:
  11244. * kjs/property_map.cpp:
  11245. (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Use pass()
  11246. where required.
  11247. * kjs/ustring.cpp:
  11248. (KJS::UString::UString): Use pass() as needed.
  11249. (KJS::UString::append): ditto
  11250. (KJS::UString::substr): ditto
  11251. * kjs/ustring.h:
  11252. (KJS::UString::UString): Use initializer instead of assignment
  11253. * kxmlcore/PassRefPtr.h:
  11254. (KXMLCore::PassRefPtr::PassRefPtr): Added copy constructor
  11255. (KXMLCore::pass): new template function to make it convenient to pass
  11256. a PassRefPtr
  11257. 2005-12-19 Geoffrey Garen <ggaren@apple.com>
  11258. Reviewed by Maciej.
  11259. Fixed <rdar://problem/4370397> Missing return statement in
  11260. JSMethodNameToObjcMethodName.
  11261. JSMethodNameToObjcMethodName had a check for a name being too long, but
  11262. the check was missing a return statement.
  11263. A lot of this code was confusing and some of it was wrong, so I fixed
  11264. it up, added some asserts to catch this type of bug in the future,
  11265. changed some comments, and renamed some variables.
  11266. The two advantages of the new algorithm are (1) It makes writing past
  11267. the end of the buffer virtually impossible because the test on the main
  11268. loop is "while (not past end of buffer)" and (2) It's twice as fast
  11269. because it doesn't call strlen. (There's no need to call strlen when
  11270. we're walking the string ourselves.)
  11271. methodsNamed also supports arbitrary-length method names now. Just in
  11272. case the AppKit folks start getting REALLY verbose...
  11273. * bindings/objc/objc_class.mm:
  11274. (KJS::Bindings::ObjcClass::methodsNamed):
  11275. * bindings/objc/objc_utility.h:
  11276. * bindings/objc/objc_utility.mm:
  11277. (KJS::Bindings::JSMethodNameToObjcMethodName):
  11278. 2005-12-19 Darin Adler <darin@apple.com>
  11279. Originally done by both George Staikos and Alexey Proskuryakov.
  11280. - fix http://bugs.webkit.org/show_bug.cgi?id=5706
  11281. Sharedptr dependency can be removed
  11282. Our coding guidelines say "use 0 instead of NULL" and both RefPtr and
  11283. PassRefPtr were using NULL, which required including a header that
  11284. defines NULL.
  11285. * kxmlcore/PassRefPtr.h:
  11286. (KXMLCore::PassRefPtr::PassRefPtr): Use 0 instead of NULL.
  11287. (KXMLCore::PassRefPtr::operator!): Use ! instead of == NULL.
  11288. * kxmlcore/RefPtr.h:
  11289. (KXMLCore::RefPtr::RefPtr): Use 0 instead of NULL.
  11290. (KXMLCore::RefPtr::operator!): Use ! instead of == NULL.
  11291. Also did some reformatting.
  11292. 2005-12-19 Darin Adler <darin@apple.com>
  11293. Reviewed by Geoff Garen and Eric Seidel.
  11294. - fix http://bugs.webkit.org/show_bug.cgi?id=4923
  11295. stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
  11296. * kjs/simple_number.h: Removed many unnecessary includes, including
  11297. the <cmath> one to work around GCC library header bugs. We may have to
  11298. add some includes elsewhere for platforms other than OS X, since our
  11299. prefix header takes care of some things.
  11300. * kxmlcore/AlwaysInline.h: Added. Now clients that don't include
  11301. simple_number.h can still get the ALWAYS_INLINE macro.
  11302. * JavaScriptCore.xcodeproj/project.pbxproj: Added AlwaysInline.h.
  11303. * bindings/NP_jsobject.h: Removed a lot of unnecessary includes
  11304. and removed C-specific stuff from this C++-only header.
  11305. * bindings/jni/jni_jsobject.h: Removed a lot of unnecessary includes
  11306. and did some reformatting.
  11307. * bindings/objc/objc_runtime.h: Removed an unnecessary include.
  11308. * bindings/runtime.h: Removed some unneeded includes. Reformatted.
  11309. * bindings/runtime.cpp: Updated to compile with header changes,
  11310. including a lot of reformatting.
  11311. * bindings/runtime_object.h: Removed an unnecessary include.
  11312. 2005-12-13 Maciej Stachowiak <mjs@apple.com>
  11313. Reviewed by Geoff and Adele
  11314. - replaced custom Identifier hashtable with HashSet
  11315. * kjs/identifier.cpp:
  11316. (KXMLCore::):
  11317. (KJS::identifierTable):
  11318. (KJS::Identifier::equal):
  11319. (KJS::hash):
  11320. (KJS::equal):
  11321. (KJS::convert):
  11322. (KJS::Identifier::add):
  11323. (KJS::Identifier::remove):
  11324. * kjs/identifier.h:
  11325. * kjs/internal.cpp:
  11326. (KJS::InterpreterImp::initGlobalObject):
  11327. 2005-12-18 Justin Haygood <justin@xiondigital.net>
  11328. Reviewed, tweaked, and landed by Darin.
  11329. - fix http://bugs.webkit.org/show_bug.cgi?id=5227
  11330. Array indexOf() extension for JavaScript 1.5 Core
  11331. * kjs/array_object.h:
  11332. * kjs/array_object.cpp: (ArrayProtoFunc::callAsFunction): Added implementation of indexOf.
  11333. 2005-12-18 Anders Carlsson <andersca@mac.com>
  11334. Reviewed by Darin and Geoffrey.
  11335. - fix for <http://bugs.webkit.org/show_bug.cgi?id=4000>
  11336. Object.prototype is missing isPrototypeOf
  11337. * kjs/object_object.cpp:
  11338. (ObjectPrototype::ObjectPrototype):
  11339. Add isPrototypeOf to object prototype.
  11340. (ObjectProtoFunc::callAsFunction):
  11341. Implement isPrototypeOf
  11342. * kjs/object_object.h:
  11343. (KJS::ObjectProtoFunc::):
  11344. Add id for isPrototypeOf.
  11345. 2005-12-17 Geoffrey Garen <ggaren@apple.com>
  11346. Reviewed by Darin.
  11347. Fixed http://bugs.webkit.org/show_bug.cgi?id=6119
  11348. split() function ignores case insensitive modifier.
  11349. Glossary:
  11350. RegExpImp: The C++ object you get when JavaScript executes
  11351. "new RegExp()".
  11352. RegExp: A C++ wrapper object that performs regular expression
  11353. matching on behalf of a RegExpImp.
  11354. Instead of unnecessarily constructing a RegExp which (wrongly) lacks
  11355. any modifiers, String.split() now uses the RegExp built in to the
  11356. RegExpImp passed to it, which has the right modifiers already.
  11357. I also cleaned up other bits of the string code to standardized how
  11358. we handle RegExpImp arguments.
  11359. * ChangeLog:
  11360. * kjs/string_object.cpp:
  11361. (replace):
  11362. (StringProtoFunc::callAsFunction):
  11363. 2005-12-16 David Hyatt <hyatt@apple.com>
  11364. Remove unused RefPtr constructors that can create an ambiguity in ustring on some platforms.
  11365. Reviewed by mjs
  11366. * kxmlcore/RefPtr.h:
  11367. (KXMLCore::RefPtr::RefPtr):
  11368. 2005-12-15 Darin Adler <darin@apple.com>
  11369. Reviewed by Maciej.
  11370. - fix http://bugs.webkit.org/show_bug.cgi?id=5688
  11371. speed up JavaScript parsing by not creating a UString just to parse
  11372. * kjs/internal.h:
  11373. * kjs/internal.cpp: (KJS::InterpreterImp::evaluate): Change to take a character pointer
  11374. and length rather than a UString.
  11375. * kjs/interpreter.h:
  11376. * kjs/interpreter.cpp: (Interpreter::evaluate): Ditto.
  11377. * kjs/protect.h: Remove uneeded "convert to bool" operator since we already have a
  11378. "convert to raw pointer" operator in this class.
  11379. === Safari-521~5 ===
  11380. 2005-12-13 Geoffrey Garen <ggaren@apple.com>
  11381. Updated test results to match Anders's last fix.
  11382. * tests/mozilla/expected.html:
  11383. 2005-12-13 Anders Carlsson <andersca@mac.com>
  11384. * ChangeLog: Add titles for my bugzilla bugs.
  11385. 2005-12-13 Anders Carlsson <andersca@mac.com>
  11386. Reviewed by Darin.
  11387. - Fixes <http://bugs.webkit.org/show_bug.cgi?id=6041>
  11388. Support property getters and setters.
  11389. * bindings/runtime_array.cpp:
  11390. (RuntimeArray::lengthGetter):
  11391. (RuntimeArray::indexGetter):
  11392. * bindings/runtime_array.h:
  11393. * bindings/runtime_method.cpp:
  11394. (RuntimeMethod::lengthGetter):
  11395. * bindings/runtime_method.h:
  11396. * bindings/runtime_object.cpp:
  11397. (RuntimeObjectImp::fallbackObjectGetter):
  11398. (RuntimeObjectImp::fieldGetter):
  11399. (RuntimeObjectImp::methodGetter):
  11400. * bindings/runtime_object.h:
  11401. * kjs/array_instance.h:
  11402. * kjs/array_object.cpp:
  11403. (ArrayInstance::lengthGetter):
  11404. (getProperty):
  11405. Update for changes to PropertySlot::getValue and
  11406. PropertySlot::GetValueFunc.
  11407. * kjs/collector.cpp:
  11408. (KJS::className):
  11409. Handle GetterSetterType.
  11410. * kjs/function.cpp:
  11411. (KJS::FunctionImp::argumentsGetter):
  11412. (KJS::FunctionImp::lengthGetter):
  11413. (KJS::Arguments::mappedIndexGetter):
  11414. (KJS::ActivationImp::argumentsGetter):
  11415. * kjs/function.h:
  11416. Update for changes to PropertySlot::getValue and
  11417. PropertySlot::GetValueFunc.
  11418. * kjs/grammar.y:
  11419. Rework grammar parts for get set declarations directly
  11420. in the object literal.
  11421. * kjs/internal.cpp:
  11422. (KJS::GetterSetterImp::mark):
  11423. (KJS::GetterSetterImp::toPrimitive):
  11424. (KJS::GetterSetterImp::toBoolean):
  11425. (KJS::GetterSetterImp::toNumber):
  11426. (KJS::GetterSetterImp::toString):
  11427. (KJS::GetterSetterImp::toObject):
  11428. Add type conversion functions. These aren't meant to be called.
  11429. (KJS::printInfo):
  11430. Handle GetterSetterType.
  11431. * kjs/lookup.h:
  11432. (KJS::staticFunctionGetter):
  11433. (KJS::staticValueGetter):
  11434. Update for changes to PropertySlot::GetValueFunc.
  11435. * kjs/nodes.cpp:
  11436. Refactor they way properties nodes are implemented.
  11437. We now have a PropertyListNode which is a list of PropertyNodes.
  11438. Each PropertyNode has a name (which is a PropertyNameNode) and an associated
  11439. value node. PropertyNodes can be of different types. The Constant type is the
  11440. old constant declaration and the Getter and Setter types are for property getters
  11441. and setters.
  11442. (ResolveNode::evaluate):
  11443. Update for changes to PropertySlot::getValue.
  11444. (PropertyListNode::evaluate):
  11445. Go through all property nodes and set them on the newly created object. If the
  11446. property nodes are of type Getter or Setter, define getters and setters. Otherwise,
  11447. just add the properties like before.
  11448. (PropertyNode::evaluate):
  11449. This should never be called directly.
  11450. (PropertyNameNode::evaluate):
  11451. Rename from PropertyNode::evaluate.
  11452. (FunctionCallResolveNode::evaluate):
  11453. (FunctionCallBracketNode::evaluate):
  11454. (FunctionCallDotNode::evaluate):
  11455. (PostfixResolveNode::evaluate):
  11456. (PostfixBracketNode::evaluate):
  11457. (PostfixDotNode::evaluate):
  11458. (TypeOfResolveNode::evaluate):
  11459. (PrefixResolveNode::evaluate):
  11460. (PrefixBracketNode::evaluate):
  11461. (PrefixDotNode::evaluate):
  11462. (AssignResolveNode::evaluate):
  11463. (AssignDotNode::evaluate):
  11464. (AssignBracketNode::evaluate):
  11465. Update for changes to PropertySlot::getValue.
  11466. * kjs/nodes.h:
  11467. (KJS::PropertyNameNode::PropertyNameNode):
  11468. Rename from PropertyNode.
  11469. (KJS::PropertyNode::):
  11470. (KJS::PropertyNode::PropertyNode):
  11471. New class, representing a single property.
  11472. (KJS::PropertyListNode::PropertyListNode):
  11473. Rename from PropertyValueNode.
  11474. (KJS::FuncExprNode::FuncExprNode):
  11475. Put ParameterNode parameter last, and make it optional.
  11476. (KJS::ObjectLiteralNode::ObjectLiteralNode):
  11477. Use a PropertyListNode here now.
  11478. * kjs/nodes2string.cpp:
  11479. (PropertyListNode::streamTo):
  11480. Iterate through all property nodes.
  11481. (PropertyNode::streamTo):
  11482. Print out the name and value. Doesn't handle getters and setters currently.
  11483. (PropertyNameNode::streamTo):
  11484. Rename from PropertyNode::streamTo.
  11485. * kjs/object.cpp:
  11486. (KJS::JSObject::get):
  11487. Update for changes to PropertySlot::getValue.
  11488. (KJS::JSObject::put):
  11489. If the property already exists and has a Setter, invoke
  11490. the setter function instead of setting the property directly.
  11491. (KJS::JSObject::defineGetter):
  11492. (KJS::JSObject::defineSetter):
  11493. New functions for defining property getters and setters on the object.
  11494. * kjs/object.h:
  11495. (KJS::GetterSetterImp::type):
  11496. (KJS::GetterSetterImp::GetterSetterImp):
  11497. (KJS::GetterSetterImp::getGetter):
  11498. (KJS::GetterSetterImp::setGetter):
  11499. (KJS::GetterSetterImp::getSetter):
  11500. (KJS::GetterSetterImp::setSetter):
  11501. New class for properties which have getters and setters defined.
  11502. This class is only used internally and should never be seen from the outside.
  11503. (KJS::JSObject::getOwnPropertySlot):
  11504. If the property is a getter, call setGetterSlot on the property slot.
  11505. * kjs/object_object.cpp:
  11506. (ObjectPrototype::ObjectPrototype):
  11507. Add __defineGetter__, __defineSetter, __lookupGetter__, __lookupSetter__
  11508. to prototype.
  11509. (ObjectProtoFunc::callAsFunction):
  11510. Implement handlers for new functions.
  11511. * kjs/object_object.h:
  11512. (KJS::ObjectProtoFunc::):
  11513. Add ids for new functions.
  11514. * kjs/property_slot.cpp:
  11515. (KJS::PropertySlot::undefinedGetter):
  11516. Update for changes to PropertySlot::GetValueFunc.
  11517. (KJS::PropertySlot::functionGetter):
  11518. Call the function getter object and return its value.
  11519. * kjs/property_slot.h:
  11520. (KJS::PropertySlot::getValue):
  11521. Add a new argument which is the original object that
  11522. getPropertySlot was called on.
  11523. (KJS::PropertySlot::setGetterSlot):
  11524. (KJS::PropertySlot::):
  11525. New function which sets a getter slot. When getValue is called on a
  11526. getter slot, the getter function object is invoked.
  11527. * kjs/string_object.cpp:
  11528. (StringInstance::lengthGetter):
  11529. (StringInstance::indexGetter):
  11530. * kjs/string_object.h:
  11531. Update for changes to PropertySlot::GetValueFunc.
  11532. * kjs/value.h:
  11533. (KJS::):
  11534. Add GetterSetterType and make GetterSetterImp a friend class of JSCell.
  11535. 2005-12-12 Maciej Stachowiak <mjs@apple.com>
  11536. Reviewed by Eric.
  11537. - added a new HashCountedSet class for the common pattern of mapping items to counts that can change
  11538. * kxmlcore/HashCountedSet.h: Added.
  11539. (KXMLCore::HashCountedSet::*): Implemented, on top of HashMap.
  11540. * kxmlcore/HashMap.h:
  11541. (KXMLCore::HashMap::add): New method - does not replace existing value if key already present
  11542. but otherwise like set().
  11543. (KXMLCore::HashMap::set): Improved comments.
  11544. * kxmlcore/HashMapPtrSpec.h:
  11545. (KXMLCore::HashMap::add): Added to specializations too.
  11546. * JavaScriptCore.xcodeproj/project.pbxproj: Add new file.
  11547. * kxmlcore/HashFunctions.h: Added include of stdint.h
  11548. - replaced the custom hashtable for values protected from GC with HashCountedSet
  11549. * kjs/collector.cpp:
  11550. (KJS::Collector::protect): Moved code here from ProtectedValues::increaseProtectCount
  11551. since the code is so simple now.
  11552. (KJS::Collector::unprotect): Ditto for ProtectedValues::decreaseProtectCount.
  11553. (KJS::Collector::markProtectedObjects): Updated for new way of doing things, now
  11554. simpler and safer.
  11555. (KJS::Collector::numReferencedObjects): ditto
  11556. (KJS::Collector::rootObjectClasses): ditto
  11557. * kjs/collector.h: Added protect and unprotect static methods
  11558. * kjs/protect.h:
  11559. (KJS::gcProtect): Updated for removal of ProtectedValues class
  11560. (KJS::gcUnprotect): likewise
  11561. * kjs/protected_values.cpp: Removed.
  11562. * kjs/protected_values.h: Removed.
  11563. 2005-12-10 Darin Adler <darin@apple.com>
  11564. Rubber stamped by Maciej.
  11565. - did long-promised KJS renaming:
  11566. ValueImp -> JSValue
  11567. ObjectImp -> JSObject
  11568. AllocatedValueImp -> JSCell
  11569. A renaming to get a class out of the way
  11570. KJS::Bindings::JSObject -> JavaJSObject
  11571. and some other "imp-reduction" renaming
  11572. *InstanceImp -> *Instance
  11573. *ProtoFuncImp -> *ProtoFunc
  11574. *PrototypeImp -> *Prototype
  11575. ArgumentsImp -> Arguments
  11576. RuntimeArrayImp -> RuntimeArray
  11577. RuntimeMethodImp -> RuntimeMethod
  11578. * most files and functions
  11579. 2005-12-10 Darin Adler <darin@apple.com>
  11580. Reviewed by Maciej.
  11581. - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
  11582. Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().
  11583. * bindings/NP_jsobject.cpp:
  11584. (_NPN_Evaluate):
  11585. * bindings/c/c_instance.cpp:
  11586. (KJS::Bindings::CInstance::invokeMethod):
  11587. (KJS::Bindings::CInstance::invokeDefaultMethod):
  11588. * bindings/c/c_runtime.cpp:
  11589. (CField::valueFromInstance):
  11590. * bindings/c/c_utility.cpp:
  11591. (KJS::Bindings::convertNPVariantToValue):
  11592. * bindings/jni/jni_instance.cpp:
  11593. (JavaInstance::invokeMethod):
  11594. (JavaInstance::invokeDefaultMethod):
  11595. * bindings/jni/jni_jsobject.cpp:
  11596. (JSObject::eval):
  11597. (JSObject::convertJObjectToValue):
  11598. * bindings/jni/jni_runtime.cpp:
  11599. (JavaArray::convertJObjectToArray):
  11600. (JavaField::valueFromInstance):
  11601. (JavaArray::valueAt):
  11602. * bindings/objc/WebScriptObject.mm:
  11603. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  11604. (-[WebScriptObject evaluateWebScript:]):
  11605. (-[WebScriptObject valueForKey:]):
  11606. (-[WebScriptObject webScriptValueAtIndex:]):
  11607. * bindings/objc/objc_instance.mm:
  11608. (ObjcInstance::invokeMethod):
  11609. (ObjcInstance::invokeDefaultMethod):
  11610. (ObjcInstance::getValueOfUndefinedField):
  11611. * bindings/objc/objc_runtime.mm:
  11612. (ObjcField::valueFromInstance):
  11613. (ObjcFallbackObjectImp::callAsFunction):
  11614. * bindings/objc/objc_utility.mm:
  11615. (KJS::Bindings::convertNSStringToString):
  11616. (KJS::Bindings::convertObjcValueToValue):
  11617. * bindings/runtime.h:
  11618. (KJS::Bindings::Class::fallbackObject):
  11619. (KJS::Bindings::Instance::getValueOfUndefinedField):
  11620. (KJS::Bindings::Instance::valueOf):
  11621. * bindings/runtime_array.cpp:
  11622. (RuntimeArrayImp::lengthGetter):
  11623. * bindings/runtime_method.cpp:
  11624. (RuntimeMethodImp::lengthGetter):
  11625. (RuntimeMethodImp::callAsFunction):
  11626. (RuntimeMethodImp::execute):
  11627. * kjs/array_object.cpp:
  11628. (ArrayInstanceImp::lengthGetter):
  11629. (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
  11630. (ArrayPrototypeImp::ArrayPrototypeImp):
  11631. (ArrayProtoFuncImp::ArrayProtoFuncImp):
  11632. (ArrayProtoFuncImp::callAsFunction):
  11633. (ArrayObjectImp::ArrayObjectImp):
  11634. * kjs/bool_object.cpp:
  11635. (BooleanPrototypeImp::BooleanPrototypeImp):
  11636. (BooleanProtoFuncImp::callAsFunction):
  11637. (BooleanObjectImp::BooleanObjectImp):
  11638. (BooleanObjectImp::callAsFunction):
  11639. * kjs/error_object.cpp:
  11640. (ErrorPrototypeImp::ErrorPrototypeImp):
  11641. (ErrorProtoFuncImp::ErrorProtoFuncImp):
  11642. (ErrorProtoFuncImp::callAsFunction):
  11643. (ErrorObjectImp::ErrorObjectImp):
  11644. (NativeErrorImp::NativeErrorImp):
  11645. * kjs/function.cpp:
  11646. (KJS::FunctionImp::callAsFunction):
  11647. (KJS::FunctionImp::processParameters):
  11648. (KJS::FunctionImp::argumentsGetter):
  11649. (KJS::FunctionImp::lengthGetter):
  11650. (KJS::DeclaredFunctionImp::execute):
  11651. (KJS::encode):
  11652. (KJS::decode):
  11653. (KJS::GlobalFuncImp::callAsFunction):
  11654. * kjs/function_object.cpp:
  11655. (FunctionPrototypeImp::FunctionPrototypeImp):
  11656. (FunctionPrototypeImp::callAsFunction):
  11657. (FunctionProtoFuncImp::callAsFunction):
  11658. (FunctionObjectImp::FunctionObjectImp):
  11659. * kjs/internal.cpp:
  11660. (KJS::InterpreterImp::initGlobalObject):
  11661. * kjs/interpreter.h:
  11662. * kjs/lookup.h:
  11663. * kjs/math_object.cpp:
  11664. (MathObjectImp::getValueProperty):
  11665. (MathFuncImp::callAsFunction):
  11666. * kjs/nodes.cpp:
  11667. (Node::setExceptionDetailsIfNeeded):
  11668. (NullNode::evaluate):
  11669. (PropertyNode::evaluate):
  11670. (FunctionCallBracketNode::evaluate):
  11671. (FunctionCallDotNode::evaluate):
  11672. (PostfixBracketNode::evaluate):
  11673. (PostfixDotNode::evaluate):
  11674. (VoidNode::evaluate):
  11675. (PrefixBracketNode::evaluate):
  11676. (PrefixDotNode::evaluate):
  11677. (ShiftNode::evaluate):
  11678. (valueForReadModifyAssignment):
  11679. (AssignDotNode::evaluate):
  11680. (AssignBracketNode::evaluate):
  11681. (VarDeclNode::evaluate):
  11682. (VarDeclNode::processVarDecls):
  11683. (VarDeclListNode::evaluate):
  11684. (ReturnNode::execute):
  11685. (CaseClauseNode::evalStatements):
  11686. (ParameterNode::evaluate):
  11687. (FuncDeclNode::processFuncDecl):
  11688. * kjs/nodes.h:
  11689. (KJS::StatementNode::evaluate):
  11690. * kjs/number_object.cpp:
  11691. (NumberPrototypeImp::NumberPrototypeImp):
  11692. (NumberProtoFuncImp::callAsFunction):
  11693. (NumberObjectImp::NumberObjectImp):
  11694. (NumberObjectImp::getValueProperty):
  11695. (NumberObjectImp::callAsFunction):
  11696. * kjs/object.cpp:
  11697. (KJS::ObjectImp::get):
  11698. (KJS::Error::create):
  11699. * kjs/object_object.cpp:
  11700. (ObjectPrototypeImp::ObjectPrototypeImp):
  11701. (ObjectProtoFuncImp::callAsFunction):
  11702. (ObjectObjectImp::ObjectObjectImp):
  11703. * kjs/property_slot.cpp:
  11704. (KJS::PropertySlot::undefinedGetter):
  11705. * kjs/regexp_object.cpp:
  11706. (RegExpPrototypeImp::RegExpPrototypeImp):
  11707. (RegExpProtoFuncImp::callAsFunction):
  11708. (RegExpObjectImp::RegExpObjectImp):
  11709. (RegExpObjectImp::arrayOfMatches):
  11710. (RegExpObjectImp::getBackref):
  11711. (RegExpObjectImp::getLastMatch):
  11712. (RegExpObjectImp::getLastParen):
  11713. (RegExpObjectImp::getLeftContext):
  11714. (RegExpObjectImp::getRightContext):
  11715. (RegExpObjectImp::getValueProperty):
  11716. (RegExpObjectImp::construct):
  11717. * kjs/string_object.cpp:
  11718. (StringInstanceImp::StringInstanceImp):
  11719. (StringPrototypeImp::StringPrototypeImp):
  11720. (replace):
  11721. (StringProtoFuncImp::callAsFunction):
  11722. (StringObjectImp::StringObjectImp):
  11723. (StringObjectImp::callAsFunction):
  11724. (StringObjectFuncImp::StringObjectFuncImp):
  11725. (StringObjectFuncImp::callAsFunction):
  11726. * kjs/testkjs.cpp:
  11727. (TestFunctionImp::callAsFunction):
  11728. (VersionFunctionImp::callAsFunction):
  11729. * kjs/value.h:
  11730. 2005-12-10 Oliver Hunt <ojh16@student.canterbury.ac.nz>
  11731. Reviewed by Maciej, landed by Darin.
  11732. - fix http://bugs.webkit.org/show_bug.cgi?id=3539
  11733. Array join and toString methods do not support circular references
  11734. * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction):
  11735. Added set of visited objects -- don't recurse if item is already in the set.
  11736. 2005-12-08 Maciej Stachowiak <mjs@apple.com>
  11737. Reviewed by John.
  11738. - fix major memory leak and resultant slowdown on JavaScript iBench from
  11739. my PassRefPtr changes
  11740. * kjs/ustring.cpp:
  11741. (KJS::UString::Rep::create): I forgot to change one of the two overloads to create
  11742. with a refcount of 0 instead of 1 (the smart pointer then bumps it. But instead of
  11743. changing it, I changed both to start with a refcounter of 1 and use PassRefPtr::adopt
  11744. to adopt the initial refcount, this may be a hair more efficient.
  11745. - made the assignment operators for smart pointers inline because Shark said so
  11746. * kxmlcore/PassRefPtr.h:
  11747. (KXMLCore::::operator=):
  11748. * kxmlcore/RefPtr.h:
  11749. (KXMLCore::::operator=):
  11750. 2005-12-06 Anders Carlsson <andersca@mac.com>
  11751. Reviewed by Darin.
  11752. - fix build when using gcc 4
  11753. * kjs/ustring.h:
  11754. Make Rep public.
  11755. * kxmlcore/PassRefPtr.h:
  11756. (KXMLCore::::operator):
  11757. Fix a typo.
  11758. 2005-12-05 Maciej Stachowiak <mjs@apple.com>
  11759. Reviewed by Eric.
  11760. - add PassRefPtr, a smart pointer class that works in conjunction
  11761. with RefPtr but has transfer-of-ownership semantics
  11762. - apply RefPtr and PassRefPtr to UString
  11763. - cleaned up UString a little so that it doesn't need to have so many friend classes
  11764. * JavaScriptCore.xcodeproj/project.pbxproj:
  11765. * kjs/identifier.cpp:
  11766. (KJS::Identifier::add):
  11767. * kjs/identifier.h:
  11768. (KJS::Identifier::Identifier):
  11769. (KJS::Identifier::equal):
  11770. * kjs/property_map.cpp:
  11771. (KJS::PropertyMap::get):
  11772. (KJS::PropertyMap::getLocation):
  11773. (KJS::PropertyMap::put):
  11774. (KJS::PropertyMap::remove):
  11775. * kjs/ustring.cpp:
  11776. (KJS::UCharReference::operator=):
  11777. (KJS::UCharReference::ref):
  11778. (KJS::UString::Rep::createCopying):
  11779. (KJS::UString::Rep::create):
  11780. (KJS::UString::usedCapacity):
  11781. (KJS::UString::usedPreCapacity):
  11782. (KJS::UString::expandCapacity):
  11783. (KJS::UString::expandPreCapacity):
  11784. (KJS::UString::UString):
  11785. (KJS::UString::spliceSubstringsWithSeparators):
  11786. (KJS::UString::append):
  11787. (KJS::UString::operator=):
  11788. (KJS::UString::toStrictUInt32):
  11789. (KJS::UString::substr):
  11790. (KJS::UString::copyForWriting):
  11791. (KJS::operator==):
  11792. * kjs/ustring.h:
  11793. (KJS::UString::UString):
  11794. (KJS::UString::~UString):
  11795. (KJS::UString::data):
  11796. (KJS::UString::isNull):
  11797. (KJS::UString::isEmpty):
  11798. (KJS::UString::size):
  11799. (KJS::UString::rep):
  11800. * kxmlcore/RefPtr.h:
  11801. (KXMLCore::RefPtr::RefPtr):
  11802. (KXMLCore::RefPtr::operator*):
  11803. (KXMLCore::::operator):
  11804. (KXMLCore::operator==):
  11805. (KXMLCore::operator!=):
  11806. (KXMLCore::static_pointer_cast):
  11807. (KXMLCore::const_pointer_cast):
  11808. 2005-12-04 Geoffrey Garen <ggaren@apple.com>
  11809. Update test results to match Anders's last checkin.
  11810. * tests/mozilla/expected.html:
  11811. 2005-12-04 Anders Carlsson <andersca@mac.com>
  11812. Reviewed by Geoffrey.
  11813. - Fixes <http://bugs.webkit.org/show_bug.cgi?id=3999>
  11814. Object.prototype is missing propertyIsEnumerable
  11815. * kjs/object.cpp:
  11816. (KJS::ObjectImp::canPut):
  11817. Refactor to use getPropertyAttributes.
  11818. (KJS::ObjectImp::propertyIsEnumerable):
  11819. New function which checks if a property is enumerable.
  11820. (KJS::ObjectImp::getPropertyAttributes):
  11821. * kjs/object.h:
  11822. Add getPropertyAttributes and propertyIsEnumerable.
  11823. * kjs/object_object.cpp:
  11824. (ObjectPrototypeImp::ObjectPrototypeImp):
  11825. (ObjectProtoFuncImp::callAsFunction):
  11826. * kjs/object_object.h:
  11827. (KJS::ObjectProtoFuncImp::):
  11828. Add propertyIsEnumerable to the Object prototype.
  11829. 2005-12-01 Maciej Stachowiak <mjs@apple.com>
  11830. Reviewed by Tim Hatcher.
  11831. - removed deprecated reset, isNull and nonNull methods
  11832. * kxmlcore/RefPtr.h:
  11833. 2005-12-01 Anders Carlsson <andersca@mac.com>
  11834. Reviewed by Darin.
  11835. - Fixes <http://bugs.webkit.org/show_bug.cgi?id=3382>
  11836. nodes2strings.cpp fails to print left expression of ForInNode when 'var' is not used
  11837. Patch by Mark Rowe.
  11838. * kjs/nodes2string.cpp:
  11839. (ForInNode::streamTo):
  11840. Add lexpr if there's no varDecl.
  11841. 2005-12-01 Maciej Stachowiak <mjs@apple.com>
  11842. Rubber stamped by Eric.
  11843. - renamed SharedPtr to RefPtr via script
  11844. * JavaScriptCore.xcodeproj/project.pbxproj:
  11845. * kjs/function.cpp:
  11846. (KJS::GlobalFuncImp::callAsFunction):
  11847. * kjs/function.h:
  11848. * kjs/function_object.cpp:
  11849. (FunctionObjectImp::construct):
  11850. * kjs/internal.cpp:
  11851. (KJS::Parser::parse):
  11852. (KJS::InterpreterImp::checkSyntax):
  11853. (KJS::InterpreterImp::evaluate):
  11854. * kjs/internal.h:
  11855. * kjs/nodes.h:
  11856. * kjs/nodes2string.cpp:
  11857. (KJS::SourceStream::operator<<):
  11858. * kjs/protect.h:
  11859. * kxmlcore/RefPtr.h: Added.
  11860. (KXMLCore::RefPtr::RefPtr):
  11861. (KXMLCore::RefPtr::~RefPtr):
  11862. (KXMLCore::RefPtr::isNull):
  11863. (KXMLCore::RefPtr::notNull):
  11864. (KXMLCore::RefPtr::reset):
  11865. (KXMLCore::RefPtr::get):
  11866. (KXMLCore::RefPtr::operator*):
  11867. (KXMLCore::RefPtr::operator->):
  11868. (KXMLCore::RefPtr::operator!):
  11869. (KXMLCore::RefPtr::operator UnspecifiedBoolType):
  11870. (KXMLCore::::operator):
  11871. (KXMLCore::operator==):
  11872. (KXMLCore::operator!=):
  11873. (KXMLCore::static_pointer_cast):
  11874. (KXMLCore::const_pointer_cast):
  11875. * kxmlcore/SharedPtr.h: Removed.
  11876. 2005-11-30 Maciej Stachowiak <mjs@apple.com>
  11877. Reviewed by Dave Hyatt.
  11878. - change idiom used for implicit bool conversion of smart pointers, because the old one gives weird error messages sometimes
  11879. * kjs/protect.h:
  11880. (KJS::ProtectedPtr::operator UnspecifiedBoolType):
  11881. * kxmlcore/SharedPtr.h:
  11882. (KXMLCore::SharedPtr::operator UnspecifiedBoolType):
  11883. 2005-11-29 Mitz Pettel <opendarwin.org@mitzpettel.com>
  11884. Reviewed by ggaren. Committed by eseidel.
  11885. Date conversion to local time gets the DST flag wrong sometimes
  11886. http://bugs.webkit.org/show_bug.cgi?id=5514
  11887. * kjs/date_object.cpp:
  11888. (KJS::isTime_tSigned):
  11889. (KJS::DateProtoFuncImp::callAsFunction):
  11890. 2005-11-26 Maciej Stachowiak <mjs@apple.com>
  11891. Rubber stamped by Eric.
  11892. - renamed InterpreterLock to JSLock
  11893. * bindings/NP_jsobject.cpp:
  11894. (_NPN_Invoke):
  11895. (_NPN_Evaluate):
  11896. (_NPN_GetProperty):
  11897. (_NPN_SetProperty):
  11898. (_NPN_RemoveProperty):
  11899. (_NPN_HasProperty):
  11900. (_NPN_HasMethod):
  11901. (_NPN_SetException):
  11902. * bindings/jni/jni_jsobject.cpp:
  11903. (JSObject::call):
  11904. (JSObject::eval):
  11905. (JSObject::getMember):
  11906. (JSObject::setMember):
  11907. (JSObject::removeMember):
  11908. (JSObject::getSlot):
  11909. (JSObject::setSlot):
  11910. (JSObject::toString):
  11911. (JSObject::convertJObjectToValue):
  11912. * bindings/objc/WebScriptObject.mm:
  11913. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  11914. (-[WebScriptObject evaluateWebScript:]):
  11915. (-[WebScriptObject setValue:forKey:]):
  11916. (-[WebScriptObject valueForKey:]):
  11917. (-[WebScriptObject removeWebScriptKey:]):
  11918. (-[WebScriptObject stringRepresentation]):
  11919. (-[WebScriptObject webScriptValueAtIndex:]):
  11920. (-[WebScriptObject setWebScriptValueAtIndex:value:]):
  11921. (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
  11922. * bindings/runtime.cpp:
  11923. (Instance::createRuntimeObject):
  11924. * bindings/runtime_root.cpp:
  11925. (KJS::Bindings::addNativeReference):
  11926. (KJS::Bindings::removeNativeReference):
  11927. (RootObject::removeAllNativeReferences):
  11928. * bindings/runtime_root.h:
  11929. (KJS::Bindings::RootObject::~RootObject):
  11930. (KJS::Bindings::RootObject::setRootObjectImp):
  11931. * bindings/testbindings.cpp:
  11932. (main):
  11933. * bindings/testbindings.mm:
  11934. (main):
  11935. * kjs/JSLock.cpp:
  11936. (KJS::initializeJSLock):
  11937. (KJS::JSLock::lock):
  11938. (KJS::JSLock::unlock):
  11939. (KJS::JSLock::lockCount):
  11940. (KJS::JSLock::DropAllLocks::DropAllLocks):
  11941. (KJS::JSLock::DropAllLocks::~DropAllLocks):
  11942. * kjs/JSLock.h:
  11943. (KJS::JSLock::JSLock):
  11944. (KJS::JSLock::~JSLock):
  11945. * kjs/collector.cpp:
  11946. (KJS::Collector::allocate):
  11947. (KJS::Collector::collect):
  11948. * kjs/internal.cpp:
  11949. (KJS::InterpreterImp::InterpreterImp):
  11950. (KJS::InterpreterImp::clear):
  11951. (KJS::InterpreterImp::checkSyntax):
  11952. (KJS::InterpreterImp::evaluate):
  11953. * kjs/interpreter.cpp:
  11954. (Interpreter::evaluate):
  11955. * kjs/protect.h:
  11956. (KJS::::ProtectedPtr):
  11957. (KJS::::~ProtectedPtr):
  11958. (KJS::::operator):
  11959. * kjs/protected_reference.h:
  11960. (KJS::ProtectedReference::ProtectedReference):
  11961. (KJS::ProtectedReference::~ProtectedReference):
  11962. (KJS::ProtectedReference::operator=):
  11963. * kjs/protected_values.cpp:
  11964. (KJS::ProtectedValues::getProtectCount):
  11965. (KJS::ProtectedValues::increaseProtectCount):
  11966. (KJS::ProtectedValues::decreaseProtectCount):
  11967. * kjs/testkjs.cpp:
  11968. (TestFunctionImp::callAsFunction):
  11969. (main):
  11970. 2005-11-26 Darin Adler <darin@apple.com>
  11971. Reviewed by eseidel. Committed by eseidel.
  11972. Inline ScopeChain functions for speed.
  11973. http://bugs.webkit.org/show_bug.cgi?id=5687
  11974. * kjs/object.h:
  11975. (KJS::ScopeChain::mark):
  11976. * kjs/scope_chain.cpp:
  11977. * kjs/scope_chain.h:
  11978. (KJS::ScopeChain::ref):
  11979. (KJS::ScopeChain::operator=):
  11980. (KJS::ScopeChain::bottom):
  11981. (KJS::ScopeChain::push):
  11982. (KJS::ScopeChain::pop):
  11983. 2005-11-21 Maciej Stachowiak <mjs@apple.com>
  11984. Reviewed by Geoff.
  11985. <rdar://problem/4139620> Seed: WebKit: hang when sending XMLHttpRequest if automatic proxy config is used
  11986. Also factored locking code completely into a separate class, and
  11987. added a convenient packaged way to temporarily drop locks.
  11988. * JavaScriptCore.xcodeproj/project.pbxproj:
  11989. * kjs/JSLock.cpp: Added.
  11990. (KJS::initializeInterpreterLock):
  11991. (KJS::InterpreterLock::lock):
  11992. (KJS::InterpreterLock::unlock):
  11993. (KJS::InterpreterLock::lockCount):
  11994. (KJS::InterpreterLock::DropAllLocks::DropAllLocks):
  11995. (KJS::InterpreterLock::DropAllLocks::~DropAllLocks):
  11996. * kjs/JSLock.h: Added.
  11997. (KJS::InterpreterLock::InterpreterLock):
  11998. (KJS::InterpreterLock::~InterpreterLock):
  11999. * kjs/internal.cpp:
  12000. * kjs/internal.h:
  12001. * kjs/interpreter.cpp:
  12002. * kjs/interpreter.h:
  12003. * kjs/protect.h:
  12004. * kjs/testkjs.cpp:
  12005. (TestFunctionImp::callAsFunction):
  12006. 2005-11-21 Eric Seidel <eseidel@apple.com>
  12007. Rubber-stamped by hyatt.
  12008. Removed JavaScriptCore+SVG target.
  12009. * JavaScriptCore.xcodeproj/project.pbxproj:
  12010. 2005-11-15 Geoffrey Garen <ggaren@apple.com>
  12011. Reviewed by mjs.
  12012. - Fixed <rdar://problem/4342216> Installer crash in
  12013. KJS::ValueImp::marked() when garbage collector runs inside call to
  12014. ConstantValues::init()
  12015. I took responsibility for initializing and marking ConstantValues away
  12016. from InterpreterImp, since it's possible to reference such a value
  12017. before any interpreter has been created and after the last interpreter
  12018. has been destroyed.
  12019. InterpreterImp::lock now initializes ConstantValues. It's a good
  12020. place for the initialization because you have to call it before
  12021. creating any objects. Since ::lock can be called more than once,
  12022. I added a check in ConstantValues::init to ensure that it executes
  12023. only once.
  12024. Collector:collect is now responsible for marking ConstantValues.
  12025. We no longer clear the ConstantValues since we can't guarantee that no
  12026. one has a reference to them.
  12027. FIXME: This is hackery. The long-term plan is to make ConstantValues
  12028. use immediate values that require no initialization.
  12029. * ChangeLog:
  12030. * kjs/collector.cpp:
  12031. (KJS::Collector::collect):
  12032. * kjs/internal.cpp:
  12033. (KJS::InterpreterImp::InterpreterImp):
  12034. (KJS::InterpreterImp::lock):
  12035. (KJS::InterpreterImp::clear):
  12036. (KJS::InterpreterImp::mark):
  12037. * kjs/internal.h:
  12038. * kjs/value.cpp:
  12039. (KJS::ConstantValues::initIfNeeded):
  12040. * kjs/value.h:
  12041. 2005-11-08 Geoffrey Garen <ggaren@apple.com>
  12042. Reviewed by Darin.
  12043. This patch fixes some naughty naughty code -- 5 crashes and 2
  12044. may-go-haywire-in-the-futures.
  12045. One such crash is <rdar://problem/4247330> 8C46 Crash with with
  12046. incomplete parameter list to webScript object function.
  12047. I replaced early returns from within NS_DURINGs with calls to
  12048. NS_VALUERETURN because the doc says, "You cannot use goto or
  12049. return to exit an exception handling domain -- errors will result."
  12050. I replaced hard-coded analyses of -[NSMethodSignature
  12051. methodReturnType] with more abstracted alternatives, since
  12052. the documentation says "This encoding is implementation-specific,
  12053. so applications should use it with caution," and then emits an
  12054. evil cackle.
  12055. I removed the early return in the case where a JavaScript caller
  12056. supplies an insufficient number of arguments, because the right
  12057. thing to do in such a case is to use JavaScript's defined behavior
  12058. of supplying "undefined" for any missing arguments.
  12059. I also changed ObjcInstance::invokeMethod so that it no longer
  12060. deletes the method passed to it. It doesn't create the method,
  12061. so it shouldn't delete it. A friend of mine named
  12062. KERNEL_PROTECTION_FAILURE agrees with me on this point.
  12063. Finally, I changed an assert(true) to assert(false) because
  12064. all the other asserts were making fun of it.
  12065. * bindings/objc/objc_instance.mm:
  12066. (ObjcInstance::invokeMethod):
  12067. (ObjcInstance::invokeDefaultMethod):
  12068. 2005-11-06 Geoffrey Garen <ggaren@apple.com>
  12069. Reviewed by Darin.
  12070. - Fixed http://bugs.webkit.org/show_bug.cgi?id=5571
  12071. REGRESSION (412.5-TOT): duplicated words/sentences at
  12072. shakespeer.sourceforge.net
  12073. Our UTF16-modified PCRE didn't work with extended character classes
  12074. (classes involving characters > 255) because it used the GETCHARINC
  12075. macro to read through them. In UTF16 mode, GETCHARINC expects UTF16
  12076. input, but PCRE encodes character classes in UTF8 regardless of the
  12077. input mode of the subject string.
  12078. The fix is to explicitly define GETUTF8CHARINC, and to use it,
  12079. rather than GETCHARINC, when reading extended character classes.
  12080. In UTF8 mode, we simply define GETCHARINC to be GETUTF8CHARINC.
  12081. * pcre/pcre_internal.h:
  12082. * pcre/pcre_xclass.c:
  12083. (_pcre_xclass):
  12084. 2005-11-05 Geoffrey Garen <ggaren@apple.com>
  12085. Patch by Mitz Pettel, reviewed by Maciej.
  12086. - Fixed http://bugs.webkit.org/show_bug.cgi?id=5357
  12087. REGRESSION: Scriptable plugin hides properties of OBJECT element
  12088. * bindings/objc/objc_class.mm:
  12089. (KJS::Bindings::ObjcClass::fallbackObject):
  12090. 2005-11-05 Geoffrey Garen <ggaren@apple.com>
  12091. Reviewed by Darin.
  12092. - Fixed http://bugs.webkit.org/show_bug.cgi?id=5409
  12093. slice() testcase doesn't pass
  12094. Modified String.slice to deal with funky values.
  12095. Updated test results. We now pass <js1_2/String/slice.js>.
  12096. * kjs/string_object.cpp:
  12097. (StringProtoFuncImp::callAsFunction):
  12098. * tests/mozilla/expected.html:
  12099. 2005-11-04 Darin Adler <darin@apple.com>
  12100. Reviewed by Tim Hatcher.
  12101. * kxmlcore/HashSet.h: Fixed case of "hashfunctions.h" -- needs to be "HashFunctions.h".
  12102. 2005-11-03 Timothy Hatcher <timothy@apple.com>
  12103. Reviewed by Darin and Vicki.
  12104. * JavaScriptCore.xcodeproj/project.pbxproj:
  12105. Change to use $(SYSTEM_LIBRARY_DIR) consistently and place
  12106. $(NEXT_ROOT) in a few spots to make build-root work.
  12107. 2005-11-03 Geoffrey Garen <ggaren@apple.com>
  12108. - Updated JavaScriptCore test results to reflect recent fixes.
  12109. * tests/mozilla/expected.html:
  12110. 2005-11-03 Geoffrey Garen <ggaren@apple.com>
  12111. Reviewed by darin.
  12112. - Fixed http://bugs.webkit.org/show_bug.cgi?id=5602
  12113. REGRESSION: RegExp("[^\\s$]+", "g") returns extra matches
  12114. We now update lastIndex relative to the start of the last match,
  12115. rather than the start of the last search. We used to assume that
  12116. the two were equal, but that is not the case when a pattern
  12117. matches at a character after the first in the string.
  12118. * kjs/regexp_object.cpp:
  12119. (RegExpProtoFuncImp::callAsFunction):
  12120. 2005-10-24 John Sullivan <sullivan@apple.com>
  12121. Reviewed by Darin Adler. Code changes by Alexey Proskuryakov.
  12122. - fixed http://bugs.webkit.org/show_bug.cgi?id=4931
  12123. Unicode format characters (Cf) should be removed from JavaScript source
  12124. * kjs/lexer.cpp:
  12125. include <unicode/uchar.h>
  12126. (Lexer::Lexer):
  12127. use KJS::UChar instead of UChar to avoid ambiguity caused by new include
  12128. (Lexer::setCode):
  12129. ditto; also, use shift(4) to skip first 4 chars to take advantage of new
  12130. logic there.
  12131. (Lexer::shift):
  12132. skip chars of type U_FORMAT_CHAR
  12133. (Lexer::convertUnicode):
  12134. use KJS::UChar instead of UChar to avoid ambiguity caused by new include
  12135. (Lexer::record16):
  12136. ditto
  12137. (Lexer::makeIdentifier):
  12138. ditto
  12139. (Lexer::makeUString):
  12140. ditto
  12141. * tests/mozilla/ecma/Array/15.4.5.1-1.js:
  12142. updated to skip soft hyphens
  12143. 2005-10-24 John Sullivan <sullivan@apple.com>
  12144. Reviewed by Darin Adler. Code changes by George Staikos/Geoff Garen.
  12145. - fixed http://bugs.webkit.org/show_bug.cgi?id=4142
  12146. Date object does not always adjust daylight savings correctly
  12147. * kjs/date_object.cpp:
  12148. (KJS::makeTime):
  12149. Fix the case where a time change crosses the daylight savings start/end dates.
  12150. 2005-10-17 Maciej Stachowiak <mjs@apple.com>
  12151. Reviewed by Geoff. Code changes by Darin.
  12152. - some micro-optimizations to FastMalloc to reduce math and branches.
  12153. * kxmlcore/FastMalloc.cpp:
  12154. (KXMLCore::TCMalloc_Central_FreeList::Populate):
  12155. (KXMLCore::fastMallocRegisterThread):
  12156. (KXMLCore::TCMalloc_ThreadCache::GetCache):
  12157. (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
  12158. 2005-10-15 Maciej Stachowiak <mjs@apple.com>
  12159. Reverted fix for this bug, because it was part of a time range that caused a performance
  12160. regression:
  12161. <rdar://problem/4260481> Remove Reference type from JavaScriptCore
  12162. 2005-10-15 Darin Adler <darin@apple.com>
  12163. * kxmlcore/HashTable.cpp: Fixed build failure (said hashtable.h instead of HashTable.h).
  12164. 2005-10-14 Geoffrey Garen <ggaren@apple.com>
  12165. Style changes recommended by Darin.
  12166. Changed to camelCase, changed ValueImp* to ValueImp *.
  12167. * kjs/simple_number.h:
  12168. (KJS::SimpleNumber::make):
  12169. (KJS::SimpleNumber::value):
  12170. 2005-10-11 Geoffrey Garen <ggaren@apple.com>
  12171. Added regexp_object.lut.h build phase from JavaScriptCore
  12172. to JavaScriptCore+SVG.
  12173. Reviewed by mitz.
  12174. * JavaScriptCore.xcodeproj/project.pbxproj:
  12175. 2005-10-11 Geoffrey Garen <ggaren@apple.com>
  12176. Fixed build bustage from last checkin (stray characters
  12177. in the project file).
  12178. Reviewed by mitz.
  12179. * JavaScriptCore.xcodeproj/project.pbxproj:
  12180. 2005-10-11 Geoffrey Garen <ggaren@apple.com>
  12181. New JavaScriptCore test results to reflect the last change.
  12182. * tests/mozilla/expected.html:
  12183. 2005-10-10 Geoffrey Garen <ggaren@apple.com>
  12184. - Implemented caching of match state inside the global RegExp object
  12185. (lastParen, leftContext, rightContext, lastMatch, input).
  12186. exec(), test(), match(), search(), and replace() now dipatch regular
  12187. expression matching through the RegExp object's performMatch function,
  12188. to facilitate caching. This replaces registerRegexp and
  12189. setSubPatterns.
  12190. - Implemented the special '$' aliases (e.g. RegExp.input aliases to
  12191. RegExp.$_).
  12192. - Moved support for backreferences into the new static hash table
  12193. used for other special RegExp properties. Truncated backreferences
  12194. at $9 to match IE, FF, and the "What's New in Netscape 1.2?" doc.
  12195. (String.replace still supports double-digit backreferences.)
  12196. - Tweaked RegExp.prototype.exec to handle ginormous values in lastIndex.
  12197. Fixes 11 -- count em, 11 -- JavaScriptCore tests.
  12198. * fast/js/regexp-caching-expected.txt: Added.
  12199. * fast/js/regexp-caching.html: Added.
  12200. Reviewed by mjs.
  12201. * JavaScriptCore.xcodeproj/project.pbxproj: Added regexp_object.lut.h
  12202. * kjs/create_hash_table: Tweaked to allow for more exotic characters.
  12203. We now rely on the compiler to catch illegal
  12204. identifiers.
  12205. * kjs/regexp.cpp:
  12206. (KJS::RegExp::RegExp):
  12207. * kjs/regexp_object.cpp:
  12208. (RegExpProtoFuncImp::callAsFunction):
  12209. (RegExpObjectImp::RegExpObjectImp):
  12210. (RegExpObjectImp::performMatch):
  12211. (RegExpObjectImp::arrayOfMatches):
  12212. (RegExpObjectImp::backrefGetter):
  12213. (RegExpObjectImp::getLastMatch):
  12214. (RegExpObjectImp::getLastParen):
  12215. (RegExpObjectImp::getLeftContext):
  12216. (RegExpObjectImp::getRightContext):
  12217. (RegExpObjectImp::getOwnPropertySlot):
  12218. (RegExpObjectImp::getValueProperty):
  12219. (RegExpObjectImp::put):
  12220. (RegExpObjectImp::putValueProperty):
  12221. * kjs/regexp_object.h:
  12222. (KJS::RegExpObjectImp::):
  12223. * kjs/string_object.cpp:
  12224. (substituteBackreferences):
  12225. (replace):
  12226. (StringProtoFuncImp::callAsFunction):
  12227. 2005-10-09 Darin Adler <darin@apple.com>
  12228. Reviewed by Maciej; some changes done after review.
  12229. - fixed <rdar://problem/4092064> hanging loading page; rte.ie (works in IE and Firefox)
  12230. - fixed http://bugs.webkit.org/show_bug.cgi?id=5280
  12231. Date.setMonth fails with negative values
  12232. - fixed http://bugs.webkit.org/show_bug.cgi?id=5154
  12233. JSC should switch to _r variants of unix time/date functions
  12234. - fixed a few possible overflow cases
  12235. Retested all tests to be sure nothing broke; added layout test for bug 5280.
  12236. * kjs/config.h: Removed TIME_WITH_SYS_TIME define. Also set HAVE_SYS_TIMEB_H
  12237. for the __APPLE__ case (the latter is accurate but irrelevant).
  12238. * kjs/date_object.h: Reformatted. Removed unnecessary include of "function_object.h".
  12239. Moved declarations of helper classes and functions into the cpp file.
  12240. * kjs/date_object.cpp: Removed code at top to define macros to use CoreFoundation instead of
  12241. POSIX date functions.
  12242. (KJS::styleFromArgString): Tweaked to return early instead of using a variable.
  12243. (KJS::formatLocaleDate): Tweaked to check for undefined rather than checking argument count.
  12244. (KJS::formatDate): Made parameter const.
  12245. (KJS::formatDateUTCVariant): Ditto.
  12246. (KJS::formatTime): Ditto.
  12247. (KJS::DateProtoFuncImp::callAsFunction): Use gmtime_r and localtime_r instead of gmtime and
  12248. localtime.
  12249. (KJS::DateObjectImp::callAsFunction): Use localtime_r instead of localtime.
  12250. (KJS::ymdhmsToSeconds): Renamed from ymdhms_to_seconds. Changed computation to avoid possible
  12251. overflow if year is an extremely large or small number.
  12252. (KJS::makeTime): Removed code to move large month numbers from tm_mon to tm_year; this was
  12253. to accomodate CFGregorianDate, which is no longer used (and didn't handle negative values).
  12254. (KJS::parseDate): Renamed from KRFCDate_parseDate; changed to return a value in milliseconds
  12255. rather than in seconds. Reformatted the code. Changed to use UTF8String() instead of ascii(),
  12256. since ascii() is not thread safe. Changed some variables back from int to long to avoid
  12257. trouble if the result of strtol does not fit in an int (64-bit issue only).
  12258. 2005-10-08 Mitz Pettel <opendarwin.org@mitzpettel.com>
  12259. Reviewed by Geoff.
  12260. Tweaked and landed by Darin.
  12261. - fixed http://bugs.webkit.org/show_bug.cgi?id=5266
  12262. Support parenthesized comments in Date.parse()
  12263. * kjs/date_object.cpp:
  12264. (KJS::skipSpacesAndComments): Take a pointer, and advance it past spaces,
  12265. and also past anything enclosed in parentheses.
  12266. (KJS::KRFCDate_parseDate): Use skipSpacesAndComments wherever we formerly had
  12267. code to skip spaces.
  12268. 2005-10-08 Justin Haygood <justin@xiondigital.net>
  12269. Reviewed, tweaked, and landed by Darin.
  12270. - fixed http://bugs.webkit.org/show_bug.cgi?id=5189
  12271. pcre_exec.c fails to compile using MSVC
  12272. - fixed http://bugs.webkit.org/show_bug.cgi?id=5190
  12273. KJS config.h adjustment for Win32
  12274. * kjs/config.h: Make sure HAVE_MMAP and HAVE_SBRK are off for Win32.
  12275. Turn HAVE_ERRNO_H on for Mac OS X. Sort defines so they are easy to compare
  12276. with each other. Remove #undef of DEBUG_COLLECTOR.
  12277. * pcre/pcre_exec.c: (match): Work around strange MSVC complaint by splitting
  12278. the definition of a local variable into a separate declaration and
  12279. initialization.
  12280. 2005-10-05 Geoffrey Garen <ggaren@apple.com>
  12281. - Darin and I rewrote our implementation of the SimpleNumber class
  12282. to store number bit patterns in their floating point formats.
  12283. My tweaks reviewed by Darin.
  12284. ~1% speedup on JS iBench.
  12285. * kjs/internal.h: removed obsolete jsNumber declarations.
  12286. * kjs/math_object.cpp:
  12287. (MathFuncImp::callAsFunction): changed KJS::isNaN to isNaN
  12288. * kjs/nodes.cpp:
  12289. (PostfixResolveNode::evaluate): removed obsolete knownToBeInteger
  12290. (PostfixBracketNode::evaluate): ditto
  12291. (PostfixDotNode::evaluate): ditto
  12292. (PrefixResolveNode::evaluate): ditto
  12293. (PrefixBracketNode::evaluate): ditto
  12294. (PrefixDotNode::evaluate): ditto
  12295. (NegateNode::evaluate): ditto
  12296. (valueForReadModifyAssignment): ditto
  12297. * kjs/number_object.cpp: removed obsolete comment
  12298. * kjs/operations.cpp:
  12299. (KJS::equal): removed unnecessary isNaN checks
  12300. (KJS::strictEqual): ditto
  12301. (KJS::add): removed obsolete knownToBeInteger
  12302. (KJS::mult): ditto
  12303. * kjs/operations.h: removed include of "value.h" to prevent circular reference
  12304. * kjs/simple_number.h: removed unnecessary #includes
  12305. (KJS::SimpleNumber::make): see above
  12306. (KJS::SimpleNumber::is): ditto
  12307. (KJS::SimpleNumber::value): ditto
  12308. * kjs/string_object.cpp:
  12309. (StringProtoFuncImp::callAsFunction): changed KJS::isNaN to isNaN
  12310. * kjs/ustring.cpp: removed unnecessary isNaN check
  12311. (KJS::UString::toUInt32): ditto
  12312. * kjs/value.cpp:
  12313. (KJS::jsNumber): removed obsolete jsNumber definitions
  12314. (KJS::ConstantValues::init): NaN is no longer a ConstantValue
  12315. (KJS::ConstantValues::clear): ditto
  12316. (KJS::ConstantValues::mark): ditto
  12317. * kjs/value.h: removed obsolete knownToBeInteger
  12318. (KJS::jsNaN): now returns a SimpleNumber
  12319. (KJS::ValueImp::getUInt32): changed to account for NaN being a SimpleNumber
  12320. (KJS::ValueImp::toBoolean): ditto
  12321. (KJS::ValueImp::toString): changed to account for +/- 0.0
  12322. (KJS::jsZero): changed to reflect that SimpleNumber::make takes a double
  12323. (KJS::jsOne): ditto
  12324. (KJS::jsTwo): ditto
  12325. (KJS::Number): removed obsolete non-double constructor declarations
  12326. 2005-10-05 Maciej Stachowiak <mjs@apple.com>
  12327. Reviewed by Eric.
  12328. - fixed <rdar://problem/4260481> Remove Reference type from JavaScriptCore
  12329. Also fixed some bugs with for..in enumeration while I was at it. object
  12330. properties now come before prototype properties and duplicates
  12331. between object and prototype are listed only once.
  12332. * JavaScriptCore.xcodeproj/project.pbxproj:
  12333. * kjs/IdentifierSequencedSet.cpp: Added.
  12334. (KJS::IdentifierSequencedSet::IdentifierSequencedSet):
  12335. (KJS::IdentifierSequencedSet::deallocateVector):
  12336. (KJS::IdentifierSequencedSet::~IdentifierSequencedSet):
  12337. (KJS::IdentifierSequencedSet::insert):
  12338. * kjs/IdentifierSequencedSet.h: Added.
  12339. (KJS::IdentifierSequencedSetIterator::IdentifierSequencedSetIterator):
  12340. (KJS::IdentifierSequencedSetIterator::operator*):
  12341. (KJS::IdentifierSequencedSetIterator::operator->):
  12342. (KJS::IdentifierSequencedSetIterator::operator++):
  12343. (KJS::IdentifierSequencedSetIterator::operator==):
  12344. (KJS::IdentifierSequencedSetIterator::operator!=):
  12345. (KJS::IdentifierSequencedSet::begin):
  12346. (KJS::IdentifierSequencedSet::end):
  12347. (KJS::IdentifierSequencedSet::size):
  12348. * kjs/array_instance.h:
  12349. * kjs/array_object.cpp:
  12350. (ArrayInstanceImp::getPropertyNames):
  12351. (ArrayInstanceImp::setLength):
  12352. (ArrayInstanceImp::pushUndefinedObjectsToEnd):
  12353. * kjs/nodes.cpp:
  12354. (ForInNode::execute):
  12355. * kjs/nodes.h:
  12356. * kjs/object.cpp:
  12357. (KJS::ObjectImp::getPropertyNames):
  12358. * kjs/object.h:
  12359. * kjs/property_map.cpp:
  12360. (KJS::PropertyMap::getEnumerablePropertyNames):
  12361. (KJS::PropertyMap::getSparseArrayPropertyNames):
  12362. * kjs/property_map.h:
  12363. * kjs/protect.h:
  12364. * kjs/protected_reference.h: Removed.
  12365. * kjs/reference.cpp: Removed.
  12366. * kjs/reference.h: Removed.
  12367. * kjs/reference_list.cpp: Removed.
  12368. * kjs/reference_list.h: Removed.
  12369. * kjs/ustring.h:
  12370. (KJS::UString::impl):
  12371. * kxmlcore/HashSet.h:
  12372. 2005-10-04 Eric Seidel <eseidel@apple.com>
  12373. Reviewed by mjs.
  12374. Code cleanup, which resulted in a small win on iBench.
  12375. * kjs/object.cpp:
  12376. (KJS::tryGetAndCallProperty): new static inline
  12377. (KJS::ObjectImp::defaultValue): code cleanup
  12378. 2005-10-03 Maciej Stachowiak <mjs@apple.com>
  12379. Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
  12380. - more Linux build fixes
  12381. * kjs/operations.cpp:
  12382. * kxmlcore/FastMalloc.h:
  12383. * kxmlcore/TCSystemAlloc.cpp:
  12384. (TCMalloc_SystemAlloc):
  12385. 2005-10-03 Maciej Stachowiak <mjs@apple.com>
  12386. Patch from George Staikos <staikos@kde.org>, reviewed and tweaked a bit by me.
  12387. http://bugs.webkit.org/show_bug.cgi?id=5174
  12388. Add support for compiling on Linux (likely to help for other POSIX systems too)
  12389. * kjs/collector.cpp:
  12390. (KJS::Collector::markCurrentThreadConservatively):
  12391. (KJS::Collector::markOtherThreadConservatively):
  12392. * kjs/config.h:
  12393. * kjs/date_object.cpp:
  12394. (KJS::formatDate):
  12395. (KJS::formatDateUTCVariant):
  12396. (KJS::formatTime):
  12397. (KJS::timeZoneOffset):
  12398. (KJS::DateProtoFuncImp::callAsFunction):
  12399. (KJS::DateObjectImp::construct):
  12400. (KJS::DateObjectImp::callAsFunction):
  12401. (KJS::makeTime):
  12402. * kjs/identifier.cpp:
  12403. * kjs/internal.cpp:
  12404. (KJS::initializeInterpreterLock):
  12405. (KJS::lockInterpreter):
  12406. (KJS::unlockInterpreter):
  12407. (KJS::UndefinedImp::toPrimitive):
  12408. (KJS::UndefinedImp::toBoolean):
  12409. (KJS::UndefinedImp::toNumber):
  12410. (KJS::UndefinedImp::toString):
  12411. (KJS::NullImp::toPrimitive):
  12412. (KJS::NullImp::toBoolean):
  12413. (KJS::NullImp::toNumber):
  12414. (KJS::NullImp::toString):
  12415. (KJS::BooleanImp::toPrimitive):
  12416. (KJS::BooleanImp::toBoolean):
  12417. (KJS::BooleanImp::toNumber):
  12418. (KJS::BooleanImp::toString):
  12419. (KJS::StringImp::toPrimitive):
  12420. (KJS::StringImp::toBoolean):
  12421. (KJS::StringImp::toNumber):
  12422. (KJS::StringImp::toString):
  12423. * kjs/internal.h:
  12424. * kjs/protected_values.cpp:
  12425. 2005-10-03 Maciej Stachowiak <mjs@apple.com>
  12426. - fix Development build after last checkin
  12427. * kxmlcore/FastMalloc.cpp:
  12428. (KXMLCore::fastMallocRegisterThread):
  12429. 2005-10-02 Maciej Stachowiak <mjs@apple.com>
  12430. Reviewed by Darin.
  12431. <rdar://problem/4283967> REGRESSION: 3% regression on PLT from new FastMalloc
  12432. http://bugs.webkit.org/show_bug.cgi?id=5243
  12433. A number of optimizations to the new threadsafe malloc that make it actually as fast
  12434. as dlmalloc (I measured wrong before) and as memory-efficient as the system malloc.
  12435. - use fastMalloc for everything - it now gets applied to all new/delete allocations
  12436. via a private inline operator new that is now included into every file via config.h.
  12437. - tweaked some of the numeric parameters for size classes and amount of wasted memory
  12438. allowed per allocation - this saves on memory use and consequently improves speed.
  12439. - so long as the allocator is not being used on background threads, get the per-thread
  12440. cache from a global variable instead of from pthread_getspecific, since the latter is slow.
  12441. - inline more functions, and force the ones GCC refuses to inline with
  12442. attribute(always_inline), nearly all of these have one call site so inlining them has
  12443. to be a win.
  12444. - use some tricks to calculate allocation size more efficiently and fewer times for small
  12445. allocations, to avoid hitting the huge size table array.
  12446. - avoid hitting the per-thread cache on code paths that don't need it.
  12447. - implement inline assembly version of spinlock for PowerPC (was already done for x86)
  12448. * bindings/NP_jsobject.cpp:
  12449. * bindings/c/c_class.cpp:
  12450. * bindings/c/c_instance.cpp:
  12451. * bindings/c/c_runtime.cpp:
  12452. * bindings/c/c_utility.cpp:
  12453. * bindings/jni/jni_class.cpp:
  12454. * bindings/jni/jni_instance.cpp:
  12455. * bindings/jni/jni_jsobject.cpp:
  12456. * bindings/jni/jni_objc.mm:
  12457. * bindings/jni/jni_runtime.cpp:
  12458. * bindings/jni/jni_utility.cpp:
  12459. * bindings/npruntime.cpp:
  12460. * bindings/objc/WebScriptObject.mm:
  12461. * bindings/objc/objc_class.mm:
  12462. * bindings/objc/objc_instance.mm:
  12463. * bindings/objc/objc_runtime.mm:
  12464. * bindings/objc/objc_utility.mm:
  12465. * bindings/runtime.cpp:
  12466. * bindings/runtime_array.cpp:
  12467. * bindings/runtime_method.cpp:
  12468. * bindings/runtime_object.cpp:
  12469. * bindings/runtime_root.cpp:
  12470. * bindings/testbindings.cpp:
  12471. * bindings/testbindings.mm:
  12472. * kjs/array_object.cpp:
  12473. (ArrayInstanceImp::ArrayInstanceImp):
  12474. (ArrayInstanceImp::~ArrayInstanceImp):
  12475. (ArrayInstanceImp::resizeStorage):
  12476. * kjs/bool_object.cpp:
  12477. * kjs/collector.cpp:
  12478. (KJS::Collector::registerThread):
  12479. * kjs/config.h:
  12480. * kjs/debugger.cpp:
  12481. * kjs/error_object.cpp:
  12482. * kjs/function.cpp:
  12483. * kjs/function_object.cpp:
  12484. * kjs/identifier.cpp:
  12485. (KJS::Identifier::rehash):
  12486. * kjs/internal.cpp:
  12487. (KJS::Parser::saveNewNode):
  12488. (KJS::clearNewNodes):
  12489. * kjs/interpreter.cpp:
  12490. * kjs/lexer.cpp:
  12491. (Lexer::doneParsing):
  12492. (Lexer::makeIdentifier):
  12493. (Lexer::makeUString):
  12494. * kjs/list.cpp:
  12495. * kjs/math_object.cpp:
  12496. * kjs/nodes.cpp:
  12497. * kjs/nodes.h:
  12498. * kjs/nodes2string.cpp:
  12499. * kjs/number_object.cpp:
  12500. (integer_part_noexp):
  12501. (char_sequence):
  12502. * kjs/object.cpp:
  12503. * kjs/object_object.cpp:
  12504. * kjs/property_map.cpp:
  12505. * kjs/property_slot.cpp:
  12506. * kjs/protected_values.cpp:
  12507. (KJS::ProtectedValues::rehash):
  12508. * kjs/reference.cpp:
  12509. * kjs/reference_list.cpp:
  12510. * kjs/regexp.cpp:
  12511. * kjs/regexp_object.cpp:
  12512. * kjs/scope_chain.cpp:
  12513. * kjs/scope_chain.h:
  12514. * kjs/string_object.cpp:
  12515. * kjs/testkjs.cpp:
  12516. * kjs/ustring.h:
  12517. * kjs/value.cpp:
  12518. * kxmlcore/Assertions.mm:
  12519. * kxmlcore/FastMalloc.cpp:
  12520. (KXMLCore::InitSizeClasses):
  12521. (KXMLCore::DLL_IsEmpty):
  12522. (KXMLCore::DLL_Prepend):
  12523. (KXMLCore::TCMalloc_Central_FreeList::Insert):
  12524. (KXMLCore::TCMalloc_Central_FreeList::Remove):
  12525. (KXMLCore::TCMalloc_Central_FreeList::Populate):
  12526. (KXMLCore::TCMalloc_ThreadCache::Allocate):
  12527. (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
  12528. (KXMLCore::fastMallocRegisterThread):
  12529. (KXMLCore::TCMalloc_ThreadCache::GetCache):
  12530. (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
  12531. (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  12532. (KXMLCore::do_malloc):
  12533. (KXMLCore::do_free):
  12534. (KXMLCore::realloc):
  12535. * kxmlcore/FastMalloc.h:
  12536. (operator new):
  12537. (operator delete):
  12538. (operator new[]):
  12539. (operator delete[]):
  12540. * kxmlcore/HashTable.cpp:
  12541. * kxmlcore/TCSpinLock.h:
  12542. (TCMalloc_SpinLock::Lock):
  12543. (TCMalloc_SpinLock::Unlock):
  12544. (TCMalloc_SlowLock):
  12545. * kxmlcore/TCSystemAlloc.cpp:
  12546. 2005-09-30 Geoffrey Garen <ggaren@apple.com>
  12547. - Second cut at fixing <rdar://problem/4275206> Denver Regression: Seed:
  12548. Past Editions of Opinions display "NAN/Undefined" for www.washingtonpost.com
  12549. Reviewed by john.
  12550. * kjs/date_object.cpp:
  12551. (KJS::KRFCDate_parseDate): Intead of creating a timezone when one isn't specified,
  12552. just rely on the fallback logic, which will do it for you. Also, return invalidDate
  12553. if the date includes trailing garbage. (Somewhat accidentally, the timezone logic
  12554. used to catch trailing garbage.)
  12555. Added test case to fast/js/date-parse-test.html.
  12556. 2005-09-29 Eric Seidel <eseidel@apple.com>
  12557. Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
  12558. Reviewed by darin.
  12559. Fix JSC memory smasher in TOT.
  12560. http://bugs.webkit.org/show_bug.cgi?id=5176
  12561. * pcre/pcre_exec.c:
  12562. (match):
  12563. 2005-09-29 Eric Seidel <eseidel@apple.com>
  12564. Fix from Mitz Pettel <opendarwin.org@mitzpettel.com>
  12565. Reviewed by mjs.
  12566. * JavaScriptCore.xcodeproj/project.pbxproj:
  12567. Build fix for JSC+SVG after 5161.
  12568. http://bugs.webkit.org/show_bug.cgi?id=5179
  12569. 2005-09-28 Geoffrey Garen <ggaren@apple.com>
  12570. - Fixed <rdar://problem/4275206> Denver Regression: Seed: Past Editions of Opinions display
  12571. "NAN/Undefined" for www.washingtonpost.com
  12572. Reviewed by darin.
  12573. * kjs/date_object.cpp:
  12574. (KJS::KRFCDate_parseDate): If the timezone isn't specified, rather than returning
  12575. invalidDate, substitute the local timezone. This matches the behavior of FF/IE.
  12576. 2005-09-28 Maciej Stachowiak <mjs@apple.com>
  12577. Patch from George Staikos, reviewed by me.
  12578. - fixed some compile issues on Linux
  12579. * kjs/property_slot.h:
  12580. * kjs/simple_number.h:
  12581. 2005-09-27 Maciej Stachowiak <mjs@apple.com>
  12582. Reviewed by Eric.
  12583. - move HashMap/HashSet code down to JavaScriptCore
  12584. http://bugs.webkit.org/show_bug.cgi?id=5161
  12585. * JavaScriptCore.xcodeproj/project.pbxproj:
  12586. * kjs/internal.cpp:
  12587. (KJS::interpreterMap): Function that fetches the interpreter map on demand.
  12588. (KJS::InterpreterImp::InterpreterImp): Replace use of InterpreterMap
  12589. class with an appropriate HashMap.
  12590. (KJS::InterpreterImp::clear): ditto
  12591. (KJS::InterpreterImp::interpreterWithGlobalObject): ditto
  12592. * kjs/interpreter_map.cpp: Removed.
  12593. * kjs/interpreter_map.h: Removed.
  12594. The HashMap/HashSet code (copied and slightly tweaked from WebCore)
  12595. * kxmlcore/HashFunctions.h: Added.
  12596. (KXMLCore::4):
  12597. (KXMLCore::8):
  12598. (KXMLCore::):
  12599. (KXMLCore::PointerHash::hash):
  12600. (KXMLCore::PointerHash::equal):
  12601. * kxmlcore/HashMap.h: Added.
  12602. (KXMLCore::extractFirst):
  12603. (KXMLCore::HashMap::HashMap):
  12604. (KXMLCore::::size):
  12605. (KXMLCore::::capacity):
  12606. (KXMLCore::::isEmpty):
  12607. (KXMLCore::::begin):
  12608. (KXMLCore::::end):
  12609. (KXMLCore::::find):
  12610. (KXMLCore::::contains):
  12611. (KXMLCore::::set):
  12612. (KXMLCore::::get):
  12613. (KXMLCore::::remove):
  12614. (KXMLCore::::clear):
  12615. (KXMLCore::deleteAllValues):
  12616. * kxmlcore/HashMapPtrSpec.h: Added.
  12617. (KXMLCore::PointerHashIteratorAdapter::PointerHashIteratorAdapter):
  12618. (KXMLCore::PointerHashIteratorAdapter::operator*):
  12619. (KXMLCore::PointerHashIteratorAdapter::operator->):
  12620. (KXMLCore::PointerHashIteratorAdapter::operator++):
  12621. (KXMLCore::PointerHashIteratorAdapter::operator==):
  12622. (KXMLCore::PointerHashIteratorAdapter::operator!=):
  12623. (KXMLCore::PointerHashConstIteratorAdapter::PointerHashConstIteratorAdapter):
  12624. (KXMLCore::PointerHashConstIteratorAdapter::operator*):
  12625. (KXMLCore::PointerHashConstIteratorAdapter::operator->):
  12626. (KXMLCore::PointerHashConstIteratorAdapter::operator++):
  12627. (KXMLCore::PointerHashConstIteratorAdapter::operator==):
  12628. (KXMLCore::PointerHashConstIteratorAdapter::operator!=):
  12629. (KXMLCore::):
  12630. * kxmlcore/HashSet.h: Added.
  12631. (KXMLCore::identityExtract):
  12632. (KXMLCore::convertAdapter):
  12633. (KXMLCore::HashSet::HashSet):
  12634. (KXMLCore::::size):
  12635. (KXMLCore::::capacity):
  12636. (KXMLCore::::isEmpty):
  12637. (KXMLCore::::begin):
  12638. (KXMLCore::::end):
  12639. (KXMLCore::::find):
  12640. (KXMLCore::::contains):
  12641. (KXMLCore::::insert):
  12642. (KXMLCore::::remove):
  12643. (KXMLCore::::clear):
  12644. * kxmlcore/HashTable.cpp: Added.
  12645. (KXMLCore::HashTableStats::~HashTableStats):
  12646. (KXMLCore::HashTableStats::recordCollisionAtCount):
  12647. * kxmlcore/HashTable.h: Added.
  12648. (KXMLCore::HashTableIterator::skipEmptyBuckets):
  12649. (KXMLCore::HashTableIterator::HashTableIterator):
  12650. (KXMLCore::HashTableIterator::operator*):
  12651. (KXMLCore::HashTableIterator::operator->):
  12652. (KXMLCore::HashTableIterator::operator++):
  12653. (KXMLCore::HashTableIterator::operator==):
  12654. (KXMLCore::HashTableIterator::operator!=):
  12655. (KXMLCore::HashTableConstIterator::HashTableConstIterator):
  12656. (KXMLCore::HashTableConstIterator::operator*):
  12657. (KXMLCore::HashTableConstIterator::operator->):
  12658. (KXMLCore::HashTableConstIterator::skipEmptyBuckets):
  12659. (KXMLCore::HashTableConstIterator::operator++):
  12660. (KXMLCore::HashTableConstIterator::operator==):
  12661. (KXMLCore::HashTableConstIterator::operator!=):
  12662. (KXMLCore::HashTable::HashTable):
  12663. (KXMLCore::HashTable::~HashTable):
  12664. (KXMLCore::HashTable::begin):
  12665. (KXMLCore::HashTable::end):
  12666. (KXMLCore::HashTable::size):
  12667. (KXMLCore::HashTable::capacity):
  12668. (KXMLCore::HashTable::insert):
  12669. (KXMLCore::HashTable::isEmptyBucket):
  12670. (KXMLCore::HashTable::isDeletedBucket):
  12671. (KXMLCore::HashTable::isEmptyOrDeletedBucket):
  12672. (KXMLCore::HashTable::hash):
  12673. (KXMLCore::HashTable::equal):
  12674. (KXMLCore::HashTable::identityConvert):
  12675. (KXMLCore::HashTable::extractKey):
  12676. (KXMLCore::HashTable::lookup):
  12677. (KXMLCore::HashTable::shouldExpand):
  12678. (KXMLCore::HashTable::mustRehashInPlace):
  12679. (KXMLCore::HashTable::shouldShrink):
  12680. (KXMLCore::HashTable::shrink):
  12681. (KXMLCore::HashTable::clearBucket):
  12682. (KXMLCore::HashTable::deleteBucket):
  12683. (KXMLCore::HashTable::makeLookupResult):
  12684. (KXMLCore::HashTable::makeIterator):
  12685. (KXMLCore::HashTable::makeConstIterator):
  12686. (KXMLCore::::lookup):
  12687. (KXMLCore::::insert):
  12688. (KXMLCore::::reinsert):
  12689. (KXMLCore::::find):
  12690. (KXMLCore::::contains):
  12691. (KXMLCore::::remove):
  12692. (KXMLCore::::allocateTable):
  12693. (KXMLCore::::expand):
  12694. (KXMLCore::::rehash):
  12695. (KXMLCore::::clear):
  12696. (KXMLCore::::HashTable):
  12697. (KXMLCore::::swap):
  12698. (KXMLCore::::operator):
  12699. (KXMLCore::::checkTableConsistency):
  12700. (KXMLCore::::checkTableConsistencyExceptSize):
  12701. * kxmlcore/HashTraits.h: Added.
  12702. (KXMLCore::HashTraits::emptyValue):
  12703. (KXMLCore::):
  12704. (KXMLCore::PairHashTraits::emptyValue):
  12705. (KXMLCore::PairHashTraits::deletedValue):
  12706. 2005-09-27 Darin Adler <darin@apple.com>
  12707. Reviewed by Maciej.
  12708. - update grammar to fix conflicts; fixes one of our test cases
  12709. because it resolves the relationship between function expressions
  12710. and declarations in the way required by the ECMA specification
  12711. * kjs/grammar.y: Added lots of new grammar rules so we have no conflicts.
  12712. A new set of rules for "no bracket or function at start of expression" and
  12713. another set of rules for "no in anywhere in expression". Also simplified the
  12714. handling of try to use only a single node and used operator precedence to
  12715. get rid of the conflict in handling of if and else. Also used a macro to
  12716. streamline the handling of automatic semicolons and changed parenthesis
  12717. handling to use a virtual function.
  12718. * kjs/nodes.h: Added nodeInsideAllParens, removed unused abortStatement.
  12719. (KJS::TryNode::TryNode): Updated to hold catch and finally blocks directly instead
  12720. of using a special node for each.
  12721. * kjs/nodes.cpp:
  12722. (Node::createErrorCompletion): Added. Used instead of throwError when creating errors
  12723. that should not be in a completion rather than an ExecState.
  12724. (Node::throwUndefinedVariableError): Added. Sets source location unlike the call it
  12725. replaces.
  12726. (Node::nodeInsideAllParens): Added.
  12727. (GroupNode::nodeInsideAllParens): Added.
  12728. (StatListNode::execute): Removed code to move exceptions into completion objects;
  12729. that's now done solely by the KJS_CHECKEXCEPTION macro.
  12730. (TryNode::execute): Include execution of catch and finally here rather than using
  12731. separate nodes.
  12732. (FuncDeclNode::execute): Moved here, no longer inline.
  12733. * kjs/nodes2string.cpp:
  12734. (TryNode::streamTo): Updated for change.
  12735. (FuncDeclNode::streamTo): Ditto.
  12736. (FuncExprNode::streamTo): Ditto.
  12737. * kjs/kjs-test: Removed. Was part of "make check".
  12738. * kjs/kjs-test.chk: Ditto.
  12739. * kjs/test.js: Ditto.
  12740. * tests/mozilla/expected.html: Updated because one more test succeeds.
  12741. 2005-09-27 Adele Peterson <adele@apple.com>
  12742. Reviewed by Maciej.
  12743. Changed ints to size_t where appropriate.
  12744. * kjs/collector.cpp:
  12745. (KJS::Collector::allocate):
  12746. (KJS::Collector::markStackObjectsConservatively):
  12747. (KJS::Collector::collect):
  12748. (KJS::Collector::size):
  12749. (KJS::Collector::numInterpreters):
  12750. (KJS::Collector::numGCNotAllowedObjects):
  12751. (KJS::Collector::numReferencedObjects):
  12752. * kjs/collector.h:
  12753. 2005-09-27 Eric Seidel <eseidel@apple.com>
  12754. Reviewed by kevin.
  12755. * JavaScriptCore.xcodeproj/project.pbxproj: fix after malloc changes.
  12756. 2005-09-27 Eric Seidel <eseidel@apple.com>
  12757. Reviewed by mjs.
  12758. * kjs/nodes.cpp:
  12759. (FuncExprNode::evaluate): Now sets .constructor properly.
  12760. Test cases added to WebCore/layout-tests.
  12761. http://bugs.webkit.org/show_bug.cgi?id=3537
  12762. 2005-09-26 Maciej Stachowiak <mjs@apple.com>
  12763. Reviewed by John.
  12764. - replace dlmalloc with tcmalloc
  12765. http://bugs.webkit.org/show_bug.cgi?id=5145
  12766. I also moved SharedPtr and the assertion code from WebCore into a
  12767. new kxmlcore directory.
  12768. * JavaScriptCore.xcodeproj/project.pbxproj:
  12769. * kjs/collector.cpp:
  12770. (KJS::Collector::allocate):
  12771. (KJS::Collector::collect):
  12772. * kjs/config.h:
  12773. * kjs/fast_malloc.cpp: Removed.
  12774. * kjs/fast_malloc.h: Removed.
  12775. * kjs/function.cpp:
  12776. * kjs/function.h:
  12777. * kjs/function_object.cpp:
  12778. * kjs/identifier.cpp:
  12779. (KJS::Identifier::add):
  12780. * kjs/internal.cpp:
  12781. * kjs/internal.h:
  12782. * kjs/nodes.h:
  12783. * kjs/nodes2string.cpp:
  12784. * kjs/property_map.cpp:
  12785. (KJS::PropertyMap::~PropertyMap):
  12786. (KJS::PropertyMap::rehash):
  12787. * kjs/scope_chain.h:
  12788. * kjs/shared_ptr.h: Removed.
  12789. * kjs/string_object.cpp:
  12790. (StringObjectFuncImp::callAsFunction):
  12791. * kjs/ustring.cpp:
  12792. (KJS::UString::Rep::createCopying):
  12793. (KJS::UString::Rep::destroy):
  12794. (KJS::UString::expandCapacity):
  12795. (KJS::UString::expandPreCapacity):
  12796. (KJS::UString::UString):
  12797. (KJS::UString::spliceSubstringsWithSeparators):
  12798. (KJS::UString::append):
  12799. (KJS::UString::operator=):
  12800. (KJS::UString::detach):
  12801. * kjs/ustring.h:
  12802. * kxmlcore/Assertions.h: Added.
  12803. * kxmlcore/Assertions.mm: Added.
  12804. * kxmlcore/FastMalloc.cpp: Added.
  12805. (KXMLCore::LgFloor):
  12806. (KXMLCore::SizeClass):
  12807. (KXMLCore::ByteSizeForClass):
  12808. (KXMLCore::InitSizeClasses):
  12809. (KXMLCore::MetaDataAlloc):
  12810. (KXMLCore::PageHeapAllocator::Init):
  12811. (KXMLCore::PageHeapAllocator::New):
  12812. (KXMLCore::PageHeapAllocator::Delete):
  12813. (KXMLCore::PageHeapAllocator::inuse):
  12814. (KXMLCore::pages):
  12815. (KXMLCore::AllocationSize):
  12816. (KXMLCore::Event):
  12817. (KXMLCore::NewSpan):
  12818. (KXMLCore::DeleteSpan):
  12819. (KXMLCore::DLL_Init):
  12820. (KXMLCore::DLL_Remove):
  12821. (KXMLCore::DLL_IsEmpty):
  12822. (KXMLCore::DLL_Length):
  12823. (KXMLCore::DLL_Print):
  12824. (KXMLCore::DLL_Prepend):
  12825. (KXMLCore::DLL_InsertOrdered):
  12826. (KXMLCore::):
  12827. (KXMLCore::TCMalloc_PageHeap::GetDescriptor):
  12828. (KXMLCore::TCMalloc_PageHeap::SystemBytes):
  12829. (KXMLCore::TCMalloc_PageHeap::FreeBytes):
  12830. (KXMLCore::TCMalloc_PageHeap::RecordSpan):
  12831. (KXMLCore::TCMalloc_PageHeap::TCMalloc_PageHeap):
  12832. (KXMLCore::TCMalloc_PageHeap::New):
  12833. (KXMLCore::TCMalloc_PageHeap::Split):
  12834. (KXMLCore::TCMalloc_PageHeap::Carve):
  12835. (KXMLCore::TCMalloc_PageHeap::Delete):
  12836. (KXMLCore::TCMalloc_PageHeap::RegisterSizeClass):
  12837. (KXMLCore::TCMalloc_PageHeap::Dump):
  12838. (KXMLCore::TCMalloc_PageHeap::GrowHeap):
  12839. (KXMLCore::TCMalloc_PageHeap::Check):
  12840. (KXMLCore::TCMalloc_PageHeap::CheckList):
  12841. (KXMLCore::TCMalloc_ThreadCache_FreeList::Init):
  12842. (KXMLCore::TCMalloc_ThreadCache_FreeList::length):
  12843. (KXMLCore::TCMalloc_ThreadCache_FreeList::empty):
  12844. (KXMLCore::TCMalloc_ThreadCache_FreeList::lowwatermark):
  12845. (KXMLCore::TCMalloc_ThreadCache_FreeList::clear_lowwatermark):
  12846. (KXMLCore::TCMalloc_ThreadCache_FreeList::Push):
  12847. (KXMLCore::TCMalloc_ThreadCache_FreeList::Pop):
  12848. (KXMLCore::TCMalloc_ThreadCache::freelist_length):
  12849. (KXMLCore::TCMalloc_ThreadCache::Size):
  12850. (KXMLCore::TCMalloc_Central_FreeList::length):
  12851. (KXMLCore::TCMalloc_Central_FreeList::Init):
  12852. (KXMLCore::TCMalloc_Central_FreeList::Insert):
  12853. (KXMLCore::TCMalloc_Central_FreeList::Remove):
  12854. (KXMLCore::TCMalloc_Central_FreeList::Populate):
  12855. (KXMLCore::TCMalloc_ThreadCache::SampleAllocation):
  12856. (KXMLCore::TCMalloc_ThreadCache::Init):
  12857. (KXMLCore::TCMalloc_ThreadCache::Cleanup):
  12858. (KXMLCore::TCMalloc_ThreadCache::Allocate):
  12859. (KXMLCore::TCMalloc_ThreadCache::Deallocate):
  12860. (KXMLCore::TCMalloc_ThreadCache::FetchFromCentralCache):
  12861. (KXMLCore::TCMalloc_ThreadCache::ReleaseToCentralCache):
  12862. (KXMLCore::TCMalloc_ThreadCache::Scavenge):
  12863. (KXMLCore::TCMalloc_ThreadCache::GetCache):
  12864. (KXMLCore::TCMalloc_ThreadCache::GetCacheIfPresent):
  12865. (KXMLCore::TCMalloc_ThreadCache::PickNextSample):
  12866. (KXMLCore::TCMalloc_ThreadCache::InitModule):
  12867. (KXMLCore::TCMalloc_ThreadCache::InitTSD):
  12868. (KXMLCore::TCMalloc_ThreadCache::CreateCacheIfNecessary):
  12869. (KXMLCore::TCMalloc_ThreadCache::DeleteCache):
  12870. (KXMLCore::TCMalloc_ThreadCache::RecomputeThreadCacheSize):
  12871. (KXMLCore::TCMalloc_ThreadCache::Print):
  12872. (KXMLCore::ExtractStats):
  12873. (KXMLCore::DumpStats):
  12874. (KXMLCore::PrintStats):
  12875. (KXMLCore::DumpStackTraces):
  12876. (KXMLCore::TCMallocImplementation::GetStats):
  12877. (KXMLCore::TCMallocImplementation::ReadStackTraces):
  12878. (KXMLCore::TCMallocImplementation::GetNumericProperty):
  12879. (KXMLCore::TCMallocImplementation::SetNumericProperty):
  12880. (KXMLCore::DoSampledAllocation):
  12881. (KXMLCore::do_malloc):
  12882. (KXMLCore::do_free):
  12883. (KXMLCore::do_memalign):
  12884. (KXMLCore::TCMallocGuard::TCMallocGuard):
  12885. (KXMLCore::TCMallocGuard::~TCMallocGuard):
  12886. (KXMLCore::malloc):
  12887. (KXMLCore::free):
  12888. (KXMLCore::calloc):
  12889. (KXMLCore::cfree):
  12890. (KXMLCore::realloc):
  12891. (KXMLCore::memalign):
  12892. (KXMLCore::posix_memalign):
  12893. (KXMLCore::valloc):
  12894. (KXMLCore::pvalloc):
  12895. (KXMLCore::malloc_stats):
  12896. (KXMLCore::mallopt):
  12897. (KXMLCore::mallinfo):
  12898. * kxmlcore/FastMalloc.h: Added.
  12899. (KXMLCore::FastAllocated::operator new):
  12900. (KXMLCore::FastAllocated::operator delete):
  12901. (KXMLCore::FastAllocated::operator new[]):
  12902. (KXMLCore::FastAllocated::operator delete[]):
  12903. * kxmlcore/SharedPtr.h: Added.
  12904. (KXMLCore::SharedPtr::SharedPtr):
  12905. (KXMLCore::SharedPtr::~SharedPtr):
  12906. (KXMLCore::SharedPtr::isNull):
  12907. (KXMLCore::SharedPtr::notNull):
  12908. (KXMLCore::SharedPtr::reset):
  12909. (KXMLCore::SharedPtr::get):
  12910. (KXMLCore::SharedPtr::operator*):
  12911. (KXMLCore::SharedPtr::operator->):
  12912. (KXMLCore::SharedPtr::operator!):
  12913. (KXMLCore::SharedPtr::operator bool):
  12914. (KXMLCore::::operator):
  12915. (KXMLCore::operator==):
  12916. (KXMLCore::operator!=):
  12917. (KXMLCore::static_pointer_cast):
  12918. (KXMLCore::const_pointer_cast):
  12919. * kxmlcore/TCPageMap.h: Added.
  12920. (TCMalloc_PageMap1::TCMalloc_PageMap1):
  12921. (TCMalloc_PageMap1::Ensure):
  12922. (TCMalloc_PageMap1::get):
  12923. (TCMalloc_PageMap1::set):
  12924. (TCMalloc_PageMap2::TCMalloc_PageMap2):
  12925. (TCMalloc_PageMap2::get):
  12926. (TCMalloc_PageMap2::set):
  12927. (TCMalloc_PageMap2::Ensure):
  12928. (TCMalloc_PageMap3::NewNode):
  12929. (TCMalloc_PageMap3::TCMalloc_PageMap3):
  12930. (TCMalloc_PageMap3::get):
  12931. (TCMalloc_PageMap3::set):
  12932. (TCMalloc_PageMap3::Ensure):
  12933. * kxmlcore/TCSpinLock.h: Added.
  12934. (TCMalloc_SpinLock::Init):
  12935. (TCMalloc_SpinLock::Finalize):
  12936. (TCMalloc_SpinLock::Lock):
  12937. (TCMalloc_SpinLock::Unlock):
  12938. (TCMalloc_SlowLock):
  12939. (TCMalloc_SpinLockHolder::TCMalloc_SpinLockHolder):
  12940. (TCMalloc_SpinLockHolder::~TCMalloc_SpinLockHolder):
  12941. * kxmlcore/TCSystemAlloc.cpp: Added.
  12942. (TrySbrk):
  12943. (TryMmap):
  12944. (TryDevMem):
  12945. (TCMalloc_SystemAlloc):
  12946. * kxmlcore/TCSystemAlloc.h: Added.
  12947. 2005-09-23 Maciej Stachowiak <mjs@apple.com>
  12948. Reviewed by Darin.
  12949. <rdar://problem/4260479> Finish deploying PropertySlot in the interpreter
  12950. http://bugs.webkit.org/show_bug.cgi?id=5112
  12951. Convert postfix, prefix, delete, prefix, and for..in expressions to use
  12952. PropertySlot-based lookup instead of evaluateReference.
  12953. 3% speedup on JS iBench.
  12954. Fixed two of the JS tests:
  12955. * tests/mozilla/expected.html:
  12956. * kjs/grammar.y:
  12957. * kjs/nodes.cpp:
  12958. (PostfixResolveNode::evaluate):
  12959. (PostfixBracketNode::evaluate):
  12960. (PostfixDotNode::evaluate):
  12961. (DeleteResolveNode::evaluate):
  12962. (DeleteBracketNode::evaluate):
  12963. (DeleteDotNode::evaluate):
  12964. (DeleteValueNode::evaluate):
  12965. (typeStringForValue):
  12966. (TypeOfResolveNode::evaluate):
  12967. (TypeOfValueNode::evaluate):
  12968. (PrefixResolveNode::evaluate):
  12969. (PrefixBracketNode::evaluate):
  12970. (PrefixDotNode::evaluate):
  12971. (ForInNode::execute):
  12972. * kjs/nodes.h:
  12973. (KJS::PostfixResolveNode::PostfixResolveNode):
  12974. (KJS::PostfixBracketNode::PostfixBracketNode):
  12975. (KJS::PostfixDotNode::PostfixDotNode):
  12976. (KJS::DeleteResolveNode::DeleteResolveNode):
  12977. (KJS::DeleteBracketNode::DeleteBracketNode):
  12978. (KJS::DeleteDotNode::DeleteDotNode):
  12979. (KJS::DeleteValueNode::DeleteValueNode):
  12980. (KJS::TypeOfResolveNode::TypeOfResolveNode):
  12981. (KJS::TypeOfValueNode::TypeOfValueNode):
  12982. (KJS::PrefixResolveNode::PrefixResolveNode):
  12983. (KJS::PrefixBracketNode::PrefixBracketNode):
  12984. (KJS::PrefixDotNode::PrefixDotNode):
  12985. * kjs/nodes2string.cpp:
  12986. (PostfixResolveNode::streamTo):
  12987. (PostfixBracketNode::streamTo):
  12988. (PostfixDotNode::streamTo):
  12989. (DeleteResolveNode::streamTo):
  12990. (DeleteBracketNode::streamTo):
  12991. (DeleteDotNode::streamTo):
  12992. (DeleteValueNode::streamTo):
  12993. (TypeOfValueNode::streamTo):
  12994. (TypeOfResolveNode::streamTo):
  12995. (PrefixResolveNode::streamTo):
  12996. (PrefixBracketNode::streamTo):
  12997. (PrefixDotNode::streamTo):
  12998. * kjs/reference.cpp:
  12999. (KJS::Reference::Reference):
  13000. (KJS::Reference::getPropertyName):
  13001. (KJS::Reference::getValue):
  13002. (KJS::Reference::deleteValue):
  13003. * kjs/reference.h:
  13004. 2005-09-23 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  13005. Reviewed and landed by Darin.
  13006. - a Windows-specific file
  13007. * os-win32/stdint.h: Added. We plan to remove dependency on the <stdint.h> types,
  13008. and if we do so, we will remove this file.
  13009. 2005-09-22 Geoffrey Garen <ggaren@apple.com>
  13010. - Fixed http://bugs.webkit.org/show_bug.cgi?id=5053
  13011. Need to restore int/long changes to simple_number.h
  13012. Reviewed by darin and mjs.
  13013. * kjs/simple_number.h: changed enums to indenpendent constants to clarify types
  13014. (KJS::isNegativeZero): changed to static function - no reason to export
  13015. (KJS::SimpleNumber::rightShiftSignExtended): new function for clarity
  13016. (KJS::SimpleNumber::make): specified cast as reinterpret_cast
  13017. (KJS::SimpleNumber::is): changed to use uintptr_t for portability
  13018. (KJS::SimpleNumber::value): changed to use uintptr_t and rightShiftSignExtended
  13019. (KJS::SimpleNumber::fits): inverted tests - probably only a performance win for double
  13020. (KJS::SimpleNumber::integerFits): ditto
  13021. 2005-09-20 Maciej Stachowiak <mjs@apple.com>
  13022. Reviewed by Geoff and partly by Darin.
  13023. - fixed http://bugs.webkit.org/post_bug.cgi
  13024. (Reduce conflicts in JavaScriptCore grammar)
  13025. This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
  13026. 9 shift/reduce and 45 reduce/reduce.
  13027. * kjs/grammar.y:
  13028. * kjs/grammar_types.h: Removed.
  13029. * kjs/lexer.cpp:
  13030. * kjs/nodes.h:
  13031. (KJS::Node::isGroupNode):
  13032. (KJS::Node::isLocation):
  13033. (KJS::Node::isResolveNode):
  13034. (KJS::Node::isBracketAccessorNode):
  13035. (KJS::Node::isDotAccessorNode):
  13036. (KJS::ResolveNode::isLocation):
  13037. (KJS::ResolveNode::isResolveNode):
  13038. (KJS::ResolveNode::identifier):
  13039. (KJS::GroupNode::isGroupNode):
  13040. (KJS::GroupNode::leafNode):
  13041. (KJS::BracketAccessorNode::isLocation):
  13042. (KJS::BracketAccessorNode::isBracketAccessorNode):
  13043. (KJS::BracketAccessorNode::base):
  13044. (KJS::BracketAccessorNode::subscript):
  13045. (KJS::DotAccessorNode::isLocation):
  13046. (KJS::DotAccessorNode::isDotAccessorNode):
  13047. (KJS::DotAccessorNode::base):
  13048. (KJS::DotAccessorNode::identifier):
  13049. (KJS::FuncExprNode::FuncExprNode):
  13050. (KJS::FuncExprNode::identifier):
  13051. (KJS::FuncDeclNode::FuncDeclNode):
  13052. (KJS::FuncDeclNode::execute):
  13053. 2005-09-20 Geoffrey Garen <ggaren@apple.com>
  13054. - Oops. The 4263434 change was only appropriate on the branch. Rolling out.
  13055. Reviewed by eric.
  13056. * kjs/internal.cpp:
  13057. (KJS::InterpreterImp::mark):
  13058. 2005-09-20 Geoffrey Garen <ggaren@apple.com>
  13059. - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
  13060. kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
  13061. the installer)
  13062. Added InterpreterLocks in some places in the bindings we missed before.
  13063. Reviewed by john.
  13064. * bindings/runtime_root.cpp:
  13065. (KJS::Bindings::addNativeReference):
  13066. (KJS::Bindings::removeNativeReference):
  13067. (RootObject::removeAllNativeReferences):
  13068. * bindings/runtime_root.h:
  13069. (KJS::Bindings::RootObject::~RootObject):
  13070. (KJS::Bindings::RootObject::setRootObjectImp):
  13071. 2005-09-20 Geoffrey Garen <ggaren@apple.com>
  13072. - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
  13073. KJS::InterpreterImp::mark() crash
  13074. Fix by mjs, review by me.
  13075. * kjs/internal.cpp:
  13076. (KJS::InterpreterImp::mark): Added a null check on globExec in case a
  13077. garbage collection occurs inside InterpreterImp::globalInit (called
  13078. from InterpreterImp::InterpreterImp), at which point globExec has not yet been initialized.
  13079. 2005-09-20 Geoffrey Garen <ggaren@apple.com>
  13080. - Rolled in fix for http://bugs.webkit.org/show_bug.cgi?id=4892
  13081. Date constructor has problems with months larger than 11
  13082. Test cases added:
  13083. * layout-tests/fast/js/date-big-constructor-expected.txt: Added.
  13084. * layout-tests/fast/js/date-big-constructor.html: Added.
  13085. Reviewed by darin.
  13086. * kjs/date_object.cpp:
  13087. (KJS::fillStructuresUsingDateArgs):
  13088. (KJS::makeTime):
  13089. 2005-09-19 Geoffrey Garen <ggaren@apple.com>
  13090. - Fixed http://bugs.webkit.org/show_bug.cgi?id=5028
  13091. 9 layout tests fail following the change from long to int
  13092. - Rolled out changes to simple_number.h, and added fits(long long)
  13093. and SimpleNumber::fits(unsigned long long) to the old system.
  13094. Reviewed by mjs.
  13095. * kjs/simple_number.h:
  13096. (KJS::SimpleNumber::):
  13097. (KJS::SimpleNumber::value):
  13098. (KJS::SimpleNumber::fits):
  13099. (KJS::SimpleNumber::integerFits):
  13100. (KJS::SimpleNumber::make):
  13101. 2005-09-14 Maciej Stachowiak <mjs@apple.com>
  13102. Reviewed by Geoff.
  13103. - fixed <rdar://problem/4214783> REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer)
  13104. Make sure to lock using the InterpreterLock class in all places that need it
  13105. (including anything that uses the collector, the parser, the protect count hash table,
  13106. and anything that allocates via fast_malloc).
  13107. Also added assertions to ensure that the locking rules are followed for the relevant
  13108. resources.
  13109. * Makefile.am:
  13110. * bindings/NP_jsobject.cpp:
  13111. (identifierFromNPIdentifier):
  13112. (_NPN_Invoke):
  13113. (_NPN_Evaluate):
  13114. (_NPN_GetProperty):
  13115. (_NPN_SetProperty):
  13116. (_NPN_RemoveProperty):
  13117. (_NPN_HasProperty):
  13118. (_NPN_HasMethod):
  13119. (_NPN_SetException):
  13120. * bindings/jni/jni_jsobject.cpp:
  13121. (JSObject::call):
  13122. (JSObject::eval):
  13123. (JSObject::getMember):
  13124. (JSObject::setMember):
  13125. (JSObject::removeMember):
  13126. (JSObject::getSlot):
  13127. (JSObject::setSlot):
  13128. (JSObject::toString):
  13129. (JSObject::convertJObjectToValue):
  13130. * bindings/objc/WebScriptObject.mm:
  13131. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  13132. (-[WebScriptObject evaluateWebScript:]):
  13133. (-[WebScriptObject setValue:forKey:]):
  13134. (-[WebScriptObject valueForKey:]):
  13135. (-[WebScriptObject removeWebScriptKey:]):
  13136. (-[WebScriptObject stringRepresentation]):
  13137. (-[WebScriptObject webScriptValueAtIndex:]):
  13138. (-[WebScriptObject setWebScriptValueAtIndex:value:]):
  13139. (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
  13140. * bindings/runtime.cpp:
  13141. (Instance::createRuntimeObject):
  13142. * bindings/runtime_root.h:
  13143. * bindings/testbindings.cpp:
  13144. (main):
  13145. * bindings/testbindings.mm:
  13146. (main):
  13147. * kjs/fast_malloc.cpp:
  13148. (KJS::kjs_fast_malloc):
  13149. (KJS::kjs_fast_calloc):
  13150. (KJS::kjs_fast_free):
  13151. (KJS::kjs_fast_realloc):
  13152. * kjs/fast_malloc.h:
  13153. * kjs/identifier.h:
  13154. * kjs/internal.cpp:
  13155. (InterpreterImp::InterpreterImp):
  13156. (InterpreterImp::clear):
  13157. (InterpreterImp::mark):
  13158. (InterpreterImp::checkSyntax):
  13159. (InterpreterImp::evaluate):
  13160. * kjs/internal.h:
  13161. (KJS::InterpreterImp::globalObject):
  13162. * kjs/interpreter.cpp:
  13163. (Interpreter::evaluate):
  13164. * kjs/interpreter.h:
  13165. (KJS::InterpreterLock::InterpreterLock):
  13166. (KJS::InterpreterLock::~InterpreterLock):
  13167. * kjs/nodes.h:
  13168. * kjs/protect.h:
  13169. (KJS::ProtectedValue::ProtectedValue):
  13170. (KJS::ProtectedValue::~ProtectedValue):
  13171. (KJS::ProtectedValue::operator=):
  13172. (KJS::ProtectedObject::ProtectedObject):
  13173. (KJS::ProtectedObject::~ProtectedObject):
  13174. (KJS::ProtectedObject::operator=):
  13175. (KJS::ProtectedReference::ProtectedReference):
  13176. (KJS::ProtectedReference::~ProtectedReference):
  13177. (KJS::ProtectedReference::operator=):
  13178. * kjs/protected_object.h:
  13179. * kjs/protected_values.cpp:
  13180. (KJS::ProtectedValues::getProtectCount):
  13181. (KJS::ProtectedValues::increaseProtectCount):
  13182. (KJS::ProtectedValues::decreaseProtectCount):
  13183. * kjs/string_object.cpp:
  13184. (StringObjectImp::StringObjectImp):
  13185. * kjs/testkjs.cpp:
  13186. (main):
  13187. 2005-09-16 Adele Peterson <adele@apple.com>
  13188. Change by Darin, reviewed by me and Maciej.
  13189. Fixes http://bugs.webkit.org/show_bug.cgi?id=4547
  13190. use int instead of long for 32-bit (to prepare for LP64 compiling)
  13191. * bindings/c/c_class.h:
  13192. (KJS::Bindings::CClass::constructorAt):
  13193. (KJS::Bindings::CClass::numConstructors):
  13194. * bindings/c/c_runtime.h:
  13195. (KJS::Bindings::CMethod::numParameters):
  13196. * bindings/jni/jni_class.cpp:
  13197. (JavaClass::JavaClass):
  13198. * bindings/jni/jni_class.h:
  13199. (KJS::Bindings::JavaClass::constructorAt):
  13200. (KJS::Bindings::JavaClass::numConstructors):
  13201. * bindings/jni/jni_instance.cpp:
  13202. (JavaInstance::invokeMethod):
  13203. * bindings/jni/jni_jsobject.cpp:
  13204. (JSObject::convertJObjectToValue):
  13205. (JSObject::listFromJArray):
  13206. * bindings/jni/jni_runtime.cpp:
  13207. (JavaMethod::JavaMethod):
  13208. * bindings/jni/jni_runtime.h:
  13209. (KJS::Bindings::JavaConstructor::_commonCopy):
  13210. (KJS::Bindings::JavaConstructor::parameterAt):
  13211. (KJS::Bindings::JavaConstructor::numParameters):
  13212. (KJS::Bindings::JavaMethod::_commonCopy):
  13213. (KJS::Bindings::JavaMethod::parameterAt):
  13214. (KJS::Bindings::JavaMethod::numParameters):
  13215. * bindings/npapi.h:
  13216. * bindings/objc/WebScriptObject.mm:
  13217. (listFromNSArray):
  13218. * bindings/objc/objc_class.h:
  13219. (KJS::Bindings::ObjcClass::constructorAt):
  13220. (KJS::Bindings::ObjcClass::numConstructors):
  13221. * bindings/objc/objc_instance.h:
  13222. * bindings/objc/objc_runtime.h:
  13223. * bindings/objc/objc_runtime.mm:
  13224. (ObjcMethod::numParameters):
  13225. * bindings/runtime.h:
  13226. * kjs/identifier.h:
  13227. * kjs/internal.h:
  13228. * kjs/property_slot.h:
  13229. (KJS::PropertySlot::setCustomIndex):
  13230. (KJS::PropertySlot::index):
  13231. (KJS::PropertySlot::):
  13232. * kjs/regexp_object.cpp:
  13233. (RegExpObjectImp::backrefGetter):
  13234. (RegExpObjectImp::getOwnPropertySlot):
  13235. * kjs/simple_number.h:
  13236. (KJS::SimpleNumber::):
  13237. (KJS::SimpleNumber::value):
  13238. (KJS::SimpleNumber::fits):
  13239. (KJS::SimpleNumber::integerFits):
  13240. (KJS::SimpleNumber::make):
  13241. * kjs/string_object.cpp:
  13242. (substituteBackreferences):
  13243. * kjs/ustring.cpp:
  13244. (KJS::UString::from):
  13245. (KJS::UString::toUInt32):
  13246. (KJS::UString::find):
  13247. (KJS::UString::rfind):
  13248. * kjs/ustring.h:
  13249. * kjs/value.cpp:
  13250. (KJS::jsNumber):
  13251. * kjs/value.h:
  13252. 2005-09-11 Eric Seidel <eseidel@apple.com>
  13253. No review requested, build fix affects only SVG.
  13254. * JavaScriptCore.xcodeproj/project.pbxproj: Fixed JSC+SVG
  13255. Fixed JavaScriptCore+SVG after PCRE 6.1 merger.
  13256. http://bugs.webkit.org/show_bug.cgi?id=4932
  13257. 2005-09-10 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  13258. Reviewed and landed by Darin.
  13259. * Makefile.vc: Added.
  13260. * README-Win32.txt: Added.
  13261. 2005-09-10 Darin Adler <darin@apple.com>
  13262. - fixed compilation for WebCore (another try)
  13263. * kjs/simple_number.h: Added more "using" lines.
  13264. 2005-09-10 Darin Adler <darin@apple.com>
  13265. - fixed compilation for WebCore
  13266. * kjs/simple_number.h: Have to include <cmath> here to work around a bug in the GCC
  13267. standard C++ library headers.
  13268. 2005-09-10 Darin Adler <darin@apple.com>
  13269. Windows changes by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
  13270. - fixed http://bugs.webkit.org/show_bug.cgi?id=4870
  13271. win portability: fix IS_NEGATIVE_ZERO macro in simple_number.h
  13272. * kjs/simple_number.h:
  13273. (KJS::isNegativeZero): Added. Inline function. Has a case for Windows that
  13274. uses _fpclass and a case for other platforms that uses signbit.
  13275. (KJS::SimpleNumber::fits): Use inline isNegativeZero instead of macro IS_NEGATIVE_ZERO.
  13276. * kjs/internal.cpp: Remove definition of now-unneeded negZero global.
  13277. * kjs/value.cpp: Touched the file because Xcode didn't know it needed to
  13278. recompile it.
  13279. - improved test engine
  13280. * tests/mozilla/jsDriver.pl: Sort tests in numeric order instead of using
  13281. a plain-ASCII sort; now test 33 will be after test 5 in any given set of
  13282. numbered tests.
  13283. 2005-09-08 Darin Adler <darin@apple.com>
  13284. - fixed overloaded versions of throwError so that they substitute *all*
  13285. expected parameters into the message string -- some versions used to
  13286. skip parameters, resulting in "%s" being printed in the error message.
  13287. Reviewed by Geoff.
  13288. * kjs/nodes.h: Updated declarations to use "const &" and not to name parameters
  13289. * kjs/nodes.cpp: (Node::throwError): Updated to match above and add one missing
  13290. call to substitute.
  13291. 2005-09-08 Darin Adler <darin@apple.com>
  13292. Reviewed by Geoff.
  13293. - updated to PCRE 6.1
  13294. The original PCRE 6.1 sources are checked into the tree with the tag
  13295. "pcre-6-1" for reference. What we're checking in right now is the original
  13296. plus our changes to make it support UTF-16 and at least one other tweak
  13297. (vertical tab considered whitespace). Our work to get our changes was
  13298. done on "pcre-6-1-branch", with an anchor at "pcre-6-1-anchor" so you can
  13299. see the evolution of the UTF-16 changes.
  13300. Note also that there was one small change made here that's not on the branch
  13301. in pcre_compile.c.
  13302. * Info.plist: Updated the part of the copyright message that's about PCRE.
  13303. * JavaScriptCore.xcodeproj/project.pbxproj: Added new PCRE source files,
  13304. removed obsolete ones.
  13305. * pcre/AUTHORS: Updated to PCRE 6.1. Includes credits for Apple's UTF-16
  13306. changes, but not the credits for Google's C++ wrapper, since we don't include that.
  13307. * pcre/COPYING: Updated to PCRE 6.1.
  13308. * pcre/LICENCE: Ditto.
  13309. * pcre/dftables.c: Ditto.
  13310. * pcre/pcre-config.h: Ditto.
  13311. * pcre/pcre.h: Ditto.
  13312. * pcre/pcre_compile.c: Added for PCRE 6.1.
  13313. * pcre/pcre_config.c: Ditto.
  13314. * pcre/pcre_exec.c: Ditto.
  13315. * pcre/pcre_fullinfo.c: Ditto.
  13316. * pcre/pcre_get.c: Ditto.
  13317. * pcre/pcre_globals.c: Ditto.
  13318. * pcre/pcre_info.c: Ditto.
  13319. * pcre/pcre_internal.h: Ditto.
  13320. * pcre/pcre_maketables.c: Ditto.
  13321. * pcre/pcre_ord2utf8.c: Ditto.
  13322. * pcre/pcre_printint.c: Ditto.
  13323. * pcre/pcre_refcount.c: Ditto.
  13324. * pcre/pcre_study.c: Ditto.
  13325. * pcre/pcre_tables.c: Ditto.
  13326. * pcre/pcre_try_flipped.c: Ditto.
  13327. * pcre/pcre_ucp_findchar.c: Ditto.
  13328. * pcre/pcre_version.c: Ditto.
  13329. * pcre/pcre_xclass.c: Ditto.
  13330. * pcre/ucp.h: Ditto.
  13331. * pcre/ucp_findchar.c: Ditto.
  13332. * pcre/ucpinternal.h: Ditto.
  13333. * pcre/ucptable.c: Ditto.
  13334. * pcre/get.c: Removed.
  13335. * pcre/internal.h: Removed.
  13336. * pcre/maketables.c: Removed.
  13337. * pcre/pcre.c: Removed.
  13338. * pcre/study.c: Removed.
  13339. 2005-09-07 Geoffrey Garen <ggaren@apple.com>
  13340. -fixed http://bugs.webkit.org/show_bug.cgi?id=4781
  13341. Date.setMonth fails with big values due to overflow
  13342. Reviewed by darin.
  13343. * kjs/date_object.cpp:
  13344. (timetUsingCF): for consistency, changed return statement to invalidDate instead of LONG_MAX
  13345. (KJS::fillStructuresUsingTimeArgs): modified for readability
  13346. (KJS::fillStructuresUsingDateArgs): new function analogous to fillStructuresUsingTimeArgs
  13347. (KJS::DateProtoFuncImp::callAsFunction): modified to use fillStructuresUsingDateArgs
  13348. (KJS::DateObjectImp::construct): moved variable declaration to proper scope
  13349. (KJS::DateObjectFuncImp::callAsFunction): moved variable declaration to proper scope
  13350. 2005-09-07 Geoffrey Garen <ggaren@apple.com>
  13351. -updated expected test results to reflect fix for
  13352. http://bugs.webkit.org/show_bug.cgi?id=4698
  13353. kjs does not allow named functions in function expressions
  13354. * tests/mozilla/expected.html:
  13355. 2005-09-04 Darin Adler <darin@apple.com>
  13356. * kjs/identifier.cpp: Fix comment, add missing include.
  13357. (Follow-on to changes from yesterday.)
  13358. 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  13359. Reviewed, tweaked and landed by Darin.
  13360. - another try at some of the Windows compilation fixes
  13361. should fix these bugs: 4546, 4831, 4834, 4643, 4830, 4832, 4833, 4835
  13362. * kjs/collector.cpp: Add missing <setjmp.h> include.
  13363. * kjs/date_object.cpp: Fix broken copysign macro.
  13364. * kjs/dtoa.cpp: Move macro definitions down after all header includes.
  13365. * kjs/fast_malloc.cpp: Add missing <assert.h> and <stddef.h> includes.
  13366. * kjs/function.cpp: Remove broken isxdigit definition.
  13367. * kjs/grammar.y: Add a missing semicolon (and remove an excess one).
  13368. * kjs/identifier.cpp: Turn off AVOID_STATIC_CONSTRUCTORS because the placement new syntax
  13369. doesn't seem to work in Visual C++ (I'm surprised to hear that, by the way).
  13370. * kjs/value.h: Made ValueImp's destructor virtual because otherwise pointers to ValueImp
  13371. on the stack aren't right for garbage collection on Windows (don't think it works that
  13372. way with gcc's virtual table scheme, but it's a harmless change).
  13373. 2005-09-03 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
  13374. Reviewed, tweaked and landed by Darin.
  13375. - some Windows compilation fixes, hoping to fix the problems reported in these bugs:
  13376. 4627, 4629, 4630, 4631, 4632, 4633, 4634, 4635, 4636, 4637, 4639, 4640, 4641, 4644, 4645
  13377. * kjs/collector.cpp: Include <windows.h> on WIN32. Put thread-related code inside
  13378. KJS_MULTIPLE_THREADS #if directives.
  13379. (KJS::Collector::markCurrentThreadConservatively): Use NT_TIB to find the stack base on Win32.
  13380. * kjs/config.h: Define HAVE_SYS_TIMEB_H for Win32.
  13381. * kjs/date_object.cpp: Add include of <limits.h>. Add definitions of strncasecmp, isfinite, and
  13382. copysign for Win32.
  13383. (KJS::KRFCDate_parseDate): Move "errno = 0" line down closer to the first call to strol -- I believe
  13384. that on Win32 there's some other call before that setting errno.
  13385. * kjs/date_object.h: Remove unneeded include of <sys/time.h>.
  13386. * kjs/dtoa.cpp: Add an undef of strtod, needed on Win32.
  13387. * kjs/fast_malloc.cpp: Put #if !WIN32 around some customization that's not appropriate on Win32.
  13388. (KJS::region_list_append): Add a missing cast so this Win32-specific function compiles in C++.
  13389. (KJS::sbrk): Change parameter type to match the declaration.
  13390. * kjs/function.cpp: (isxdigit): Define a locale-independent isxdigit on Win32.
  13391. * kjs/function.h: Remove unneeded friend class Function for FunctionImp.
  13392. * kjs/identifier.cpp: Took out the APPLE_CHANGES from around the AVOID_STATIC_CONSTRUCTORS
  13393. define. We ultimately intend to phase out APPLE_CHANGES entirely. Also fix the
  13394. non-AVOID_STATIC_CONSTRUCTORS code path.
  13395. * kjs/internal.cpp: Remove uneeded include of <strings.h>, which was confused with <string.h>!
  13396. Add a Win32 implementation of copysign. Put the threads code inside KJS_MULTIPLE_THREADS.
  13397. * kjs/internal.h: Define a KJS_MULTIPLE_THREADS macro on non-Win32 only. Later we can make this
  13398. specific to Mac OS X if we like.
  13399. * kjs/interpreter_map.cpp: Add missing include of <stdlib.h>.
  13400. * kjs/list.cpp:
  13401. (KJS::ListImp::markValues): Use std::min instead of MIN.
  13402. (KJS::List::copy): Ditto.
  13403. (KJS::List::copyTail): Ditto.
  13404. * kjs/math_object.cpp: (signbit): Add a Win32 implementation of signbit.
  13405. * kjs/nodes.cpp: (Node::finalCheck): Use unsigned instead of uint.
  13406. Put the use of always_inline inside __GNUC__.
  13407. * kjs/number_object.cpp: (NumberProtoFuncImp::callAsFunction): Use "10.0" instead of "10"
  13408. inside all the calls to pow to avoid ambiguity caused by overloading of pow on Win32, seen
  13409. when passing an int rather than a double or float.
  13410. * kjs/operations.cpp:
  13411. (KJS::isInf): Add Win32 implementation.
  13412. (KJS::isPosInf): Add Win32 implementation.
  13413. (KJS::isNegInf): Add Win32 implementation.
  13414. * kjs/regexp.cpp: Use unsigned instead of uint.
  13415. * kjs/regexp.h: Ditto.
  13416. * kjs/regexp_object.cpp: Ditto.
  13417. * kjs/regexp_object.h: Ditto.
  13418. 2005-09-02 Beth Dakin <bdakin@apple.com>
  13419. Fix for <rdar://problem/4235531> Denver Regression: Safari crash in KWQStringData::makeUnicode
  13420. The other half of the fix is in WebCore.
  13421. Fix written by Maciej and Darin.
  13422. Reviewed by me/Maciej
  13423. As Maciej said in Radar: These problems was caused by a conflict between some of our custom
  13424. allocators, causing them to return null. Symptom is typically a null pointer dereference in
  13425. a place where it might be expected an allocation has just occurred.
  13426. * kjs/fast_malloc.cpp: Added #define for MORECORE_CONTIGUOUS, MORECORE_CANNOT_TRIM,
  13427. and MALLOC_FAILURE_ACTION.
  13428. 2005-08-31 Geoffrey Garen <ggaren@apple.com>
  13429. -rolled in fix for http://bugs.webkit.org/show_bug.cgi?id=4698
  13430. kjs does not allow named functions in function expressions
  13431. Fix by Arthur Langereis.
  13432. Reviewed by darin.
  13433. * kjs/grammar.y:
  13434. * kjs/nodes.cpp:
  13435. (FuncExprNode::evaluate):
  13436. * kjs/nodes.h:
  13437. (KJS::FuncExprNode::FuncExprNode):
  13438. Test cases added:
  13439. * layout-tests/fast/js/named-function-expression-expected.txt: Added.
  13440. * layout-tests/fast/js/named-function-expression.html: Added.
  13441. 2005-08-31 Justin Haygood <justin@xiondigital.net>
  13442. Reviewed, tweaked, and landed by Darin.
  13443. - fixed http://bugs.webkit.org/show_bug.cgi?id=4085
  13444. - fixed http://bugs.webkit.org/show_bug.cgi?id=4087
  13445. - fixed http://bugs.webkit.org/show_bug.cgi?id=4096
  13446. Some fixes for compiling on windows.
  13447. * kjs/config.h: Added a WIN32 case in here, with suitable defines.
  13448. (To be tweaked as necessary.)
  13449. * kjs/function.cpp: Took out APPLE_CHANGES around use of ICU.
  13450. * kjs/operations.cpp: Removed some bogus code that always set HAVE_FLOAT_H.
  13451. 2005-08-30 Darin Adler <darin@apple.com>
  13452. Reviewed by John Sullivan.
  13453. - fixed http://bugs.webkit.org/show_bug.cgi?id=4758
  13454. unify SharedPtr in WebCore and JavaScriptCore
  13455. * kjs/shared_ptr.h: Updated namespace to KXMLCore instead of kxhmlcore.
  13456. Made a few small improvements to use local variables a bit more and added
  13457. an "operator int" to reduce the chance that we'll convert a SharedPtr to
  13458. an int by accident. Also made the == operators normal functions rather than
  13459. friend functions, added a couple of comemnts.
  13460. * kjs/function.h: Updated for namespace change.
  13461. * kjs/function.cpp: Ditto.
  13462. * kjs/function_object.cpp: Ditto.
  13463. * kjs/internal.h: Ditto.
  13464. * kjs/internal.cpp: Ditto.
  13465. * kjs/nodes.h: Ditto.
  13466. * kjs/nodes2string.cpp: Ditto.
  13467. 2005-08-26 Maciej Stachowiak <mjs@apple.com>
  13468. Reviewed by John.
  13469. <rdar://problem/4224911> many many leaks in kjsyyparse with malformed Javascript
  13470. Record all nodes that are created during parsing, and delete any
  13471. that are left floating with a refcount of 0.
  13472. * kjs/internal.cpp:
  13473. (KJS::Parser::saveNewNode):
  13474. (KJS::clearNewNodes):
  13475. (KJS::Parser::parse):
  13476. * kjs/internal.h:
  13477. * kjs/nodes.cpp:
  13478. (Node::Node):
  13479. * kjs/nodes.h:
  13480. (KJS::Node::refcount):
  13481. 2005-08-26 Maciej Stachowiak <mjs@apple.com>
  13482. Reviewed by John.
  13483. - fixed <rdar://problem/4232452> many many leaks in kjsyyparse on some well-formed JavaScript (can repro on sony.com, webkit tests)
  13484. Fixed by changing the refcounting scheme for nodes. Instead of each node implementing a custom ref and
  13485. deref for all its children (and being responsible for deleting them), nodes use a smart pointer to
  13486. hold their children, and smart pointers are used outside the node tree as well. This change mostly
  13487. removes code.
  13488. * JavaScriptCore.xcodeproj/project.pbxproj:
  13489. * kjs/function.cpp:
  13490. (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
  13491. (KJS::GlobalFuncImp::callAsFunction):
  13492. * kjs/function.h:
  13493. * kjs/function_object.cpp:
  13494. (FunctionObjectImp::construct):
  13495. * kjs/grammar.y:
  13496. * kjs/internal.cpp:
  13497. (KJS::Parser::parse):
  13498. (KJS::Parser::accept):
  13499. (KJS::InterpreterImp::checkSyntax):
  13500. (KJS::InterpreterImp::evaluate):
  13501. * kjs/internal.h:
  13502. * kjs/nodes.cpp:
  13503. (Node::Node):
  13504. (Node::~Node):
  13505. (ElementNode::evaluate):
  13506. (PropertyValueNode::evaluate):
  13507. (ArgumentListNode::evaluateList):
  13508. (NewExprNode::evaluate):
  13509. (FunctionCallValueNode::evaluate):
  13510. (FunctionCallBracketNode::evaluate):
  13511. (FunctionCallDotNode::evaluate):
  13512. (RelationalNode::evaluate):
  13513. (StatListNode::execute):
  13514. (StatListNode::processVarDecls):
  13515. (VarDeclListNode::evaluate):
  13516. (VarDeclListNode::processVarDecls):
  13517. (ForInNode::ForInNode):
  13518. (ClauseListNode::processVarDecls):
  13519. (CaseBlockNode::evalBlock):
  13520. (FuncDeclNode::processFuncDecl):
  13521. (FuncExprNode::evaluate):
  13522. (SourceElementsNode::execute):
  13523. (SourceElementsNode::processFuncDecl):
  13524. (SourceElementsNode::processVarDecls):
  13525. * kjs/nodes.h:
  13526. (KJS::Node::ref):
  13527. (KJS::Node::deref):
  13528. (KJS::NumberNode::NumberNode):
  13529. (KJS::GroupNode::GroupNode):
  13530. (KJS::ElementNode::ElementNode):
  13531. (KJS::ArrayNode::ArrayNode):
  13532. (KJS::PropertyValueNode::PropertyValueNode):
  13533. (KJS::ObjectLiteralNode::ObjectLiteralNode):
  13534. (KJS::BracketAccessorNode::BracketAccessorNode):
  13535. (KJS::DotAccessorNode::DotAccessorNode):
  13536. (KJS::ArgumentListNode::ArgumentListNode):
  13537. (KJS::ArgumentsNode::ArgumentsNode):
  13538. (KJS::NewExprNode::NewExprNode):
  13539. (KJS::FunctionCallValueNode::FunctionCallValueNode):
  13540. (KJS::FunctionCallResolveNode::FunctionCallResolveNode):
  13541. (KJS::FunctionCallBracketNode::FunctionCallBracketNode):
  13542. (KJS::FunctionCallDotNode::FunctionCallDotNode):
  13543. (KJS::PostfixNode::PostfixNode):
  13544. (KJS::DeleteNode::DeleteNode):
  13545. (KJS::VoidNode::VoidNode):
  13546. (KJS::TypeOfNode::TypeOfNode):
  13547. (KJS::PrefixNode::PrefixNode):
  13548. (KJS::UnaryPlusNode::UnaryPlusNode):
  13549. (KJS::NegateNode::NegateNode):
  13550. (KJS::BitwiseNotNode::BitwiseNotNode):
  13551. (KJS::LogicalNotNode::LogicalNotNode):
  13552. (KJS::MultNode::MultNode):
  13553. (KJS::AddNode::AddNode):
  13554. (KJS::ShiftNode::ShiftNode):
  13555. (KJS::RelationalNode::RelationalNode):
  13556. (KJS::EqualNode::EqualNode):
  13557. (KJS::BitOperNode::BitOperNode):
  13558. (KJS::BinaryLogicalNode::BinaryLogicalNode):
  13559. (KJS::ConditionalNode::ConditionalNode):
  13560. (KJS::AssignResolveNode::AssignResolveNode):
  13561. (KJS::AssignBracketNode::AssignBracketNode):
  13562. (KJS::AssignDotNode::AssignDotNode):
  13563. (KJS::CommaNode::CommaNode):
  13564. (KJS::AssignExprNode::AssignExprNode):
  13565. (KJS::VarDeclListNode::VarDeclListNode):
  13566. (KJS::VarStatementNode::VarStatementNode):
  13567. (KJS::ExprStatementNode::ExprStatementNode):
  13568. (KJS::IfNode::IfNode):
  13569. (KJS::DoWhileNode::DoWhileNode):
  13570. (KJS::WhileNode::WhileNode):
  13571. (KJS::ForNode::ForNode):
  13572. (KJS::ReturnNode::ReturnNode):
  13573. (KJS::WithNode::WithNode):
  13574. (KJS::CaseClauseNode::CaseClauseNode):
  13575. (KJS::ClauseListNode::ClauseListNode):
  13576. (KJS::ClauseListNode::clause):
  13577. (KJS::ClauseListNode::next):
  13578. (KJS::SwitchNode::SwitchNode):
  13579. (KJS::LabelNode::LabelNode):
  13580. (KJS::ThrowNode::ThrowNode):
  13581. (KJS::CatchNode::CatchNode):
  13582. (KJS::FinallyNode::FinallyNode):
  13583. (KJS::TryNode::TryNode):
  13584. (KJS::ParameterNode::ParameterNode):
  13585. (KJS::ParameterNode::nextParam):
  13586. (KJS::FuncDeclNode::FuncDeclNode):
  13587. (KJS::FuncExprNode::FuncExprNode):
  13588. * kjs/nodes2string.cpp:
  13589. (KJS::SourceStream::operator<<):
  13590. (ElementNode::streamTo):
  13591. (PropertyValueNode::streamTo):
  13592. (ArgumentListNode::streamTo):
  13593. (StatListNode::streamTo):
  13594. (VarDeclListNode::streamTo):
  13595. (CaseBlockNode::streamTo):
  13596. (ParameterNode::streamTo):
  13597. (SourceElementsNode::streamTo):
  13598. * kjs/shared_ptr.h: Added.
  13599. (kxmlcore::SharedPtr::SharedPtr):
  13600. (kxmlcore::SharedPtr::~SharedPtr):
  13601. (kxmlcore::SharedPtr::isNull):
  13602. (kxmlcore::SharedPtr::notNull):
  13603. (kxmlcore::SharedPtr::reset):
  13604. (kxmlcore::SharedPtr::get):
  13605. (kxmlcore::SharedPtr::operator*):
  13606. (kxmlcore::SharedPtr::operator->):
  13607. (kxmlcore::SharedPtr::operator!):
  13608. (kxmlcore::SharedPtr::operator bool):
  13609. (kxmlcore::SharedPtr::operator==):
  13610. (kxmlcore::::operator):
  13611. (kxmlcore::operator!=):
  13612. (kxmlcore::static_pointer_cast):
  13613. (kxmlcore::const_pointer_cast):
  13614. 2005-08-26 Geoff Garen <ggaren@apple.com>
  13615. Reviewed by John.
  13616. Landed by Darin.
  13617. - fixed http://bugs.webkit.org/show_bug.cgi?id=4664
  13618. TOT Crash from backwards null check in WebScriptObject.mm
  13619. * bindings/objc/WebScriptObject.mm:
  13620. (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
  13621. Remove bogus !.
  13622. 2005-08-25 Darin Adler <darin@apple.com>
  13623. Reviewed by John Sullivan.
  13624. - rename KJS::UString::string() to KJS::UString::domString()
  13625. - rename KJS::Identifier::string() to KJS::Identifier::domString()
  13626. * kjs/identifier.h: Renamed.
  13627. * kjs/ustring.h: Ditto.
  13628. 2005-08-19 Darin Adler <darin@apple.com>
  13629. Reviewed by Maciej.
  13630. - fixed http://bugs.webkit.org/show_bug.cgi?id=4435
  13631. speed up JavaScript by tweaking the Identifier class
  13632. * kjs/identifier.h: Add a new global nullIdentifier and make Identifier::null a function
  13633. that returns it.
  13634. * kjs/identifier.cpp: (KJS::Identifier::init): Initialize a global for the null identifier
  13635. as well as all the other globals for special identifiers.
  13636. * kjs/ustring.h: (KJS::UString::UString): Make this empty constructor inline.
  13637. * kjs/ustring.cpp: Remove the old non-inline version.
  13638. 2005-08-19 Mitz Pettel <opendarwin.org@mitzpettel.com>
  13639. Reviewed by Maciej.
  13640. Revised and landed by Darin.
  13641. - fixed http://bugs.webkit.org/show_bug.cgi?id=4474
  13642. REGRESSION: Crash when using in-place operator on uninitialized array element
  13643. * kjs/nodes.cpp:
  13644. (AssignResolveNode::evaluate): Remove unneeded "isSet" assertion.
  13645. (AssignBracketNode::evaluate): Replace code that tested "isSet" with code that
  13646. tests the return value of getPropertySlot.
  13647. * kjs/property_slot.h: Removed unneeded "isSet" function. Property slots are
  13648. either uninitialized or set. There's no "initialized and not set" state.
  13649. 2005-08-18 Adele Peterson <adele@apple.com>
  13650. Checked "Inline Functions Hidden" box
  13651. * JavaScriptCore.xcodeproj/project.pbxproj:
  13652. 2005-08-16 Darin Adler <darin@apple.com>
  13653. Reviewed by Geoff.
  13654. - fixed crash in one of the JavaScript tests (introduced by my throwError change)
  13655. * kjs/nodes.cpp: (Node::setExceptionDetailsIfNeeded): Check if the exception is an
  13656. object before setting the file and line number properties on it. Something to think
  13657. about in the future -- do we really want to do this on any object that's thrown?
  13658. How about limiting it to error objects that were created by the JavaScript engine?
  13659. - changed kjs_fast_malloc so we don't have two conflicting versions of the same function
  13660. * kjs/fast_malloc.h: Took out all the ifdefs from this header.
  13661. * kjs/fast_malloc.cpp: Added non-NDEBUG versions of the functions that just call
  13662. the system malloc, and put the NDEBUG versions in an #else.
  13663. 2005-08-16 Darin Adler <darin@apple.com>
  13664. Reviewed by Geoff.
  13665. - clean up exported symbols that are not in a "KJS" namespace
  13666. * bindings/NP_jsobject.cpp: (identiferFromNPIdentifier): Marked this function static
  13667. so it no longer has external linkage.
  13668. * bindings/c/c_utility.h: Put all this stuff inside the KJS namespace.
  13669. * bindings/c/c_utility.cpp: Also marked some globals static so they don't have external
  13670. linkage; not as important given the namespace.
  13671. * bindings/npruntime.cpp: Marked functions static so they no longer have internal linkage.
  13672. Also removed unused _NPN_SetExceptionWithUTF8 function (not in header, had C++ linkage!).
  13673. * bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): Call KJS_GetCreatedJavaVMs
  13674. using the soft linking header, instead of calling the JNI call. This allows processes
  13675. to link both JavaScriptCore and JavaVM without a symbol conflict.
  13676. * bindings/softlinking.c:
  13677. (loadFramework): Marked this function static so it no longer has external linkage.
  13678. (getFunctionPointer): Ditto.
  13679. (KJS_GetCreatedJavaVMs): Renamed this so it has a KJS prefix.
  13680. * JavaScriptCore.xcodeproj/project.pbxproj: Added softlinking.h.
  13681. * bindings/softlinking.h: Added.
  13682. * kjs/nodes2string.cpp: (streamAssignmentOperatorTo): Marked this function static so it
  13683. no longer has external linkage.
  13684. 2005-08-15 Darin Adler <darin@apple.com>
  13685. Reviewed by Geoff.
  13686. - fixed http://bugs.webkit.org/show_bug.cgi?id=4437
  13687. clean up error creation with new throwError function
  13688. * bindings/NP_jsobject.cpp:
  13689. (_NPN_SetException):
  13690. * bindings/jni/jni_instance.cpp:
  13691. (JavaInstance::invokeMethod):
  13692. * bindings/jni/jni_runtime.cpp:
  13693. (JavaField::dispatchValueFromInstance):
  13694. (JavaField::dispatchSetValueToInstance):
  13695. * bindings/objc/WebScriptObject.mm:
  13696. (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:executionContext:]):
  13697. (-[WebScriptObject _initWithObjectImp:originExecutionContext:executionContext:]):
  13698. (+[WebScriptObject throwException:]):
  13699. (-[WebScriptObject setException:]):
  13700. (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
  13701. * bindings/objc/objc_class.h:
  13702. (KJS::Bindings::ObjcClass::~ObjcClass):
  13703. (KJS::Bindings::ObjcClass::ObjcClass):
  13704. (KJS::Bindings::ObjcClass::operator=):
  13705. (KJS::Bindings::ObjcClass::constructorAt):
  13706. (KJS::Bindings::ObjcClass::numConstructors):
  13707. * bindings/objc/objc_header.h:
  13708. * bindings/objc/objc_runtime.h:
  13709. (KJS::Bindings::ObjcField::~ObjcField):
  13710. (KJS::Bindings::ObjcField::ObjcField):
  13711. (KJS::Bindings::ObjcField::operator=):
  13712. (KJS::Bindings::ObjcMethod::ObjcMethod):
  13713. (KJS::Bindings::ObjcMethod::~ObjcMethod):
  13714. (KJS::Bindings::ObjcMethod::operator=):
  13715. * bindings/objc/objc_runtime.mm:
  13716. (ObjcField::valueFromInstance):
  13717. (ObjcField::setValueToInstance):
  13718. (ObjcArray::setValueAt):
  13719. (ObjcArray::valueAt):
  13720. * bindings/objc/objc_utility.h:
  13721. * bindings/objc/objc_utility.mm:
  13722. (KJS::Bindings::JSMethodNameToObjCMethodName):
  13723. (KJS::Bindings::convertValueToObjcValue):
  13724. (KJS::Bindings::convertNSStringToString):
  13725. (KJS::Bindings::convertObjcValueToValue):
  13726. (KJS::Bindings::objcValueTypeForType):
  13727. (KJS::Bindings::createObjcInstanceForValue):
  13728. (KJS::Bindings::throwError):
  13729. * bindings/runtime.h:
  13730. (KJS::Bindings::Parameter::~Parameter):
  13731. (KJS::Bindings::Method::~Method):
  13732. (KJS::Bindings::Instance::Instance):
  13733. (KJS::Bindings::Instance::begin):
  13734. (KJS::Bindings::Instance::end):
  13735. (KJS::Bindings::Instance::getValueOfUndefinedField):
  13736. (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
  13737. (KJS::Bindings::Instance::setValueOfUndefinedField):
  13738. (KJS::Bindings::Instance::valueOf):
  13739. * bindings/runtime_array.cpp:
  13740. (RuntimeArrayImp::put):
  13741. * bindings/runtime_object.h:
  13742. (KJS::RuntimeObjectImp::setInternalInstance):
  13743. (KJS::RuntimeObjectImp::getInternalInstance):
  13744. * kjs/array_object.cpp:
  13745. (getProperty):
  13746. (ArrayProtoFuncImp::callAsFunction):
  13747. (ArrayObjectImp::construct):
  13748. * kjs/bool_object.cpp:
  13749. (BooleanProtoFuncImp::callAsFunction):
  13750. * kjs/date_object.cpp:
  13751. (KJS::DateProtoFuncImp::callAsFunction):
  13752. * kjs/function.cpp:
  13753. (KJS::decode):
  13754. (KJS::GlobalFuncImp::callAsFunction):
  13755. * kjs/function_object.cpp:
  13756. (FunctionProtoFuncImp::callAsFunction):
  13757. (FunctionObjectImp::construct):
  13758. * kjs/internal.cpp:
  13759. (KJS::UndefinedImp::toObject):
  13760. (KJS::NullImp::toObject):
  13761. (KJS::InterpreterImp::evaluate):
  13762. (KJS::InternalFunctionImp::hasInstance):
  13763. * kjs/nodes.cpp:
  13764. (Node::throwError):
  13765. (substitute):
  13766. (Node::setExceptionDetailsIfNeeded):
  13767. (undefinedVariableError):
  13768. (ProgramNode::ProgramNode):
  13769. * kjs/number_object.cpp:
  13770. (NumberProtoFuncImp::callAsFunction):
  13771. * kjs/object.cpp:
  13772. (KJS::ObjectImp::call):
  13773. (KJS::ObjectImp::defaultValue):
  13774. (KJS::Error::create):
  13775. (KJS::throwError):
  13776. * kjs/object.h:
  13777. (KJS::ObjectImp::clearProperties):
  13778. (KJS::ObjectImp::getPropertySlot):
  13779. (KJS::ObjectImp::getOwnPropertySlot):
  13780. * kjs/object_object.cpp:
  13781. (ObjectProtoFuncImp::callAsFunction):
  13782. * kjs/reference.cpp:
  13783. (KJS::Reference::getBase):
  13784. (KJS::Reference::getValue):
  13785. (KJS::Reference::putValue):
  13786. (KJS::Reference::deleteValue):
  13787. * kjs/regexp_object.cpp:
  13788. (RegExpProtoFuncImp::callAsFunction):
  13789. (RegExpObjectImp::construct):
  13790. * kjs/string_object.cpp:
  13791. (StringProtoFuncImp::callAsFunction):
  13792. 2005-08-15 Anders Carlsson <andersca@mac.com>
  13793. Reviewed by Darin.
  13794. * tests/mozilla/ecma_3/Date/15.9.5.5.js:
  13795. Remove the code which tests that Date.toLocaleString should be parsable
  13796. by Date.parse. That is not true according to the spec.
  13797. 2005-08-15 Darin Adler <darin@apple.com>
  13798. Reviewed by Geoff.
  13799. * kjs/collector.cpp: (KJS::Collector::allocate): Use a local instead of a global in one
  13800. more place; slight speedup.
  13801. 2005-08-14 Darin Adler <darin@apple.com>
  13802. Reviewed by Maciej.
  13803. - fixed crash observed on one of the Apple-only layout tests
  13804. * kjs/property_map.cpp: (KJS::PropertyMap::mark): Change code to understand that deleted
  13805. entries have a value of NULL, so the deleted sentinel count doesn't need to be included
  13806. in the count of things to mark since we're ignoring the keys.
  13807. 2005-08-14 Darin Adler <darin@apple.com>
  13808. Reviewed by Maciej.
  13809. - fixed http://bugs.webkit.org/show_bug.cgi?id=4421
  13810. speed up JavaScript by inlining some label stack functions
  13811. * kjs/internal.h: Removed the copy constructor and assignment operator for LabelStack.
  13812. They were unused, and the implementations had bugs; I removed them rather than fixing them.
  13813. Also removed the clear function, since that was only needed to help the assignment operator
  13814. share code with the destructor, and was not efficient enough for the destructor.
  13815. (KJS::LabelStack::~LabelStack): Made this inline. Also used an efficient implementation
  13816. that's nice and fast when the stack is empty, better than the old clear() function which
  13817. used to keep updating and refetching "tos" each time through the loop.
  13818. (KJS::LabelStack::pop): Made this inline.
  13819. * kjs/internal.cpp: Deleted the now-inline functions and the obsolete functions. Also
  13820. deleted a commented-out line of code.
  13821. 2005-08-14 Darin Adler <darin@apple.com>
  13822. Reviewed by Maciej.
  13823. - fixed http://bugs.webkit.org/show_bug.cgi?id=4419
  13824. speed up JavaScript by improving KJS::List
  13825. my measurements show an improvement of 1% on iBench JavaScript
  13826. * kjs/list.cpp: Rearrange list to make the values and free list share the same storage,
  13827. which saves 4 bytes per list. Also remove the pointers used only on the heap from the
  13828. lists that are in the pool, which saves 8 bytes per list. Moving the free list pointer
  13829. closer to the start of the list object also speeds up access to the free list. New
  13830. "HeapListImp" struct is used only for the lists on the heap.
  13831. (KJS::List::markProtectedLists): Shadowed global variable in local and updated for the
  13832. new terminology ("heap" instead of "outside pool").
  13833. (KJS::allocateListImp): Updated for new terminology.
  13834. (KJS::List::release): Moved the code from deallocateListImp in here -- it wasn't being
  13835. inlined and didn't need to be in a separate function.
  13836. 2005-08-14 Darin Adler <darin@apple.com>
  13837. Reviewed by Maciej.
  13838. - fixed http://bugs.webkit.org/show_bug.cgi?id=4417
  13839. speed up JavaScript with some small changes to the property map code
  13840. my measurements show an improvement of 2% on iBench JavaScript
  13841. * kjs/property_map.h: (KJS::PropertyMap::PropertyMap): Made the default constructor inline.
  13842. * kjs/property_map.cpp:
  13843. (KJS::PropertyMap::~PropertyMap): Changed loop to exit early once we know we've processed
  13844. all the hash table entries, based on the count.
  13845. (KJS::PropertyMap::mark): Ditto.
  13846. * kjs/object.h: Made an arbitrary change here to force recompiling so we pick up changes to
  13847. property_map.h. Works around what seems to be an Xcode header dependency bug.
  13848. 2005-08-14 Darin Adler <darin@apple.com>
  13849. Reviewed by Maciej.
  13850. - fixed http://bugs.webkit.org/show_bug.cgi?id=4416
  13851. speed up JavaScript with some improvements to the garbage collector
  13852. my measurements show an improvement of 2% on iBench JavaScript
  13853. * kjs/collector.cpp:
  13854. (KJS::Collector::allocate): Use local variables to shadow globals instead of repeatedly
  13855. going at global variables. Tighten up loop implementations to make the common case fast.
  13856. (KJS::Collector::markStackObjectsConservatively): Use local variables to shadow globals.
  13857. Used a goto to eliminate a boolean since it was showing up in the profile.
  13858. (KJS::Collector::markProtectedObjects): Iterate through the table using pointer rather
  13859. than an index since the profile showed that generating better code.
  13860. (KJS::Collector::collect): Added a special case for blocks where all cells are used,
  13861. Use local variables to shadow globals. Eliminated a boolean by computing it another
  13862. way (checking to see if the number of live objects changed). Also used local variables
  13863. to shadow fields in the current cell when sweeping.
  13864. (KJS::Collector::numReferencedObjects): Use AllocatedValueImp instead of ValueImp
  13865. in one place -- means we get faster versions of various functions that don't worry
  13866. about SimpleNumber.
  13867. (KJS::className): Ditto.
  13868. (KJS::Collector::rootObjectClasses): Ditto.
  13869. 2005-08-14 Darin Adler <darin@apple.com>
  13870. - fixed http://bugs.webkit.org/show_bug.cgi?id=4344
  13871. REGRESSION: JavaScript crash when going back from viewing a thread (NULL protoype)
  13872. * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set proto in a more
  13873. straightforward way. The old code set the proto to 0 and then to the correct value.
  13874. This showed up as a "false positive" when searching for places that set prototype
  13875. to NULL/0 so I fixed it.
  13876. * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Change to
  13877. not pass an explicit "0" to the base class (InternalFunctionImp) constructor.
  13878. * kjs/internal.h: Added a default constructor for InternalFunctionImp.
  13879. * kjs/internal.cpp: (KJS::InternalFunctionImp::InternalFunctionImp): Added the
  13880. default constructor (empty body, just calls base class's default constructor).
  13881. * kjs/object.h:
  13882. (KJS::ObjectImp::ObjectImp): Add an assertion to catch NULL prototypes earlier
  13883. in Development builds.
  13884. (KJS::ObjectImp::setPrototype): Ditto.
  13885. 2005-08-12 Maciej Stachowiak <mjs@apple.com>
  13886. Reviewed by John.
  13887. - two simple speed improvements for a 3% speed gain
  13888. * JavaScriptCore.xcodeproj/project.pbxproj: turn on -fstrict-aliasing
  13889. * kjs/scope_chain.h:
  13890. (KJS::ScopeChainIterator::ScopeChainIterator): Add a scope chain iterator
  13891. so you can walk a scope chain without having to make a copy that you then mutate.
  13892. (KJS::ScopeChainIterator::operator*): standard iterator operation
  13893. (KJS::ScopeChainIterator::operator->): ditto
  13894. (KJS::ScopeChainIterator::operator++): ditto
  13895. (KJS::ScopeChainIterator::operator==): ditto
  13896. (KJS::ScopeChainIterator::operator!=): ditto
  13897. (KJS::ScopeChain::begin): Iterator for the top of the scope chain
  13898. (KJS::ScopeChain::end): Iterator for one past the bottom (i.e. null)
  13899. * kjs/nodes.cpp:
  13900. (ResolveNode::evaluate): Use scope chain iterator instead of copying
  13901. a scope chain and then modifying the copy
  13902. (ResolveNode::evaluateReference): ditto
  13903. (FunctionCallResolveNode::evaluate): ditto
  13904. (AssignResolveNode::evaluate): ditto
  13905. 2005-08-12 Maciej Stachowiak <mjs@apple.com>
  13906. Patch from Anders Carlsson, reviewed by me.
  13907. * kjs/nodes.h: Fix build breakage.
  13908. 2005-08-12 Maciej Stachowiak <mjs@apple.com>
  13909. Reviewed by hyatt.
  13910. - refactor function calls, 3% speedup on JS iBench.
  13911. * kjs/grammar.y:
  13912. * kjs/nodes.cpp:
  13913. (Node::throwError): Added new useful variants.
  13914. (FunctionCallValueNode::evaluate): New node to handle calls on expressions
  13915. that are strictly values, not references.
  13916. (FunctionCallValueNode::ref): ditto
  13917. (FunctionCallValueNode::deref): ditto
  13918. (FunctionCallResolveNode::evaluate): New node to handle calls on identifier
  13919. expressions, so that they are looked up in the scope chain.
  13920. (FunctionCallResolveNode::ref): ditto
  13921. (FunctionCallResolveNode::deref): ditto
  13922. (FunctionCallBracketNode::evaluate): New node to handle calls on bracket
  13923. dereferences, so that the expression before brackets is used as the this
  13924. object.
  13925. (FunctionCallBracketNode::ref): ditto
  13926. (FunctionCallBracketNode::deref): ditto
  13927. (FunctionCallDotNode::evaluate): New node to handle calls on dot
  13928. dereferences, so that the expression before the dot is used as the this
  13929. object.
  13930. (FunctionCallDotNode::ref): ditto
  13931. (FunctionCallDotNode::deref): ditto
  13932. (dotExprNotAnObjectString): helper function to avoid global variable access.
  13933. (dotExprDoesNotAllowCallsString): ditto
  13934. * kjs/nodes.h: Declared new classes.
  13935. * kjs/nodes2string.cpp:
  13936. (FunctionCallValueNode::streamTo): Added - serializes the appropriate function call
  13937. (FunctionCallResolveNode::streamTo): ditto
  13938. (FunctionCallBracketNode::streamTo): ditto
  13939. (FunctionCallParenBracketNode::streamTo): ditto
  13940. (FunctionCallDotNode::streamTo): ditto
  13941. (FunctionCallParenDotNode::streamTo): ditto
  13942. * kjs/object.h:
  13943. (KJS::ObjectImp::isActivation): Change how activation objects are
  13944. detected in the scope chain, a virtual function is cheaper than the
  13945. old inheritance test.
  13946. * kjs/function.h:
  13947. (KJS::ActivationImp::isActivation): Ditto.
  13948. 2005-08-11 Maciej Stachowiak <mjs@apple.com>
  13949. - added missing file from earlier checkin
  13950. * kjs/grammar_types.h: Added.
  13951. (KJS::makeNodePair):
  13952. (KJS::makeNodeWithIdent):
  13953. 2005-08-11 Maciej Stachowiak <mjs@apple.com>
  13954. Reviewed by Geoff.
  13955. * kjs/date_object.cpp:
  13956. (timetUsingCF): Fix one of the date tests my making the CF version of mktime
  13957. have the same quirk about the DST field as the real mktime.
  13958. * tests/mozilla/expected.html: Updated for newly fixed test.
  13959. 2005-08-11 Maciej Stachowiak <mjs@apple.com>
  13960. - updated for one of the tests that Darin incidentally fixed.
  13961. * tests/mozilla/expected.html:
  13962. 2005-08-10 Maciej Stachowiak <mjs@apple.com>
  13963. Reviewed by Geoff.
  13964. Refactor assignment grammar to avoid Reference type, and to later
  13965. be able to take advantage of writeable PropertySlots, when those
  13966. are added. I also fixed a minor bug, turning a function to a
  13967. string lost parentheses, I made sure they are printed at least
  13968. where semantically significant.
  13969. Test cases: see WebCore
  13970. * kjs/grammar.y: Change grammar so that assignment expressions are parsed
  13971. directly to nodes that know how to set the kind of location being assigned, instead
  13972. of having a generic assign node that counts on evaluateReference.
  13973. * kjs/lexer.cpp: Include grammar_types.h.
  13974. * kjs/nodes.cpp:
  13975. (BracketAccessorNode): Renamed from AccessorNode1 for clarity.
  13976. (DotAccessorNode): Renamed from AccessorNode2 for clarity.
  13977. (combineForAssignment): Inline function for doing the proper kind of
  13978. operation for various update assignments like += or *=.
  13979. (AssignResolveNode): Node that handles assignment to a bare identifier.
  13980. (AssignDotNode): Node that handles assignments of the form EXPR . IDENT = EXPR
  13981. (AssignBracketNode): EXPR [ IDENT ] = EXPR
  13982. * kjs/nodes.h: Updated for declarations/renames of new classes.
  13983. * kjs/nodes2string.cpp:
  13984. (GroupNode::streamTo): Fixed to print parens around the expression.
  13985. (BracketAccessorNode::streamTo): Renamed.
  13986. (DotAccessorNode::streamTo): Renamed.
  13987. (AssignResolveNode::streamTo): Added.
  13988. (AssignBracketNode::streamTo): Added.
  13989. (AssignDotNode::streamTo): Added.
  13990. (streamAssignmentOperatorTo): helper function for the above
  13991. * kjs/property_slot.h:
  13992. (KJS::PropertySlot::isSet): Made this const.
  13993. 2005-08-10 Adele Peterson <adele@apple.com>
  13994. Bumping version to 420+
  13995. * Info.plist:
  13996. 2005-08-10 Geoffrey Garen <ggaren@apple.com>
  13997. -fixed <rdar://problem/4151132> REGRESSION: Some applet liveconnect calls
  13998. throws privilege exception.
  13999. Reviewed by richard and mjs.
  14000. -I removed the global static JavaClass cache, since it violated Java
  14001. security to cache classes between websites and applets.
  14002. * bindings/jni/jni_class.cpp:
  14003. -removed global static cache dictionary
  14004. -instance constructor and destructor now do the work that used to
  14005. be done by static factory methods
  14006. -removed obsolete functions
  14007. (JavaClass::JavaClass):
  14008. (JavaClass::~JavaClass):
  14009. * bindings/jni/jni_class.h:
  14010. -removed obsolete function declarations
  14011. -made copying private since it's unused and it's also not clear
  14012. excatly how copying would work with Java security
  14013. -made default construction private since it's meaningless
  14014. * bindings/jni/jni_instance.cpp:
  14015. -removed obsolete functions
  14016. (JavaInstance::~JavaInstance):
  14017. (JavaInstance::getClass):
  14018. * bindings/jni/jni_instance.h:
  14019. -made copying private since it's unused and it's also not clear
  14020. excatly how copying would work with Java security
  14021. -made default construction private since it's meaningless
  14022. 2005-08-08 Geoffrey Garen <ggaren@apple.com>
  14023. -fixed crash caused by fix for http://bugs.webkit.org/show_bug.cgi?id=4313
  14024. - exceptionDescription now gets explicitly initialized to NULL in all
  14025. the places listed below -- our wrapper classes used to take care of this
  14026. automagically
  14027. * bindings/jni/jni_instance.cpp:
  14028. (JavaInstance::invokeMethod):
  14029. * bindings/jni/jni_runtime.cpp:
  14030. (JavaField::dispatchValueFromInstance):
  14031. (JavaField::dispatchSetValueToInstance):
  14032. 2005-08-08 Darin Adler <darin@apple.com>
  14033. Reviewed by John Sullivan.
  14034. - fixed http://bugs.webkit.org/show_bug.cgi?id=4325
  14035. Mozilla Date tests have an unnecessary loop that runs 1970 times before each test
  14036. * tests/mozilla/ecma/shell.js: Added TIME_YEAR_0 constant.
  14037. * tests/mozilla/ecma/Date/15.9.5.10-1.js: Removed the loop and changed code to use the constant.
  14038. * tests/mozilla/ecma/Date/15.9.5.10-10.js: Ditto.
  14039. * tests/mozilla/ecma/Date/15.9.5.10-11.js: Ditto.
  14040. * tests/mozilla/ecma/Date/15.9.5.10-12.js: Ditto.
  14041. * tests/mozilla/ecma/Date/15.9.5.10-13.js: Ditto.
  14042. * tests/mozilla/ecma/Date/15.9.5.10-2.js: Ditto.
  14043. * tests/mozilla/ecma/Date/15.9.5.10-3.js: Ditto.
  14044. * tests/mozilla/ecma/Date/15.9.5.10-4.js: Ditto.
  14045. * tests/mozilla/ecma/Date/15.9.5.10-5.js: Ditto.
  14046. * tests/mozilla/ecma/Date/15.9.5.10-6.js: Ditto.
  14047. * tests/mozilla/ecma/Date/15.9.5.10-7.js: Ditto.
  14048. * tests/mozilla/ecma/Date/15.9.5.10-8.js: Ditto.
  14049. * tests/mozilla/ecma/Date/15.9.5.10-9.js: Ditto.
  14050. * tests/mozilla/ecma/Date/15.9.5.11-2.js: Ditto.
  14051. * tests/mozilla/ecma/Date/15.9.5.12-1.js: Ditto.
  14052. * tests/mozilla/ecma/Date/15.9.5.12-2.js: Ditto.
  14053. * tests/mozilla/ecma/Date/15.9.5.12-3.js: Ditto.
  14054. * tests/mozilla/ecma/Date/15.9.5.12-4.js: Ditto.
  14055. * tests/mozilla/ecma/Date/15.9.5.12-5.js: Ditto.
  14056. * tests/mozilla/ecma/Date/15.9.5.12-6.js: Ditto.
  14057. * tests/mozilla/ecma/Date/15.9.5.12-7.js: Ditto.
  14058. * tests/mozilla/ecma/Date/15.9.5.12-8.js: Ditto.
  14059. * tests/mozilla/ecma/Date/15.9.5.13-2.js: Ditto.
  14060. * tests/mozilla/ecma/Date/15.9.5.13-8.js: Ditto.
  14061. * tests/mozilla/ecma/Date/15.9.5.14.js: Ditto.
  14062. * tests/mozilla/ecma/Date/15.9.5.15.js: Ditto.
  14063. * tests/mozilla/ecma/Date/15.9.5.16.js: Ditto.
  14064. * tests/mozilla/ecma/Date/15.9.5.17.js: Ditto.
  14065. * tests/mozilla/ecma/Date/15.9.5.18.js: Ditto.
  14066. * tests/mozilla/ecma/Date/15.9.5.19.js: Ditto.
  14067. * tests/mozilla/ecma/Date/15.9.5.20.js: Ditto.
  14068. * tests/mozilla/ecma/Date/15.9.5.21-1.js: Ditto.
  14069. * tests/mozilla/ecma/Date/15.9.5.21-2.js: Ditto.
  14070. * tests/mozilla/ecma/Date/15.9.5.21-3.js: Ditto.
  14071. * tests/mozilla/ecma/Date/15.9.5.21-4.js: Ditto.
  14072. * tests/mozilla/ecma/Date/15.9.5.21-5.js: Ditto.
  14073. * tests/mozilla/ecma/Date/15.9.5.21-6.js: Ditto.
  14074. * tests/mozilla/ecma/Date/15.9.5.21-7.js: Ditto.
  14075. * tests/mozilla/ecma/Date/15.9.5.21-8.js: Ditto.
  14076. * tests/mozilla/ecma/Date/15.9.5.22-1.js: Ditto.
  14077. * tests/mozilla/ecma/Date/15.9.5.22-2.js: Ditto.
  14078. * tests/mozilla/ecma/Date/15.9.5.22-3.js: Ditto.
  14079. * tests/mozilla/ecma/Date/15.9.5.22-4.js: Ditto.
  14080. * tests/mozilla/ecma/Date/15.9.5.22-5.js: Ditto.
  14081. * tests/mozilla/ecma/Date/15.9.5.22-6.js: Ditto.
  14082. * tests/mozilla/ecma/Date/15.9.5.22-7.js: Ditto.
  14083. * tests/mozilla/ecma/Date/15.9.5.22-8.js: Ditto.
  14084. * tests/mozilla/ecma/Date/15.9.5.23-4.js: Ditto.
  14085. * tests/mozilla/ecma/Date/15.9.5.23-5.js: Ditto.
  14086. * tests/mozilla/ecma/Date/15.9.5.23-6.js: Ditto.
  14087. * tests/mozilla/ecma/Date/15.9.5.23-7.js: Ditto.
  14088. * tests/mozilla/ecma/Date/15.9.5.23-8.js: Ditto.
  14089. * tests/mozilla/ecma/Date/15.9.5.23-9.js: Ditto.
  14090. * tests/mozilla/ecma/Date/15.9.5.5.js: Ditto.
  14091. * tests/mozilla/ecma/Date/15.9.5.6.js: Ditto.
  14092. * tests/mozilla/ecma/Date/15.9.5.7.js: Ditto.
  14093. * tests/mozilla/ecma/Date/15.9.5.8.js: Ditto.
  14094. * tests/mozilla/ecma/Date/15.9.5.9.js: Ditto.
  14095. 2005-08-08 Darin Adler <darin@apple.com>
  14096. - forgot to delete an obsolete file
  14097. * kjs/object_wrapper.h: Deleted.
  14098. 2005-08-07 Darin Adler <darin@apple.com>
  14099. - fixed two problems compiling with gcc 4.0
  14100. * kjs/array_object.cpp: (ArrayProtoFuncImp::callAsFunction): Initialized a
  14101. variable to quiet an erroneous warning.
  14102. * kjs/date_object.cpp: (KJS::makeTime): Removed extraneous KJS:: prefix.
  14103. 2005-08-07 Darin Adler <darin@apple.com>
  14104. Rubber stamped by Maciej.
  14105. - fixed http://bugs.webkit.org/show_bug.cgi?id=4313
  14106. eliminate KJS::Value and KJS::Object smart pointer wrappers (for simplicity and speed)
  14107. * JavaScriptCore.xcodeproj/project.pbxproj: Removed object_wrapper.h.
  14108. Global replaces and other wonderful stuff.
  14109. * bindings/NP_jsobject.cpp:
  14110. (_NPN_Invoke):
  14111. (_NPN_Evaluate):
  14112. (_NPN_GetProperty):
  14113. (_NPN_SetProperty):
  14114. (_NPN_HasMethod):
  14115. (_NPN_SetException):
  14116. * bindings/c/c_instance.cpp:
  14117. (KJS::Bindings::CInstance::CInstance):
  14118. (KJS::Bindings::CInstance::invokeMethod):
  14119. (KJS::Bindings::CInstance::invokeDefaultMethod):
  14120. (KJS::Bindings::CInstance::defaultValue):
  14121. (KJS::Bindings::CInstance::stringValue):
  14122. (KJS::Bindings::CInstance::numberValue):
  14123. (KJS::Bindings::CInstance::booleanValue):
  14124. (KJS::Bindings::CInstance::valueOf):
  14125. * bindings/c/c_instance.h:
  14126. * bindings/c/c_runtime.cpp:
  14127. (CField::valueFromInstance):
  14128. (CField::setValueToInstance):
  14129. * bindings/c/c_runtime.h:
  14130. * bindings/c/c_utility.cpp:
  14131. (convertNPStringToUTF16):
  14132. (convertUTF8ToUTF16):
  14133. (coerceValueToNPVariantStringType):
  14134. (convertValueToNPVariant):
  14135. (convertNPVariantToValue):
  14136. * bindings/c/c_utility.h:
  14137. * bindings/jni/jni_instance.cpp:
  14138. (JavaInstance::stringValue):
  14139. (JavaInstance::numberValue):
  14140. (JavaInstance::booleanValue):
  14141. (JavaInstance::invokeMethod):
  14142. (JavaInstance::invokeDefaultMethod):
  14143. (JavaInstance::defaultValue):
  14144. (JavaInstance::valueOf):
  14145. * bindings/jni/jni_instance.h:
  14146. * bindings/jni/jni_jsobject.cpp:
  14147. (JSObject::invoke):
  14148. (JSObject::call):
  14149. (JSObject::eval):
  14150. (JSObject::getMember):
  14151. (JSObject::getSlot):
  14152. (JSObject::toString):
  14153. (JSObject::convertValueToJObject):
  14154. (JSObject::convertJObjectToValue):
  14155. (JSObject::listFromJArray):
  14156. * bindings/jni/jni_jsobject.h:
  14157. * bindings/jni/jni_objc.mm:
  14158. (KJS::Bindings::dispatchJNICall):
  14159. * bindings/jni/jni_runtime.cpp:
  14160. (JavaArray::convertJObjectToArray):
  14161. (JavaField::dispatchValueFromInstance):
  14162. (JavaField::valueFromInstance):
  14163. (JavaField::dispatchSetValueToInstance):
  14164. (JavaField::setValueToInstance):
  14165. (JavaArray::setValueAt):
  14166. (JavaArray::valueAt):
  14167. * bindings/jni/jni_runtime.h:
  14168. (KJS::Bindings::JavaString::ustring):
  14169. * bindings/jni/jni_utility.cpp:
  14170. (KJS::Bindings::getJavaVM):
  14171. (KJS::Bindings::getJNIEnv):
  14172. (KJS::Bindings::getMethodID):
  14173. (KJS::Bindings::callJNIVoidMethod):
  14174. (KJS::Bindings::callJNIObjectMethod):
  14175. (KJS::Bindings::callJNIBooleanMethod):
  14176. (KJS::Bindings::callJNIStaticBooleanMethod):
  14177. (KJS::Bindings::callJNIByteMethod):
  14178. (KJS::Bindings::callJNICharMethod):
  14179. (KJS::Bindings::callJNIShortMethod):
  14180. (KJS::Bindings::callJNIIntMethod):
  14181. (KJS::Bindings::callJNILongMethod):
  14182. (KJS::Bindings::callJNIFloatMethod):
  14183. (KJS::Bindings::callJNIDoubleMethod):
  14184. (KJS::Bindings::callJNIVoidMethodA):
  14185. (KJS::Bindings::callJNIObjectMethodA):
  14186. (KJS::Bindings::callJNIByteMethodA):
  14187. (KJS::Bindings::callJNICharMethodA):
  14188. (KJS::Bindings::callJNIShortMethodA):
  14189. (KJS::Bindings::callJNIIntMethodA):
  14190. (KJS::Bindings::callJNILongMethodA):
  14191. (KJS::Bindings::callJNIFloatMethodA):
  14192. (KJS::Bindings::callJNIDoubleMethodA):
  14193. (KJS::Bindings::callJNIBooleanMethodA):
  14194. (KJS::Bindings::callJNIVoidMethodIDA):
  14195. (KJS::Bindings::callJNIObjectMethodIDA):
  14196. (KJS::Bindings::callJNIByteMethodIDA):
  14197. (KJS::Bindings::callJNICharMethodIDA):
  14198. (KJS::Bindings::callJNIShortMethodIDA):
  14199. (KJS::Bindings::callJNIIntMethodIDA):
  14200. (KJS::Bindings::callJNILongMethodIDA):
  14201. (KJS::Bindings::callJNIFloatMethodIDA):
  14202. (KJS::Bindings::callJNIDoubleMethodIDA):
  14203. (KJS::Bindings::callJNIBooleanMethodIDA):
  14204. (KJS::Bindings::getCharactersFromJString):
  14205. (KJS::Bindings::releaseCharactersForJString):
  14206. (KJS::Bindings::getCharactersFromJStringInEnv):
  14207. (KJS::Bindings::releaseCharactersForJStringInEnv):
  14208. (KJS::Bindings::getUCharactersFromJStringInEnv):
  14209. (KJS::Bindings::releaseUCharactersForJStringInEnv):
  14210. (KJS::Bindings::JNITypeFromClassName):
  14211. (KJS::Bindings::signatureFromPrimitiveType):
  14212. (KJS::Bindings::JNITypeFromPrimitiveType):
  14213. (KJS::Bindings::getJNIField):
  14214. (KJS::Bindings::convertValueToJValue):
  14215. * bindings/jni/jni_utility.h:
  14216. * bindings/objc/WebScriptObject.mm:
  14217. (_didExecute):
  14218. (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
  14219. (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]):
  14220. (-[WebScriptObject _imp]):
  14221. (-[WebScriptObject _executionContext]):
  14222. (-[WebScriptObject _setExecutionContext:]):
  14223. (-[WebScriptObject _originExecutionContext]):
  14224. (-[WebScriptObject _setOriginExecutionContext:]):
  14225. (+[WebScriptObject throwException:]):
  14226. (listFromNSArray):
  14227. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  14228. (-[WebScriptObject evaluateWebScript:]):
  14229. (-[WebScriptObject setValue:forKey:]):
  14230. (-[WebScriptObject valueForKey:]):
  14231. (-[WebScriptObject removeWebScriptKey:]):
  14232. (-[WebScriptObject stringRepresentation]):
  14233. (-[WebScriptObject webScriptValueAtIndex:]):
  14234. (-[WebScriptObject setException:]):
  14235. (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
  14236. * bindings/objc/WebScriptObjectPrivate.h:
  14237. * bindings/objc/objc_class.h:
  14238. * bindings/objc/objc_class.mm:
  14239. (KJS::Bindings::ObjcClass::fallbackObject):
  14240. * bindings/objc/objc_instance.h:
  14241. * bindings/objc/objc_instance.mm:
  14242. (ObjcInstance::invokeMethod):
  14243. (ObjcInstance::invokeDefaultMethod):
  14244. (ObjcInstance::setValueOfField):
  14245. (ObjcInstance::setValueOfUndefinedField):
  14246. (ObjcInstance::getValueOfField):
  14247. (ObjcInstance::getValueOfUndefinedField):
  14248. (ObjcInstance::defaultValue):
  14249. (ObjcInstance::stringValue):
  14250. (ObjcInstance::numberValue):
  14251. (ObjcInstance::booleanValue):
  14252. (ObjcInstance::valueOf):
  14253. * bindings/objc/objc_runtime.h:
  14254. * bindings/objc/objc_runtime.mm:
  14255. (ObjcField::valueFromInstance):
  14256. (convertValueToObjcObject):
  14257. (ObjcField::setValueToInstance):
  14258. (ObjcArray::setValueAt):
  14259. (ObjcArray::valueAt):
  14260. (ObjcFallbackObjectImp::put):
  14261. (ObjcFallbackObjectImp::callAsFunction):
  14262. (ObjcFallbackObjectImp::defaultValue):
  14263. * bindings/objc/objc_utility.h:
  14264. * bindings/objc/objc_utility.mm:
  14265. (Bindings::JSMethodNameToObjCMethodName):
  14266. (Bindings::convertValueToObjcValue):
  14267. (Bindings::convertNSStringToString):
  14268. (Bindings::convertObjcValueToValue):
  14269. (Bindings::objcValueTypeForType):
  14270. (Bindings::createObjcInstanceForValue):
  14271. * bindings/runtime.cpp:
  14272. (Instance::getValueOfField):
  14273. (Instance::setValueOfField):
  14274. (Instance::createRuntimeObject):
  14275. (Instance::createLanguageInstanceForValue):
  14276. * bindings/runtime.h:
  14277. (KJS::Bindings::Constructor::~Constructor):
  14278. (KJS::Bindings::Field::~Field):
  14279. (KJS::Bindings::MethodList::MethodList):
  14280. (KJS::Bindings::Class::fallbackObject):
  14281. (KJS::Bindings::Class::~Class):
  14282. (KJS::Bindings::Instance::Instance):
  14283. (KJS::Bindings::Instance::getValueOfUndefinedField):
  14284. (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
  14285. (KJS::Bindings::Instance::setValueOfUndefinedField):
  14286. (KJS::Bindings::Instance::valueOf):
  14287. (KJS::Bindings::Instance::setExecutionContext):
  14288. (KJS::Bindings::Instance::~Instance):
  14289. (KJS::Bindings::Array::~Array):
  14290. * bindings/runtime_array.cpp:
  14291. (RuntimeArrayImp::RuntimeArrayImp):
  14292. (RuntimeArrayImp::lengthGetter):
  14293. (RuntimeArrayImp::indexGetter):
  14294. (RuntimeArrayImp::put):
  14295. * bindings/runtime_array.h:
  14296. * bindings/runtime_method.cpp:
  14297. (RuntimeMethodImp::lengthGetter):
  14298. (RuntimeMethodImp::callAsFunction):
  14299. * bindings/runtime_method.h:
  14300. * bindings/runtime_object.cpp:
  14301. (RuntimeObjectImp::fallbackObjectGetter):
  14302. (RuntimeObjectImp::fieldGetter):
  14303. (RuntimeObjectImp::methodGetter):
  14304. (RuntimeObjectImp::getOwnPropertySlot):
  14305. (RuntimeObjectImp::put):
  14306. (RuntimeObjectImp::defaultValue):
  14307. (RuntimeObjectImp::callAsFunction):
  14308. * bindings/runtime_object.h:
  14309. * kjs/array_instance.h:
  14310. * kjs/array_object.cpp:
  14311. (ArrayInstanceImp::ArrayInstanceImp):
  14312. (ArrayInstanceImp::lengthGetter):
  14313. (ArrayInstanceImp::getOwnPropertySlot):
  14314. (ArrayInstanceImp::put):
  14315. (ArrayInstanceImp::propList):
  14316. (ArrayInstanceImp::setLength):
  14317. (compareByStringForQSort):
  14318. (compareWithCompareFunctionForQSort):
  14319. (ArrayInstanceImp::sort):
  14320. (ArrayInstanceImp::pushUndefinedObjectsToEnd):
  14321. (ArrayPrototypeImp::ArrayPrototypeImp):
  14322. (ArrayProtoFuncImp::ArrayProtoFuncImp):
  14323. (ArrayProtoFuncImp::callAsFunction):
  14324. (ArrayObjectImp::ArrayObjectImp):
  14325. (ArrayObjectImp::construct):
  14326. (ArrayObjectImp::callAsFunction):
  14327. * kjs/array_object.h:
  14328. * kjs/bool_object.cpp:
  14329. (BooleanPrototypeImp::BooleanPrototypeImp):
  14330. (BooleanProtoFuncImp::BooleanProtoFuncImp):
  14331. (BooleanProtoFuncImp::callAsFunction):
  14332. (BooleanObjectImp::BooleanObjectImp):
  14333. (BooleanObjectImp::construct):
  14334. (BooleanObjectImp::callAsFunction):
  14335. * kjs/bool_object.h:
  14336. * kjs/collector.cpp:
  14337. (KJS::Collector::markStackObjectsConservatively):
  14338. (KJS::Collector::collect):
  14339. (KJS::className):
  14340. * kjs/completion.h:
  14341. (KJS::Completion::Completion):
  14342. (KJS::Completion::value):
  14343. (KJS::Completion::isValueCompletion):
  14344. * kjs/context.h:
  14345. (KJS::ContextImp::variableObject):
  14346. (KJS::ContextImp::setVariableObject):
  14347. (KJS::ContextImp::thisValue):
  14348. (KJS::ContextImp::activationObject):
  14349. (KJS::ContextImp::pushScope):
  14350. * kjs/date_object.cpp:
  14351. (formatLocaleDate):
  14352. (KJS::timeFromArgs):
  14353. (KJS::DatePrototypeImp::DatePrototypeImp):
  14354. (KJS::DateProtoFuncImp::DateProtoFuncImp):
  14355. (KJS::DateProtoFuncImp::callAsFunction):
  14356. (KJS::DateObjectImp::DateObjectImp):
  14357. (KJS::DateObjectImp::construct):
  14358. (KJS::DateObjectImp::callAsFunction):
  14359. (KJS::DateObjectFuncImp::DateObjectFuncImp):
  14360. (KJS::DateObjectFuncImp::callAsFunction):
  14361. (KJS::parseDate):
  14362. (KJS::KRFCDate_parseDate):
  14363. (KJS::timeClip):
  14364. * kjs/date_object.h:
  14365. * kjs/debugger.cpp:
  14366. (Debugger::exception):
  14367. (Debugger::callEvent):
  14368. (Debugger::returnEvent):
  14369. * kjs/debugger.h:
  14370. * kjs/error_object.cpp:
  14371. (ErrorPrototypeImp::ErrorPrototypeImp):
  14372. (ErrorProtoFuncImp::ErrorProtoFuncImp):
  14373. (ErrorProtoFuncImp::callAsFunction):
  14374. (ErrorObjectImp::ErrorObjectImp):
  14375. (ErrorObjectImp::construct):
  14376. (ErrorObjectImp::callAsFunction):
  14377. (NativeErrorPrototypeImp::NativeErrorPrototypeImp):
  14378. (NativeErrorImp::NativeErrorImp):
  14379. (NativeErrorImp::construct):
  14380. (NativeErrorImp::callAsFunction):
  14381. * kjs/error_object.h:
  14382. * kjs/function.cpp:
  14383. (KJS::FunctionImp::FunctionImp):
  14384. (KJS::FunctionImp::callAsFunction):
  14385. (KJS::FunctionImp::processParameters):
  14386. (KJS::FunctionImp::argumentsGetter):
  14387. (KJS::FunctionImp::lengthGetter):
  14388. (KJS::FunctionImp::put):
  14389. (KJS::DeclaredFunctionImp::DeclaredFunctionImp):
  14390. (KJS::DeclaredFunctionImp::construct):
  14391. (KJS::ArgumentsImp::ArgumentsImp):
  14392. (KJS::ArgumentsImp::mappedIndexGetter):
  14393. (KJS::ArgumentsImp::put):
  14394. (KJS::ActivationImp::argumentsGetter):
  14395. (KJS::GlobalFuncImp::GlobalFuncImp):
  14396. (KJS::encode):
  14397. (KJS::decode):
  14398. (KJS::GlobalFuncImp::callAsFunction):
  14399. * kjs/function.h:
  14400. * kjs/function_object.cpp:
  14401. (FunctionPrototypeImp::FunctionPrototypeImp):
  14402. (FunctionPrototypeImp::callAsFunction):
  14403. (FunctionProtoFuncImp::FunctionProtoFuncImp):
  14404. (FunctionProtoFuncImp::callAsFunction):
  14405. (FunctionObjectImp::FunctionObjectImp):
  14406. (FunctionObjectImp::construct):
  14407. (FunctionObjectImp::callAsFunction):
  14408. * kjs/function_object.h:
  14409. * kjs/internal.cpp:
  14410. (KJS::UndefinedImp::toPrimitive):
  14411. (KJS::UndefinedImp::toObject):
  14412. (KJS::NullImp::toPrimitive):
  14413. (KJS::NullImp::toObject):
  14414. (KJS::BooleanImp::toPrimitive):
  14415. (KJS::BooleanImp::toObject):
  14416. (KJS::StringImp::toPrimitive):
  14417. (KJS::StringImp::toObject):
  14418. (KJS::NumberImp::toPrimitive):
  14419. (KJS::NumberImp::toObject):
  14420. (KJS::NumberImp::getUInt32):
  14421. (KJS::LabelStack::push):
  14422. (KJS::ContextImp::ContextImp):
  14423. (KJS::InterpreterImp::globalInit):
  14424. (KJS::InterpreterImp::globalClear):
  14425. (KJS::InterpreterImp::InterpreterImp):
  14426. (KJS::InterpreterImp::initGlobalObject):
  14427. (KJS::InterpreterImp::clear):
  14428. (KJS::InterpreterImp::mark):
  14429. (KJS::InterpreterImp::evaluate):
  14430. (KJS::InternalFunctionImp::hasInstance):
  14431. (KJS::roundValue):
  14432. (KJS::printInfo):
  14433. * kjs/internal.h:
  14434. (KJS::InterpreterImp::builtinObject):
  14435. (KJS::InterpreterImp::builtinFunction):
  14436. (KJS::InterpreterImp::builtinArray):
  14437. (KJS::InterpreterImp::builtinBoolean):
  14438. (KJS::InterpreterImp::builtinString):
  14439. (KJS::InterpreterImp::builtinNumber):
  14440. (KJS::InterpreterImp::builtinDate):
  14441. (KJS::InterpreterImp::builtinRegExp):
  14442. (KJS::InterpreterImp::builtinError):
  14443. (KJS::InterpreterImp::builtinObjectPrototype):
  14444. (KJS::InterpreterImp::builtinFunctionPrototype):
  14445. (KJS::InterpreterImp::builtinArrayPrototype):
  14446. (KJS::InterpreterImp::builtinBooleanPrototype):
  14447. (KJS::InterpreterImp::builtinStringPrototype):
  14448. (KJS::InterpreterImp::builtinNumberPrototype):
  14449. (KJS::InterpreterImp::builtinDatePrototype):
  14450. (KJS::InterpreterImp::builtinRegExpPrototype):
  14451. (KJS::InterpreterImp::builtinErrorPrototype):
  14452. (KJS::InterpreterImp::builtinEvalError):
  14453. (KJS::InterpreterImp::builtinRangeError):
  14454. (KJS::InterpreterImp::builtinReferenceError):
  14455. (KJS::InterpreterImp::builtinSyntaxError):
  14456. (KJS::InterpreterImp::builtinTypeError):
  14457. (KJS::InterpreterImp::builtinURIError):
  14458. (KJS::InterpreterImp::builtinEvalErrorPrototype):
  14459. (KJS::InterpreterImp::builtinRangeErrorPrototype):
  14460. (KJS::InterpreterImp::builtinReferenceErrorPrototype):
  14461. (KJS::InterpreterImp::builtinSyntaxErrorPrototype):
  14462. (KJS::InterpreterImp::builtinTypeErrorPrototype):
  14463. (KJS::InterpreterImp::builtinURIErrorPrototype):
  14464. * kjs/interpreter.cpp:
  14465. (Context::variableObject):
  14466. (Context::thisValue):
  14467. (Interpreter::Interpreter):
  14468. (Interpreter::globalObject):
  14469. (Interpreter::evaluate):
  14470. (Interpreter::builtinObject):
  14471. (Interpreter::builtinFunction):
  14472. (Interpreter::builtinArray):
  14473. (Interpreter::builtinBoolean):
  14474. (Interpreter::builtinString):
  14475. (Interpreter::builtinNumber):
  14476. (Interpreter::builtinDate):
  14477. (Interpreter::builtinRegExp):
  14478. (Interpreter::builtinError):
  14479. (Interpreter::builtinObjectPrototype):
  14480. (Interpreter::builtinFunctionPrototype):
  14481. (Interpreter::builtinArrayPrototype):
  14482. (Interpreter::builtinBooleanPrototype):
  14483. (Interpreter::builtinStringPrototype):
  14484. (Interpreter::builtinNumberPrototype):
  14485. (Interpreter::builtinDatePrototype):
  14486. (Interpreter::builtinRegExpPrototype):
  14487. (Interpreter::builtinErrorPrototype):
  14488. (Interpreter::builtinEvalError):
  14489. (Interpreter::builtinRangeError):
  14490. (Interpreter::builtinReferenceError):
  14491. (Interpreter::builtinSyntaxError):
  14492. (Interpreter::builtinTypeError):
  14493. (Interpreter::builtinURIError):
  14494. (Interpreter::builtinEvalErrorPrototype):
  14495. (Interpreter::builtinRangeErrorPrototype):
  14496. (Interpreter::builtinReferenceErrorPrototype):
  14497. (Interpreter::builtinSyntaxErrorPrototype):
  14498. (Interpreter::builtinTypeErrorPrototype):
  14499. (Interpreter::builtinURIErrorPrototype):
  14500. (Interpreter::createLanguageInstanceForValue):
  14501. * kjs/interpreter.h:
  14502. (KJS::Interpreter::isGlobalObject):
  14503. (KJS::ExecState::setException):
  14504. (KJS::ExecState::clearException):
  14505. (KJS::ExecState::exception):
  14506. (KJS::ExecState::hadException):
  14507. (KJS::ExecState::ExecState):
  14508. * kjs/list.cpp:
  14509. (KJS::List::at):
  14510. * kjs/list.h:
  14511. (KJS::List::operator[]):
  14512. (KJS::ListIterator::operator->):
  14513. (KJS::ListIterator::operator*):
  14514. (KJS::ListIterator::operator++):
  14515. (KJS::ListIterator::operator--):
  14516. * kjs/lookup.h:
  14517. (KJS::staticFunctionGetter):
  14518. (KJS::staticValueGetter):
  14519. (KJS::lookupPut):
  14520. (KJS::cacheGlobalObject):
  14521. * kjs/math_object.cpp:
  14522. (MathObjectImp::getValueProperty):
  14523. (MathFuncImp::MathFuncImp):
  14524. (MathFuncImp::callAsFunction):
  14525. * kjs/math_object.h:
  14526. * kjs/nodes.cpp:
  14527. (Node::evaluateReference):
  14528. (Node::throwError):
  14529. (Node::setExceptionDetailsIfNeeded):
  14530. (NullNode::evaluate):
  14531. (BooleanNode::evaluate):
  14532. (NumberNode::evaluate):
  14533. (StringNode::evaluate):
  14534. (RegExpNode::evaluate):
  14535. (ThisNode::evaluate):
  14536. (ResolveNode::evaluate):
  14537. (ResolveNode::evaluateReference):
  14538. (GroupNode::evaluate):
  14539. (ElementNode::evaluate):
  14540. (ArrayNode::evaluate):
  14541. (ObjectLiteralNode::evaluate):
  14542. (PropertyValueNode::evaluate):
  14543. (PropertyNode::evaluate):
  14544. (AccessorNode1::evaluate):
  14545. (AccessorNode1::evaluateReference):
  14546. (AccessorNode2::evaluate):
  14547. (AccessorNode2::evaluateReference):
  14548. (ArgumentListNode::evaluate):
  14549. (ArgumentListNode::evaluateList):
  14550. (ArgumentsNode::evaluate):
  14551. (NewExprNode::evaluate):
  14552. (FunctionCallNode::evaluate):
  14553. (PostfixNode::evaluate):
  14554. (DeleteNode::evaluate):
  14555. (VoidNode::evaluate):
  14556. (TypeOfNode::evaluate):
  14557. (PrefixNode::evaluate):
  14558. (UnaryPlusNode::evaluate):
  14559. (NegateNode::evaluate):
  14560. (BitwiseNotNode::evaluate):
  14561. (LogicalNotNode::evaluate):
  14562. (MultNode::evaluate):
  14563. (AddNode::evaluate):
  14564. (ShiftNode::evaluate):
  14565. (RelationalNode::evaluate):
  14566. (EqualNode::evaluate):
  14567. (BitOperNode::evaluate):
  14568. (BinaryLogicalNode::evaluate):
  14569. (ConditionalNode::evaluate):
  14570. (AssignNode::evaluate):
  14571. (CommaNode::evaluate):
  14572. (StatListNode::execute):
  14573. (AssignExprNode::evaluate):
  14574. (VarDeclNode::evaluate):
  14575. (VarDeclNode::processVarDecls):
  14576. (VarDeclListNode::evaluate):
  14577. (ExprStatementNode::execute):
  14578. (IfNode::execute):
  14579. (DoWhileNode::execute):
  14580. (WhileNode::execute):
  14581. (ForNode::execute):
  14582. (ForInNode::execute):
  14583. (ContinueNode::execute):
  14584. (BreakNode::execute):
  14585. (ReturnNode::execute):
  14586. (WithNode::execute):
  14587. (CaseClauseNode::evaluate):
  14588. (ClauseListNode::evaluate):
  14589. (CaseBlockNode::evaluate):
  14590. (CaseBlockNode::evalBlock):
  14591. (SwitchNode::execute):
  14592. (ThrowNode::execute):
  14593. (CatchNode::execute):
  14594. (TryNode::execute):
  14595. (ParameterNode::evaluate):
  14596. (FuncDeclNode::processFuncDecl):
  14597. (FuncExprNode::evaluate):
  14598. (SourceElementsNode::execute):
  14599. * kjs/nodes.h:
  14600. (KJS::StatementNode::evaluate):
  14601. * kjs/number_object.cpp:
  14602. (NumberPrototypeImp::NumberPrototypeImp):
  14603. (NumberProtoFuncImp::NumberProtoFuncImp):
  14604. (NumberProtoFuncImp::callAsFunction):
  14605. (NumberObjectImp::NumberObjectImp):
  14606. (NumberObjectImp::getValueProperty):
  14607. (NumberObjectImp::construct):
  14608. (NumberObjectImp::callAsFunction):
  14609. * kjs/number_object.h:
  14610. * kjs/object.cpp:
  14611. (KJS::ObjectImp::call):
  14612. (KJS::ObjectImp::mark):
  14613. (KJS::ObjectImp::classInfo):
  14614. (KJS::ObjectImp::get):
  14615. (KJS::ObjectImp::getProperty):
  14616. (KJS::ObjectImp::getPropertySlot):
  14617. (KJS::ObjectImp::put):
  14618. (KJS::ObjectImp::hasOwnProperty):
  14619. (KJS::ObjectImp::defaultValue):
  14620. (KJS::ObjectImp::findPropertyHashEntry):
  14621. (KJS::ObjectImp::construct):
  14622. (KJS::ObjectImp::callAsFunction):
  14623. (KJS::ObjectImp::hasInstance):
  14624. (KJS::ObjectImp::propList):
  14625. (KJS::ObjectImp::toPrimitive):
  14626. (KJS::ObjectImp::toNumber):
  14627. (KJS::ObjectImp::toString):
  14628. (KJS::ObjectImp::toObject):
  14629. (KJS::ObjectImp::putDirect):
  14630. (KJS::Error::create):
  14631. (KJS::error):
  14632. * kjs/object.h:
  14633. (KJS::):
  14634. (KJS::ObjectImp::getPropertySlot):
  14635. (KJS::AllocatedValueImp::isObject):
  14636. (KJS::ObjectImp::ObjectImp):
  14637. (KJS::ObjectImp::internalValue):
  14638. (KJS::ObjectImp::setInternalValue):
  14639. (KJS::ObjectImp::prototype):
  14640. (KJS::ObjectImp::setPrototype):
  14641. (KJS::ObjectImp::inherits):
  14642. * kjs/object_object.cpp:
  14643. (ObjectPrototypeImp::ObjectPrototypeImp):
  14644. (ObjectProtoFuncImp::ObjectProtoFuncImp):
  14645. (ObjectProtoFuncImp::callAsFunction):
  14646. (ObjectObjectImp::ObjectObjectImp):
  14647. (ObjectObjectImp::construct):
  14648. (ObjectObjectImp::callAsFunction):
  14649. * kjs/object_object.h:
  14650. * kjs/operations.cpp:
  14651. (KJS::equal):
  14652. (KJS::strictEqual):
  14653. (KJS::relation):
  14654. (KJS::add):
  14655. (KJS::mult):
  14656. * kjs/operations.h:
  14657. * kjs/property_map.cpp:
  14658. (KJS::PropertyMap::mark):
  14659. (KJS::PropertyMap::addEnumerablesToReferenceList):
  14660. (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList):
  14661. (KJS::PropertyMap::save):
  14662. (KJS::PropertyMap::restore):
  14663. * kjs/property_map.h:
  14664. * kjs/property_slot.cpp:
  14665. (KJS::PropertySlot::undefinedGetter):
  14666. * kjs/property_slot.h:
  14667. (KJS::PropertySlot::getValue):
  14668. * kjs/protect.h:
  14669. (KJS::gcUnprotectNullTolerant):
  14670. (KJS::ProtectedValue::ProtectedValue):
  14671. (KJS::ProtectedValue::~ProtectedValue):
  14672. (KJS::ProtectedValue::operator=):
  14673. (KJS::ProtectedValue::operator ValueImp *):
  14674. (KJS::ProtectedValue::operator->):
  14675. * kjs/protected_object.h:
  14676. (KJS::ProtectedObject::ProtectedObject):
  14677. (KJS::ProtectedObject::operator=):
  14678. (KJS::ProtectedObject::operator ValueImp *):
  14679. (KJS::ProtectedObject::operator ObjectImp *):
  14680. (KJS::ProtectedObject::operator->):
  14681. (KJS::ProtectedReference::ProtectedReference):
  14682. (KJS::ProtectedReference::~ProtectedReference):
  14683. (KJS::ProtectedReference::operator=):
  14684. * kjs/protected_values.cpp:
  14685. (KJS::ProtectedValues::getProtectCount):
  14686. (KJS::ProtectedValues::increaseProtectCount):
  14687. (KJS::ProtectedValues::insert):
  14688. (KJS::ProtectedValues::decreaseProtectCount):
  14689. * kjs/protected_values.h:
  14690. * kjs/reference.cpp:
  14691. (KJS::Reference::Reference):
  14692. (KJS::Reference::makeValueReference):
  14693. (KJS::Reference::getBase):
  14694. (KJS::Reference::getValue):
  14695. (KJS::Reference::putValue):
  14696. (KJS::Reference::deleteValue):
  14697. * kjs/reference.h:
  14698. (KJS::Reference::baseIfMutable):
  14699. * kjs/regexp_object.cpp:
  14700. (RegExpPrototypeImp::RegExpPrototypeImp):
  14701. (RegExpProtoFuncImp::RegExpProtoFuncImp):
  14702. (RegExpProtoFuncImp::callAsFunction):
  14703. (RegExpObjectImp::RegExpObjectImp):
  14704. (RegExpObjectImp::arrayOfMatches):
  14705. (RegExpObjectImp::backrefGetter):
  14706. (RegExpObjectImp::construct):
  14707. (RegExpObjectImp::callAsFunction):
  14708. * kjs/regexp_object.h:
  14709. * kjs/string_object.cpp:
  14710. (StringInstanceImp::lengthGetter):
  14711. (StringInstanceImp::indexGetter):
  14712. (StringInstanceImp::getOwnPropertySlot):
  14713. (StringInstanceImp::put):
  14714. (StringPrototypeImp::StringPrototypeImp):
  14715. (StringProtoFuncImp::StringProtoFuncImp):
  14716. (regExpIsGlobal):
  14717. (replace):
  14718. (StringProtoFuncImp::callAsFunction):
  14719. (StringObjectImp::StringObjectImp):
  14720. (StringObjectImp::construct):
  14721. (StringObjectImp::callAsFunction):
  14722. (StringObjectFuncImp::StringObjectFuncImp):
  14723. (StringObjectFuncImp::callAsFunction):
  14724. * kjs/string_object.h:
  14725. * kjs/testkjs.cpp:
  14726. (TestFunctionImp::callAsFunction):
  14727. (VersionFunctionImp::callAsFunction):
  14728. (main):
  14729. * kjs/value.cpp:
  14730. (KJS::AllocatedValueImp::operator new):
  14731. (KJS::AllocatedValueImp::getUInt32):
  14732. (KJS::ValueImp::toInteger):
  14733. (KJS::ValueImp::toInt32):
  14734. (KJS::ValueImp::toUInt32):
  14735. (KJS::ValueImp::toUInt16):
  14736. (KJS::ValueImp::toObject):
  14737. (KJS::AllocatedValueImp::getBoolean):
  14738. (KJS::AllocatedValueImp::getNumber):
  14739. (KJS::AllocatedValueImp::getString):
  14740. (KJS::AllocatedValueImp::getObject):
  14741. (KJS::jsString):
  14742. (KJS::jsNumber):
  14743. (KJS::ConstantValues::init):
  14744. (KJS::ConstantValues::clear):
  14745. (KJS::ConstantValues::mark):
  14746. * kjs/value.h:
  14747. (KJS::):
  14748. (KJS::jsUndefined):
  14749. (KJS::jsNull):
  14750. (KJS::jsBoolean):
  14751. (KJS::jsNaN):
  14752. (KJS::ValueImp::ValueImp):
  14753. (KJS::ValueImp::~ValueImp):
  14754. (KJS::AllocatedValueImp::AllocatedValueImp):
  14755. (KJS::AllocatedValueImp::~AllocatedValueImp):
  14756. (KJS::AllocatedValueImp::isBoolean):
  14757. (KJS::AllocatedValueImp::isNumber):
  14758. (KJS::AllocatedValueImp::isString):
  14759. (KJS::AllocatedValueImp::isObject):
  14760. (KJS::AllocatedValueImp::marked):
  14761. (KJS::AllocatedValueImp::mark):
  14762. (KJS::ValueImp::downcast):
  14763. (KJS::ValueImp::isUndefined):
  14764. (KJS::ValueImp::isNull):
  14765. (KJS::ValueImp::isUndefinedOrNull):
  14766. (KJS::ValueImp::isBoolean):
  14767. (KJS::ValueImp::isNumber):
  14768. (KJS::ValueImp::isString):
  14769. (KJS::ValueImp::isObject):
  14770. (KJS::ValueImp::getBoolean):
  14771. (KJS::ValueImp::getNumber):
  14772. (KJS::ValueImp::getString):
  14773. (KJS::ValueImp::getObject):
  14774. (KJS::ValueImp::getUInt32):
  14775. (KJS::ValueImp::mark):
  14776. (KJS::ValueImp::marked):
  14777. (KJS::ValueImp::type):
  14778. (KJS::ValueImp::toPrimitive):
  14779. (KJS::ValueImp::toBoolean):
  14780. (KJS::ValueImp::toNumber):
  14781. (KJS::ValueImp::toString):
  14782. (KJS::jsZero):
  14783. (KJS::jsOne):
  14784. (KJS::jsTwo):
  14785. (KJS::Undefined):
  14786. (KJS::Null):
  14787. (KJS::Boolean):
  14788. (KJS::Number):
  14789. (KJS::String):
  14790. 2005-08-06 Maciej Stachowiak <mjs@apple.com>
  14791. Reviewed by Darin.
  14792. Change over to the new PropertySlot mechanism for property
  14793. lookup. This allows the elimination of hasOwnProperty
  14794. methods. Also did some of the performance tuning enabled by this
  14795. (but not yet all the possible improvements for function calls,
  14796. assignment, ++, and so forth). And also much code cleanup.
  14797. Net result is about a 2% speedup on the JS iBench.
  14798. Also redid Geoff's fix for the chrashing applet by avoiding a NULL
  14799. prototype in the bindings code and using the default of Null()
  14800. instead.
  14801. * JavaScriptCore.xcodeproj/project.pbxproj:
  14802. * bindings/objc/objc_runtime.h:
  14803. * bindings/objc/objc_runtime.mm:
  14804. (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
  14805. (ObjcFallbackObjectImp::getOwnPropertySlot):
  14806. * bindings/runtime_array.cpp:
  14807. (RuntimeArrayImp::lengthGetter):
  14808. (RuntimeArrayImp::indexGetter):
  14809. (RuntimeArrayImp::getOwnPropertySlot):
  14810. * bindings/runtime_array.h:
  14811. * bindings/runtime_method.cpp:
  14812. (RuntimeMethodImp::lengthGetter):
  14813. (RuntimeMethodImp::getOwnPropertySlot):
  14814. * bindings/runtime_method.h:
  14815. * bindings/runtime_object.cpp:
  14816. (RuntimeObjectImp::RuntimeObjectImp):
  14817. (RuntimeObjectImp::fallbackObjectGetter):
  14818. (RuntimeObjectImp::fieldGetter):
  14819. (RuntimeObjectImp::methodGetter):
  14820. (RuntimeObjectImp::getOwnPropertySlot):
  14821. * bindings/runtime_object.h:
  14822. * bindings/runtime_root.h:
  14823. * kjs/array_instance.h:
  14824. * kjs/array_object.cpp:
  14825. (ArrayInstanceImp::lengthGetter):
  14826. (ArrayInstanceImp::getOwnPropertySlot):
  14827. (ArrayPrototypeImp::getOwnPropertySlot):
  14828. * kjs/array_object.h:
  14829. * kjs/date_object.cpp:
  14830. (DatePrototypeImp::getOwnPropertySlot):
  14831. * kjs/date_object.h:
  14832. * kjs/function.cpp:
  14833. (KJS::FunctionImp::argumentsGetter):
  14834. (KJS::FunctionImp::lengthGetter):
  14835. (KJS::FunctionImp::getOwnPropertySlot):
  14836. (KJS::FunctionImp::put):
  14837. (KJS::FunctionImp::deleteProperty):
  14838. (KJS::ArgumentsImp::mappedIndexGetter):
  14839. (KJS::ArgumentsImp::getOwnPropertySlot):
  14840. (KJS::ActivationImp::argumentsGetter):
  14841. (KJS::ActivationImp::getArgumentsGetter):
  14842. (KJS::ActivationImp::getOwnPropertySlot):
  14843. (KJS::ActivationImp::deleteProperty):
  14844. * kjs/function.h:
  14845. * kjs/internal.cpp:
  14846. (InterpreterImp::InterpreterImp):
  14847. (InterpreterImp::initGlobalObject):
  14848. (InterpreterImp::~InterpreterImp):
  14849. (InterpreterImp::evaluate):
  14850. * kjs/internal.h:
  14851. (KJS::InterpreterImp::globalExec):
  14852. * kjs/interpreter.cpp:
  14853. (Interpreter::Interpreter):
  14854. (Interpreter::createLanguageInstanceForValue):
  14855. * kjs/interpreter.h:
  14856. (KJS::Interpreter::argumentsIdentifier):
  14857. (KJS::Interpreter::specialPrototypeIdentifier):
  14858. * kjs/lookup.h:
  14859. (KJS::staticFunctionGetter):
  14860. (KJS::staticValueGetter):
  14861. (KJS::getStaticPropertySlot):
  14862. (KJS::getStaticFunctionSlot):
  14863. (KJS::getStaticValueSlot):
  14864. * kjs/math_object.cpp:
  14865. (MathObjectImp::getOwnPropertySlot):
  14866. * kjs/math_object.h:
  14867. * kjs/nodes.cpp:
  14868. (ResolveNode::evaluate):
  14869. (ResolveNode::evaluateReference):
  14870. (AccessorNode1::evaluate):
  14871. (AccessorNode2::evaluate):
  14872. * kjs/number_object.cpp:
  14873. (NumberObjectImp::getOwnPropertySlot):
  14874. * kjs/number_object.h:
  14875. * kjs/object.cpp:
  14876. (KJS::ObjectImp::get):
  14877. (KJS::ObjectImp::getProperty):
  14878. (KJS::ObjectImp::getPropertySlot):
  14879. (KJS::ObjectImp::getOwnPropertySlot):
  14880. (KJS::ObjectImp::put):
  14881. (KJS::ObjectImp::hasProperty):
  14882. (KJS::ObjectImp::hasOwnProperty):
  14883. * kjs/object.h:
  14884. (KJS::ObjectImp::getDirectLocation):
  14885. (KJS::ObjectImp::getPropertySlot):
  14886. (KJS::ObjectImp::getOwnPropertySlot):
  14887. * kjs/object_wrapper.h: Added.
  14888. (KJS::):
  14889. (KJS::Object::Object):
  14890. (KJS::Object::operator ObjectImp *):
  14891. * kjs/property_map.cpp:
  14892. (KJS::PropertyMap::getLocation):
  14893. * kjs/property_map.h:
  14894. * kjs/property_slot.cpp: Added.
  14895. (KJS::PropertySlot::undefinedGetter):
  14896. * kjs/property_slot.h: Added.
  14897. (KJS::PropertySlot::isSet):
  14898. (KJS::PropertySlot::getValue):
  14899. (KJS::PropertySlot::setValueSlot):
  14900. (KJS::PropertySlot::setStaticEntry):
  14901. (KJS::PropertySlot::setCustom):
  14902. (KJS::PropertySlot::setCustomIndex):
  14903. (KJS::PropertySlot::setUndefined):
  14904. (KJS::PropertySlot::slotBase):
  14905. (KJS::PropertySlot::staticEntry):
  14906. (KJS::PropertySlot::index):
  14907. (KJS::PropertySlot::):
  14908. * kjs/protect.h:
  14909. * kjs/protected_object.h: Added.
  14910. (KJS::ProtectedObject::ProtectedObject):
  14911. (KJS::ProtectedObject::~ProtectedObject):
  14912. (KJS::ProtectedObject::operator=):
  14913. (KJS::ProtectedReference::ProtectedReference):
  14914. (KJS::ProtectedReference::~ProtectedReference):
  14915. (KJS::ProtectedReference::operator=):
  14916. * kjs/reference.h:
  14917. * kjs/reference_list.cpp:
  14918. * kjs/regexp_object.cpp:
  14919. (RegExpObjectImp::backrefGetter):
  14920. (RegExpObjectImp::getOwnPropertySlot):
  14921. * kjs/regexp_object.h:
  14922. * kjs/string_object.cpp:
  14923. (StringInstanceImp::lengthGetter):
  14924. (StringInstanceImp::indexGetter):
  14925. (StringInstanceImp::getOwnPropertySlot):
  14926. (StringPrototypeImp::getOwnPropertySlot):
  14927. * kjs/string_object.h:
  14928. 2005-08-05 Adele Peterson <adele@apple.com>
  14929. Reviewed by Darin.
  14930. * JavaScriptCore.xcodeproj/project.pbxproj: Unchecked 'statics are thread safe' option.
  14931. 2005-08-05 Geoffrey Garen <ggaren@apple.com>
  14932. -fixed <rdar://problem/4207220> REGRESSION (DENVER): Crash occurs
  14933. after clicking on Hangman applet
  14934. Reviewed by darin.
  14935. * kjs/object.cpp:
  14936. (KJS::ObjectImp::hasProperty): added check for null prototype.
  14937. FIXME: The long-term plan is to make runtime objects use JS Null()
  14938. instead of null pointers, which will allow us to eliminate null
  14939. checks, improving performance.
  14940. 2005-08-05 Geoffrey Garen <ggaren@apple.com>
  14941. Fix by darin, reviewed by me.
  14942. - rolled in fix for: <rdar://problem/4161606> JavaScript regular
  14943. expressions with certain ranges of Unicode characters cause a crash
  14944. Test cases added:
  14945. * layout-tests/fast/js/regexp-big-unicode-ranges-expected.txt: Added.
  14946. * layout-tests/fast/js/regexp-big-unicode-ranges.html: Added.
  14947. * pcre/pcre.c:
  14948. (compile_branch): added checks for characters > 255
  14949. 2005-08-04 Maciej Stachowiak <mjs@apple.com>
  14950. - updated expected test results now that we no longer exlude the
  14951. date tests (apparently this was overlooked)
  14952. * tests/mozilla/expected.html:
  14953. 2005-07-31 Darin Adler <darin@apple.com>
  14954. Reviewed by Maciej.
  14955. - remove uses of Mac-OS-X-specific MAX macro
  14956. - remove one of the many excess "APPLE_CHANGES" ifdefs
  14957. * kjs/collector.cpp: (KJS::Collector::allocate): Use std::max instead of MAX.
  14958. * kjs/property_map.cpp: (KJS::PropertyMap::rehash): Ditto.
  14959. * kjs/ustring.cpp:
  14960. (KJS::UChar::toLower): Take out non-ICU code path.
  14961. (KJS::UChar::toUpper): Ditto.
  14962. (KJS::UString::spliceSubstringsWithSeparators): Use std::max instead of MAX.
  14963. 2005-07-27 Geoffrey Garen <ggaren@apple.com>
  14964. - fixed http://bugs.webkit.org/show_bug.cgi?id=4147
  14965. Array.toString() and toLocaleString() improvements from KDE KJS
  14966. (rolled in KDE changes)
  14967. Test cases added:
  14968. * layout-tests/fast/js/toString-overrides-expected.txt: Added.
  14969. * layout-tests/fast/js/toString-overrides.html: Added.
  14970. * kjs/array_object.cpp:
  14971. (ArrayProtoFuncImp::call):
  14972. 2005-07-27 Maciej Stachowiak <mjs@apple.com>
  14973. Changes by Michael Kahl, reviewed by me.
  14974. - fixed <rdar://problem/4194278> Need better debugging support in JavaScriptCore
  14975. * JavaScriptCore.xcodeproj/project.pbxproj:
  14976. * kjs/debugger.cpp:
  14977. (KJS::AttachedInterpreter::AttachedInterpreter):
  14978. (KJS::AttachedInterpreter::~AttachedInterpreter):
  14979. (Debugger::~Debugger):
  14980. (Debugger::attach):
  14981. (Debugger::detach):
  14982. (Debugger::sourceParsed):
  14983. * kjs/debugger.h:
  14984. * kjs/function.cpp:
  14985. (KJS::FunctionImp::call):
  14986. (KJS::GlobalFuncImp::call):
  14987. * kjs/function_object.cpp:
  14988. (FunctionObjectImp::construct):
  14989. * kjs/grammar.y:
  14990. * kjs/internal.cpp:
  14991. (Parser::parse):
  14992. (InterpreterImp::evaluate):
  14993. * kjs/internal.h:
  14994. (KJS::InterpreterImp::setDebugger):
  14995. * kjs/interpreter.cpp:
  14996. * kjs/interpreter.h:
  14997. (KJS::Interpreter::imp):
  14998. * kjs/nodes.cpp:
  14999. 2005-07-27 Geoffrey Garen <ggaren@apple.com>
  15000. - fixed http://bugs.webkit.org/show_bug.cgi?id=3381
  15001. Date.prototype.setDate() incorrect for values >=128
  15002. - Test cases added:
  15003. * layout-tests/fast/js/date-big-setdate-expected.txt: Added.
  15004. * layout-tests/fast/js/date-big-setdate.html: Added.
  15005. Reviewed by darin.
  15006. * kjs/date_object.cpp:
  15007. (DateProtoFuncImp::call):
  15008. 2005-07-27 Geoffrey Garen <ggaren@apple.com>
  15009. -rolled in patch by Carsten Guenther <cguenther@gmail.com>
  15010. for http://bugs.webkit.org/show_bug.cgi?id=3759
  15011. Date object enhancements
  15012. Test cases added:
  15013. * layout-tests/fast/js/date-preserve-milliseconds-expected.txt: Added.
  15014. * layout-tests/fast/js/date-preserve-milliseconds.html: Added.
  15015. Reviewed by darin.
  15016. * kjs/date_object.cpp:
  15017. (timeFromArgs):
  15018. (DateProtoFuncImp::call):
  15019. (DateObjectImp::construct):
  15020. (DateObjectFuncImp::call):
  15021. (KJS::makeTime):
  15022. * kjs/date_object.h:
  15023. * tests/mozilla/expected.html:
  15024. 2005-07-26 Justin Garcia <justin.garcia@apple.com>
  15025. Added a forward declaration to fix gcc4 build error
  15026. * kjs/function.h:
  15027. 2005-07-25 Geoffrey Garen <ggaren@apple.com>
  15028. - fixed mistake in my last checkin -- the expected results included
  15029. results from a patch that hasn't landed yet.
  15030. * tests/mozilla/expected.html:
  15031. 2005-07-25 Maciej Stachowiak <mjs@apple.com>
  15032. - fix mistake in last change that leads to assertion failure in the Development build
  15033. * kjs/lookup.h:
  15034. (KJS::lookupGetOwnValue):
  15035. 2005-07-24 Maciej Stachowiak <mjs@apple.com>
  15036. Reviewed by Darin.
  15037. - http://bugs.webkit.org/show_bug.cgi?id=4124
  15038. (change JavaScript property access to avoid double lookup)
  15039. - 10% speedup on JavaScript iBench
  15040. - 5% speedup on 24fun BenchJS benchmark
  15041. Changed all get methods to getOwnProperty - they are no longer
  15042. responsible for prototype lookup, and determine if the property
  15043. was found as a side efect.
  15044. get() is now a nonvirtual ObjectImp method which calls the virtual
  15045. getOwnProperty and walks the prototype chain. A few selected
  15046. methods were inlined.
  15047. Changed ResolveNode::evaluate plus some other places to use
  15048. getProperty which does get() and hasProperty() in one lookup.
  15049. Also miscellaneous code cleanup.
  15050. * bindings/objc/objc_runtime.h:
  15051. * bindings/objc/objc_runtime.mm:
  15052. (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
  15053. (ObjcFallbackObjectImp::getOwnProperty):
  15054. * bindings/runtime_array.cpp:
  15055. (RuntimeArrayImp::RuntimeArrayImp):
  15056. (RuntimeArrayImp::getOwnProperty):
  15057. * bindings/runtime_array.h:
  15058. * bindings/runtime_method.cpp:
  15059. (RuntimeMethodImp::getOwnProperty):
  15060. * bindings/runtime_method.h:
  15061. * bindings/runtime_object.cpp:
  15062. (RuntimeObjectImp::getOwnProperty):
  15063. * bindings/runtime_object.h:
  15064. * kjs/array_instance.h:
  15065. * kjs/array_object.cpp:
  15066. (ArrayInstanceImp::getOwnProperty):
  15067. (ArrayPrototypeImp::getOwnProperty):
  15068. (ArrayProtoFuncImp::call):
  15069. * kjs/array_object.h:
  15070. * kjs/date_object.cpp:
  15071. (DatePrototypeImp::getOwnProperty):
  15072. * kjs/date_object.h:
  15073. * kjs/function.cpp:
  15074. (KJS::FunctionImp::getOwnProperty):
  15075. (KJS::ArgumentsImp::getOwnProperty):
  15076. (KJS::ActivationImp::getOwnProperty):
  15077. * kjs/function.h:
  15078. * kjs/lookup.h:
  15079. (KJS::lookupGetOwnProperty):
  15080. (KJS::lookupGetOwnFunction):
  15081. (KJS::lookupGetOwnValue):
  15082. * kjs/math_object.cpp:
  15083. (MathObjectImp::getOwnProperty):
  15084. (MathObjectImp::getValueProperty):
  15085. * kjs/math_object.h:
  15086. * kjs/nodes.cpp:
  15087. (ResolveNode::evaluate):
  15088. * kjs/number_object.cpp:
  15089. (NumberObjectImp::getOwnProperty):
  15090. * kjs/number_object.h:
  15091. * kjs/object.cpp:
  15092. (KJS::ObjectImp::get):
  15093. (KJS::ObjectImp::getOwnProperty):
  15094. (KJS::ObjectImp::getProperty):
  15095. * kjs/object.h:
  15096. (KJS::ObjectImp::getProperty):
  15097. (KJS::ObjectImp::getOwnProperty):
  15098. * kjs/object_object.cpp:
  15099. (ObjectProtoFuncImp::call):
  15100. * kjs/regexp_object.cpp:
  15101. (RegExpObjectImp::getOwnProperty):
  15102. * kjs/regexp_object.h:
  15103. * kjs/string_object.cpp:
  15104. (StringInstanceImp::getOwnProperty):
  15105. (StringPrototypeImp::getOwnProperty):
  15106. * kjs/string_object.h:
  15107. 2005-07-25 Geoffrey Garen <ggaren@apple.com>
  15108. - fixed http://bugs.webkit.org/show_bug.cgi?id=3971
  15109. JS test suite depends on JS 1.2 behavior
  15110. Reviewed by darin.
  15111. * tests/mozilla/js1_2/Array/tostring_1.js: now tests only for JS 1.5 behavior
  15112. * tests/mozilla/js1_2/Array/tostring_2.js: ditto
  15113. * tests/mozilla/expected.html:
  15114. 2005-07-24 Justin Garcia <justin.garcia@apple.com>
  15115. Reviewed by kevin.
  15116. Fixes make clean problem introduced in xcode2.1 transition
  15117. * Makefile.am:
  15118. 2005-07-22 Geoffrey Garen <ggaren@apple.com>
  15119. Reviewed by darin.
  15120. * kjs/date_object.cpp: DatePrototypeImp now identifies itself as a
  15121. child class of DateInstanceImp -- this enables calls to Date.ValueOf().
  15122. fixes: ecma/Date/15.9.5.js (once we enable the date tests).
  15123. 2005-07-22 Geoffrey Garen <ggaren@apple.com>
  15124. Reviewed by darin.
  15125. * tests/mozilla/jsDriver.pl: now takes the path to testkjs as a command-line argument
  15126. * tests/mozilla/run-mozilla-tests: Removed.
  15127. 2005-07-21 Geoffrey Garen <ggaren@apple.com>
  15128. * JavaScriptCore.xcodeproj/.cvsignore: Added.
  15129. 2005-07-21 Geoffrey Garen <ggaren@apple.com>
  15130. * JavaScriptCore.pbproj/project.pbxproj: Removed.
  15131. * JavaScriptCore.xcodeproj/ggaren.pbxuser: Added.
  15132. * JavaScriptCore.xcodeproj/ggaren.perspective: Added.
  15133. * JavaScriptCore.xcodeproj/project.pbxproj: Added.
  15134. * Makefile.am:
  15135. 2005-07-20 Maciej Stachowiak <mjs@apple.com>
  15136. Patch from Trey Matteson <trey@usa.net>, reviewed by me.
  15137. - fixed http://bugs.webkit.org/show_bug.cgi?id=3956
  15138. some of WebKit builds with symbols, some doesn't
  15139. * JavaScriptCore.pbproj/project.pbxproj: Generate symbols even for
  15140. Deployment.
  15141. 2005-07-19 Geoffrey Garen <ggaren@apple.com>
  15142. -fixed http://bugs.webkit.org/show_bug.cgi?id=3991
  15143. JSC doesn't implement Array.prototype.toLocaleString()
  15144. -test failure: ecma_3/Array/15.4.4.3-1.js
  15145. Reviewed by mjs.
  15146. * kjs/array_object.cpp:
  15147. (ArrayProtoFuncImp::call): now searches for toString and
  15148. toLocaleString overrides in the array's elements
  15149. * tests/mozilla/expected.html: failures are under 100! woohoo!
  15150. 2005-07-19 Darin Adler <darin@apple.com>
  15151. - fixed the build
  15152. * kjs/lookup.h: (KJS::lookupPut): Remove bogus const; was preventing WebCore from
  15153. compiling (not sure why this didn't affect my other build machine).
  15154. - one other tiny tweak (so sue me)
  15155. * bindings/runtime_root.cpp: Remove unneeded declaration.
  15156. 2005-07-19 Darin Adler <darin@apple.com>
  15157. Reviewed by Geoff Garen.
  15158. - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more
  15159. * kjs/lookup.h: Changed tryCall in IMPLEMENT_PROTOFUNC here to call. It doesn't make
  15160. sense for this macro to use the name tryCall anyway, since that's specific to how
  15161. WebCore used this, so this is good anyway. On the other hand, it might be a problem
  15162. for KDOM or KSVG, in which case we'll need another macro for them, since JavaScriptCore
  15163. should presumably not have the C++ exception support.
  15164. 2005-07-18 Geoffrey Garen <ggaren@apple.com>
  15165. -fixed http://bugs.webkit.org/show_bug.cgi?id=4008
  15166. Error objects report incorrect length
  15167. Reviewed by darin.
  15168. * kjs/error_object.cpp: Error objects now include a length property
  15169. (ErrorObjectImp::ErrorObjectImp):
  15170. * tests/mozilla/expected.html: updated expected results to reflect fix
  15171. * tests/mozilla/js1_5/Exceptions/regress-123002.js: test now expects
  15172. ecma compliant results
  15173. 2005-07-15 Geoffrey Garen <ggaren@apple.com>
  15174. -rolled in KDE fixes for http://bugs.webkit.org/show_bug.cgi?id=3601
  15175. Error instance type info
  15176. Reviewed by mjs.
  15177. * kjs/error_object.cpp:
  15178. - Created ErrorInstanceImp class for Error() objects.
  15179. - Changed parent object for Native Errors to "Function" (matches
  15180. ECMA spec).
  15181. (ErrorInstanceImp::ErrorInstanceImp):
  15182. (ErrorProtoFuncImp::call):
  15183. (ErrorObjectImp::construct):
  15184. (NativeErrorImp::construct):
  15185. * kjs/error_object.h:
  15186. (KJS::ErrorInstanceImp::classInfo):
  15187. * kjs/object.h: made comment more informative about ClassInfo
  15188. * tests/mozilla/expected.html:
  15189. 2005-07-14 Geoffrey Garen <ggaren@apple.com>
  15190. - fixed: JS test suite expects an out of memory error
  15191. that our memory efficiency avoids
  15192. Reviewed by mjs.
  15193. * tests/mozilla/js1_5/Array/regress-157652.js:
  15194. test now expects normal execution
  15195. * tests/mozilla/expected.html:
  15196. 2005-07-14 Geoffrey Garen <ggaren@apple.com>
  15197. - fixed http://bugs.webkit.org/show_bug.cgi?id=4006
  15198. testkjs doesn't implement gc()
  15199. - test failure:
  15200. ecma_3/Function/regress-104584.js
  15201. Reviewed by mjs.
  15202. * kjs/interpreter.cpp:
  15203. (Interpreter::finalCheck): removed misleading while && comment
  15204. * kjs/testkjs.cpp: added "gc" function to global object
  15205. (TestFunctionImp::):
  15206. (TestFunctionImp::call):
  15207. (main):
  15208. * tests/mozilla/expected.html:
  15209. 2005-07-14 Geoffrey Garen <ggaren@apple.com>
  15210. -rolled in patches for http://bugs.webkit.org/show_bug.cgi?id=3945
  15211. [PATCH] Safe merges of comments and other trivialities from KDE's kjs
  15212. -patch by Martijn Klingens <klingens@kde.org>
  15213. * kjs/array_instance.h:
  15214. * kjs/array_object.cpp:
  15215. * kjs/array_object.h:
  15216. * kjs/bool_object.cpp:
  15217. * kjs/bool_object.h:
  15218. * kjs/collector.cpp:
  15219. * kjs/collector.h:
  15220. * kjs/completion.h:
  15221. * kjs/context.h:
  15222. * kjs/date_object.cpp:
  15223. * kjs/date_object.h:
  15224. * kjs/debugger.cpp:
  15225. * kjs/debugger.h:
  15226. * kjs/dtoa.h:
  15227. * kjs/error_object.cpp:
  15228. * kjs/error_object.h:
  15229. * kjs/function.cpp:
  15230. * kjs/function.h:
  15231. * kjs/function_object.cpp:
  15232. * kjs/function_object.h:
  15233. * kjs/grammar.y:
  15234. * kjs/identifier.cpp:
  15235. * kjs/identifier.h:
  15236. * kjs/internal.cpp:
  15237. * kjs/internal.h:
  15238. * kjs/interpreter.cpp:
  15239. * kjs/interpreter.h:
  15240. * kjs/interpreter_map.cpp:
  15241. * kjs/interpreter_map.h:
  15242. * kjs/lexer.cpp:
  15243. * kjs/lexer.h:
  15244. * kjs/list.cpp:
  15245. * kjs/list.h:
  15246. * kjs/lookup.cpp:
  15247. * kjs/lookup.h:
  15248. * kjs/math_object.cpp:
  15249. * kjs/math_object.h:
  15250. * kjs/nodes.cpp:
  15251. * kjs/nodes.h:
  15252. * kjs/nodes2string.cpp:
  15253. * kjs/number_object.cpp:
  15254. * kjs/number_object.h:
  15255. * kjs/object.cpp:
  15256. * kjs/object.h:
  15257. * kjs/object_object.cpp:
  15258. * kjs/object_object.h:
  15259. * kjs/operations.cpp:
  15260. * kjs/operations.h:
  15261. * kjs/property_map.cpp:
  15262. * kjs/property_map.h:
  15263. * kjs/reference.cpp:
  15264. * kjs/reference.h:
  15265. * kjs/reference_list.cpp:
  15266. * kjs/reference_list.h:
  15267. * kjs/regexp.cpp:
  15268. * kjs/regexp.h:
  15269. * kjs/regexp_object.cpp:
  15270. * kjs/regexp_object.h:
  15271. * kjs/scope_chain.cpp:
  15272. * kjs/scope_chain.h:
  15273. * kjs/simple_number.h:
  15274. * kjs/string_object.cpp:
  15275. * kjs/string_object.h:
  15276. * kjs/testkjs.cpp:
  15277. * kjs/types.h:
  15278. * kjs/ustring.cpp:
  15279. * kjs/ustring.h:
  15280. * kjs/value.cpp:
  15281. * kjs/value.h:
  15282. 2005-07-14 Geoffrey Garen <ggaren@apple.com>
  15283. -fixed http://bugs.webkit.org/show_bug.cgi?id=3970
  15284. throw statements fail inside eval statements
  15285. Reviewed by mjs.
  15286. * kjs/function.cpp:
  15287. (KJS::GlobalFuncImp::call):
  15288. Big change since I fixed the tabbing. The important part is:
  15289. if (c.complType() == Throw)
  15290. exec->setException(c.value());
  15291. * kjs/nodes.cpp:
  15292. (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
  15293. (TryNode::execute):
  15294. try now clears the exception state before the finally block executes,
  15295. and checks the state after the block executes, so that exceptions in
  15296. finally code get caught.
  15297. * tests/mozilla/expected.html:
  15298. 2005-07-14 Geoffrey Garen <ggaren@apple.com>
  15299. -landed fix for http://bugs.webkit.org/show_bug.cgi?id=3412
  15300. Object.prototype is missing toLocaleString
  15301. - patch by Mark Rowe (bdash) <opendarwin.org@bdash.net.nz>
  15302. -layout test info in webcore changelog
  15303. Reviewed by mjs.
  15304. * kjs/object_object.cpp:
  15305. (ObjectPrototypeImp::ObjectPrototypeImp):
  15306. (ObjectProtoFuncImp::call):
  15307. * kjs/object_object.h:
  15308. (KJS::ObjectProtoFuncImp::):
  15309. 2005-07-12 Geoffrey Garen <ggaren@apple.com>
  15310. Reviewed by mjs.
  15311. * kjs/function.cpp:
  15312. (KJS::IndexToNameMap::operator[]): fixed infinite recursion
  15313. bug in last checkin
  15314. 2005-07-12 Geoffrey Garen <ggaren@apple.com>
  15315. -fixed http://bugs.webkit.org/show_bug.cgi?id=3881
  15316. arguments object should share values with function parameters
  15317. Reviewed by mjs.
  15318. ArgumentsImp now uses a simple hash lookup to share values
  15319. with the activation object.
  15320. * kjs/function.cpp:
  15321. (KJS::FunctionImp::getParameterName):
  15322. (KJS::IndexToNameMap::IndexToNameMap):
  15323. (KJS::IndexToNameMap::~IndexToNameMap):
  15324. (KJS::IndexToNameMap::isMapped):
  15325. (KJS::IndexToNameMap::unMap):
  15326. (KJS::IndexToNameMap::operator[]):
  15327. (KJS::ArgumentsImp::ArgumentsImp):
  15328. (KJS::ArgumentsImp::mark):
  15329. (KJS::ArgumentsImp::get):
  15330. (KJS::ArgumentsImp::put):
  15331. (KJS::ArgumentsImp::deleteProperty):
  15332. (KJS::ArgumentsImp::hasOwnProperty):
  15333. (KJS::ActivationImp::createArgumentsObject):
  15334. * kjs/function.h:
  15335. * tests/mozilla/expected.html: updated results
  15336. 2005-07-09 Maciej Stachowiak <mjs@apple.com>
  15337. - backing out my earlier collector change, it causes a performance regression in TOT
  15338. * kjs/collector.cpp:
  15339. (KJS::Collector::allocate):
  15340. 2005-07-08 Eric Seidel <eseidel@apple.com>
  15341. Reviewed by mjs/hyatt (only in concept).
  15342. * JavaScriptCore.pbproj/project.pbxproj: Added JavaScriptCore+SVG
  15343. Turns on RTTI support for JavaScriptCore.framework when
  15344. building the JavaScriptCore+SVG target. This is needed as
  15345. kdom (part of WebCore+SVG) requires RTTI for the time being.
  15346. 2005-07-08 Maciej Stachowiak <mjs@apple.com>
  15347. Reviewed by hyatt.
  15348. - When there are many live objects, GC less often, to try to make
  15349. GC cost proportional to garbage, not proportional to total memory used.
  15350. * kjs/collector.cpp:
  15351. (KJS::Collector::allocate):
  15352. 2005-07-08 Vicki Murley <vicki@apple.com>
  15353. Fix from Carsten Guenther, reviewed by Maciej
  15354. - fixed http://bugs.webkit.org/show_bug.cgi?id=3644 (Error string representation)
  15355. Switch from "-" to ":" in error strings.
  15356. * kjs/error_object.cpp:
  15357. (ErrorProtoFuncImp::call):
  15358. * tests/mozilla/expected.html:
  15359. 2005-07-08 Geoffrey Garen <ggaren@apple.com>
  15360. -rolled in patch for http://bugs.webkit.org/show_bug.cgi?id=3878
  15361. arguments object should be an object not an array
  15362. Reviewed by mjs.
  15363. * kjs/function.cpp:
  15364. (KJS::ArgumentsImp::ArgumentsImp): now manually handles initialization
  15365. we used to get for free by inheriting from ArrayInstanceImp
  15366. * kjs/function.h: ArgumentsImp now inherits from ObjectImp
  15367. * tests/mozilla/expected.html: updated expected test results
  15368. 2005-07-07 Eric Seidel <eseidel@apple.com>
  15369. Reviewed by mjs.
  15370. * kjs/grammar.y: removed #define YYMAXDEPTH 0 for bison 2.0
  15371. http://bugs.webkit.org/show_bug.cgi?id=3882
  15372. 2005-07-03 Maciej Stachowiak <mjs@apple.com>
  15373. Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
  15374. Fixes to patch by me, reviewed by John Sullivan.
  15375. - fixed http://bugs.webkit.org/show_bug.cgi?id=3293
  15376. Test cases added:
  15377. * tests/mozilla/expected.html: Two tests newly pass.
  15378. * bindings/objc/objc_runtime.h:
  15379. * bindings/objc/objc_runtime.mm:
  15380. (ObjcFallbackObjectImp::hasOwnProperty):
  15381. * bindings/runtime_array.cpp:
  15382. (RuntimeArrayImp::hasOwnProperty):
  15383. * bindings/runtime_array.h:
  15384. * bindings/runtime_object.cpp:
  15385. (RuntimeObjectImp::hasOwnProperty):
  15386. * bindings/runtime_object.h:
  15387. * kjs/array_instance.h:
  15388. * kjs/array_object.cpp:
  15389. (ArrayInstanceImp::hasOwnProperty):
  15390. * kjs/function.cpp:
  15391. (KJS::FunctionImp::hasOwnProperty):
  15392. (KJS::ActivationImp::hasOwnProperty):
  15393. * kjs/function.h:
  15394. * kjs/lookup.h:
  15395. * kjs/object.cpp:
  15396. (KJS::ObjectImp::hasProperty):
  15397. (KJS::ObjectImp::hasOwnProperty):
  15398. * kjs/object.h:
  15399. (KJS::Object::hasOwnProperty):
  15400. * kjs/object_object.cpp:
  15401. (ObjectPrototypeImp::ObjectPrototypeImp):
  15402. (ObjectProtoFuncImp::call):
  15403. * kjs/object_object.h:
  15404. (KJS::ObjectProtoFuncImp::):
  15405. * kjs/string_object.cpp:
  15406. (StringInstanceImp::hasOwnProperty):
  15407. * kjs/string_object.h:
  15408. 2005-07-01 Geoffrey Garen <ggaren@apple.com>
  15409. -landed patch by Eric Seidel <macdome@opendarwin.org>
  15410. -for http://bugs.webkit.org/show_bug.cgi?id=3657
  15411. GroundWork: Moving some functions from khtml->jsc following kjs TOT
  15412. - no layout test necessary yet - only groundwork
  15413. Reviewed by darin.
  15414. * kjs/lookup.h:
  15415. (KJS::cacheGlobalObject):
  15416. 2005-07-01 Geoffrey Garen <ggaren@apple.com>
  15417. -landed patch by Carsten Guenther <cguenther@gmail.com>
  15418. -fixes http://bugs.webkit.org/show_bug.cgi?id=3477
  15419. some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
  15420. -relevant tests:
  15421. mozilla/ecma_3/Date/15.9.5.5.js
  15422. layout-tests/fast/js/date-parse-test.html
  15423. Reviewed by darin.
  15424. * kjs/date_object.cpp:
  15425. (formatLocaleDate):
  15426. (day):
  15427. (dayFromYear):
  15428. (daysInYear):
  15429. (timeFromYear):
  15430. (yearFromTime):
  15431. (weekDay):
  15432. (timeZoneOffset):
  15433. (DateProtoFuncImp::call):
  15434. (DateObjectImp::construct):
  15435. (KJS::parseDate):
  15436. (ymdhms_to_seconds):
  15437. (KJS::makeTime):
  15438. (findMonth):
  15439. (KJS::KRFCDate_parseDate):
  15440. * kjs/date_object.h:
  15441. * tests/mozilla/expected.html: updated expected results to reflect fix
  15442. 2005-07-01 Geoffrey Garen <ggaren@apple.com>
  15443. -fixed <rdar://problem/4168186> JavaScript fails to throw exceptions
  15444. for invalid return statements
  15445. relevant tests:
  15446. ecma/Statements/12.9-1-n.js
  15447. ecma_2/Exceptions/lexical-052.js
  15448. ecma_2/Exceptions/statement-009.js
  15449. Reviewed by sullivan.
  15450. * kjs/nodes.cpp:
  15451. (ReturnNode::execute): now throws exception if return is not inside
  15452. a function.
  15453. * tests/mozilla/expected.html: updated to reflect fix
  15454. 2005-07-01 Geoffrey Garen <ggaren@apple.com>
  15455. Reviewed by sullivan.
  15456. * tests/mozilla/expected.html: Updated test results for last fix.
  15457. 2005-07-01 Geoffrey Garen <ggaren@apple.com>
  15458. -fixed <rdar://problem/4168161> JavaScript fails to throw an exception
  15459. for invalid function calls
  15460. Reviewed by sullivan.
  15461. Relevant mozilla test: ecma_3/Exceptions/regress-95101.js
  15462. * kjs/nodes.cpp:
  15463. (FunctionCallNode::evaluate): evaluate now checks for an exception
  15464. after resolving a function name (in case the function is undefined)
  15465. 2005-07-01 Eric Seidel <eseidel@apple.com>
  15466. Reviewed by darin.
  15467. * kjs/interpreter.h:
  15468. (KJS::Context::curStmtFirstLine): stub for compatibility with KDE
  15469. * kjs/value.h:
  15470. (KJS::Value::isValid): compatibility with KDE
  15471. http://bugs.webkit.org/show_bug.cgi?id=3687
  15472. 2005-07-01 Eric Seidel <eseidel@apple.com>
  15473. Reviewed by darin.
  15474. * kjs/create_hash_table: rolled in changes from KDE, including
  15475. -n <namespace> support from KDOM and support for newer comments
  15476. http://bugs.webkit.org/show_bug.cgi?id=3771
  15477. 2005-06-30 Geoffrey Garen <ggaren@apple.com>
  15478. -rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to
  15479. throw exceptions for invalid break/continue statements
  15480. No layout tests because it's already covered by the Mozilla suite
  15481. Reviewed by mjs.
  15482. * kjs/internal.h: LabelStack now tracks where you are relative to
  15483. switch and iteration (loop) statements
  15484. (KJS::LabelStack::LabelStack):
  15485. (KJS::LabelStack::pushIteration):
  15486. (KJS::LabelStack::popIteration):
  15487. (KJS::LabelStack::inIteration):
  15488. (KJS::LabelStack::pushSwitch):
  15489. (KJS::LabelStack::popSwitch):
  15490. (KJS::LabelStack::inSwitch):
  15491. * kjs/nodes.cpp:
  15492. These files were updated to use the new LabelStack:
  15493. (DoWhileNode::execute):
  15494. (WhileNode::execute):
  15495. (ForNode::execute):
  15496. (ForInNode::execute):
  15497. (SwitchNode::execute):
  15498. These files were updated to throw exceptions for invalid
  15499. break/continue statements:
  15500. (BreakNode::execute):
  15501. (ContinueNode::execute):
  15502. * tests/mozilla/expected.html: Updated expected results to reflect fix
  15503. 2005-06-30 Kevin Decker <kdecker@apple.com>
  15504. Reviewed by rjw.
  15505. fixed: <rdar://problem/4166838> failed assertion in`Interpreter::lockCount() > 0
  15506. no layout test added; this is in the bindings code.
  15507. * bindings/objc/WebScriptObject.mm:
  15508. (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]): make sure to lock and unlock the interpreter around allocations.
  15509. 2005-06-29 Geoffrey Garen <ggaren@apple.com>
  15510. Patch by Francisco Tolmasky <tolmasky@gmail.com>
  15511. - fixes http://bugs.webkit.org/show_bug.cgi?id=3667
  15512. Core JavaScript 1.5 Reference:Objects:Array:forEach
  15513. See WebCore Changelog for layout tests added.
  15514. Reviewed by darin.
  15515. * kjs/array_object.cpp:
  15516. (ArrayProtoFuncImp::call):
  15517. * kjs/array_object.h:
  15518. (KJS::ArrayProtoFuncImp::):
  15519. 2005-06-29 Geoffrey Garen <ggaren@apple.com>
  15520. Patch contributed by Oliver Hunt <ojh16@student.canterbury.ac.nz>
  15521. -fixed http://bugs.webkit.org/show_bug.cgi?id=3743
  15522. Incorrect error message given for certain calls
  15523. See WebCore Changelog for layout test added.
  15524. Reviewed by mjs.
  15525. * kjs/object.cpp:
  15526. (KJS::ObjectImp::defaultValue):
  15527. 2005-06-29 Geoffrey Garen <ggaren@apple.com>
  15528. Rolling out date patch from 6-28-05 because it breaks
  15529. fast/js/date-parse-test
  15530. * kjs/date_object.cpp:
  15531. (formatLocaleDate):
  15532. (DateProtoFuncImp::call):
  15533. (DateObjectImp::construct):
  15534. (KJS::parseDate):
  15535. (ymdhms_to_seconds):
  15536. (isSpaceOrTab):
  15537. (KJS::KRFCDate_parseDate):
  15538. * kjs/date_object.h:
  15539. * tests/mozilla/expected.html:
  15540. 2005-06-29 Geoffrey Garen <ggaren@apple.com>
  15541. Reviewed by Darin.
  15542. -fixes http://bugs.webkit.org/show_bug.cgi?id=3750
  15543. build fails with KJS_VERBOSE set
  15544. * kjs/nodes.cpp: changed debug print statement to use UString
  15545. (VarDeclNode::evaluate):
  15546. * kjs/reference.cpp: ditto
  15547. (KJS::Reference::putValue):
  15548. 2005-06-28 Geoffrey Garen <ggaren@apple.com>
  15549. Patch contributed by Carsten Guenther <cguenther@gmail.com>.
  15550. -fixes http://bugs.webkit.org/show_bug.cgi?id=3477
  15551. some US-centric date formats not parsed by JavaScript (clock at news8austin.com)
  15552. Reviewed by darin.
  15553. * kjs/date_object.cpp:
  15554. (formatLocaleDate):
  15555. (day):
  15556. (dayFromYear):
  15557. (daysInYear):
  15558. (timeFromYear):
  15559. (yearFromTime):
  15560. (weekDay):
  15561. (timeZoneOffset):
  15562. (DateProtoFuncImp::call):
  15563. (DateObjectImp::construct):
  15564. (KJS::parseDate):
  15565. (ymdhms_to_seconds):
  15566. (KJS::makeTime):
  15567. (findMonth):
  15568. (KJS::KRFCDate_parseDate):
  15569. * kjs/date_object.h:
  15570. * tests/mozilla/expected.html: updated expected test results to reflect fix
  15571. 2005-06-26 Maciej Stachowiak <mjs@apple.com>
  15572. Reviewed by Darin.
  15573. - replace hash functions with better ones
  15574. * JavaScriptCore.pbproj/project.pbxproj: Add new file to build.
  15575. * kjs/interpreter_map.cpp:
  15576. (KJS::InterpreterMap::computeHash): Use shared pointer hash.
  15577. * kjs/pointer_hash.h: Added.
  15578. (KJS::pointerHash): Pointer hash based on 32-bit mix and 64-bit mix hashes.
  15579. * kjs/protected_values.cpp:
  15580. (KJS::ProtectedValues::computeHash): Use shared pointer hash.
  15581. * kjs/ustring.cpp:
  15582. (KJS::UString::Rep::computeHash): Use SuperFastHash algorithm.
  15583. 2005-06-22 Darin Adler <darin@apple.com>
  15584. Change by Anders Carlsson.
  15585. Reviewed by me.
  15586. - fixed <http://bugs.webkit.org/show_bug.cgi?id=3294>
  15587. String.prototype.replace() fails with function as second param
  15588. * kjs/string_object.cpp: (replace): Added code to handle functions.
  15589. * tests/mozilla/expected.html: Updated since ecma_3/RegExp/regress-209067.js is fixed now.
  15590. * tests/mozilla/run-mozilla-tests: Fix a minor coding style issue that leads to a warning each
  15591. time we run the tests.
  15592. 2005-06-21 Adele Peterson <adele@apple.com>
  15593. rolling out fix for http://bugs.webkit.org/show_bug.cgi?id=3293, since it caused layout test failures.
  15594. fast/forms/element-by-name
  15595. fast/loader/loadInProgress
  15596. * ChangeLog:
  15597. * bindings/objc/objc_runtime.h:
  15598. * bindings/objc/objc_runtime.mm:
  15599. (ObjcFallbackObjectImp::hasProperty):
  15600. * bindings/runtime_array.cpp:
  15601. (RuntimeArrayImp::hasProperty):
  15602. * bindings/runtime_array.h:
  15603. * bindings/runtime_object.cpp:
  15604. (RuntimeObjectImp::hasProperty):
  15605. * bindings/runtime_object.h:
  15606. * kjs/array_instance.h:
  15607. * kjs/array_object.cpp:
  15608. (ArrayInstanceImp::hasProperty):
  15609. * kjs/function.cpp:
  15610. (KJS::FunctionImp::hasProperty):
  15611. (KJS::ActivationImp::hasProperty):
  15612. * kjs/function.h:
  15613. * kjs/object.cpp:
  15614. (KJS::ObjectImp::hasProperty):
  15615. * kjs/object.h:
  15616. * kjs/object_object.cpp:
  15617. (ObjectPrototypeImp::ObjectPrototypeImp):
  15618. (ObjectProtoFuncImp::call):
  15619. * kjs/object_object.h:
  15620. (KJS::ObjectProtoFuncImp::):
  15621. * kjs/string_object.cpp:
  15622. (StringInstanceImp::hasProperty):
  15623. * kjs/string_object.h:
  15624. * tests/mozilla/expected.html:
  15625. 2005-06-21 Darin Adler <darin@apple.com>
  15626. * JavaScriptCore.pbproj/project.pbxproj: Switched to a build rule rather than a build phase for
  15627. .y files -- this gets rid of the problem where modifying the .y file would not cause sufficient
  15628. compilation.
  15629. * kjs/grammar_wrapper.cpp: Removed.
  15630. 2005-06-21 Adele Peterson <adele@apple.com>
  15631. Patch from Anders Carlsson <andersca@mac.com>, reviewed by Darin.
  15632. Fixed: <http://bugs.webkit.org/show_bug.cgi?id=3450>
  15633. <rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}
  15634. * pcre/pcre.c: (pcre_compile): Remember the last char length so it can be subtracted correctly if needed.
  15635. 2005-06-21 Geoffrey Garen <ggaren@apple.com>
  15636. - fixed <rdar://problem/4155532> 'delete' succeeds on functions
  15637. - fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property
  15638. Reviewed by cblu.
  15639. * kjs/nodes.cpp:
  15640. (FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.
  15641. Test cases:
  15642. * tests/mozilla/expected.html: Updated for one new success.
  15643. - see also test case added in WebCore.
  15644. 2005-06-20 Maciej Stachowiak <mjs@apple.com>
  15645. Reviewed by Darin(first pass) and Hyatt.
  15646. - fixed http://bugs.webkit.org/show_bug.cgi?id=3576
  15647. (roll in support for "const" keyword from KDE tree)
  15648. - make processVarDecls handle deletability of variables declared
  15649. in an eval block the same as evaluate would
  15650. - make eval() call processVarDecls - needed to match mozilla and
  15651. to make the second change testable
  15652. I started with the KDE implementation of const but I ended up changing it a bit
  15653. to avoid the use of a global variable. Now instead of the global variable it distinguishes
  15654. const and var at the grammar level so the appropriate node can know the right kind of
  15655. declaration.
  15656. Test cases:
  15657. * tests/mozilla/expected.html: Updated for one new test that is
  15658. failing - we used to bail on it entirely because it checks for
  15659. const support before starting.
  15660. - see also test cases added in WebCore
  15661. * kjs/grammar.y: Add rules for const declarations.
  15662. * kjs/keywords.table: Add const keyword.
  15663. * kjs/nodes.cpp:
  15664. (VarDeclNode::VarDeclNode): Add parameter.
  15665. (VarDeclNode::evaluate): Add const support.
  15666. (VarDeclNode::processVarDecls): Add const support.
  15667. (VarStatementNode::execute): Irrelevant change.
  15668. (ForInNode::ForInNode): Tell our variable node that it's a variable.
  15669. * kjs/nodes.h:
  15670. (KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
  15671. (KJS::VarStatementNode::VarStatementNode): Irrelevant change.
  15672. * kjs/function.cpp:
  15673. (KJS::GlobalFuncImp::call): Process var decls before evaluating.
  15674. 2005-06-20 Maciej Stachowiak <mjs@apple.com>
  15675. Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
  15676. - fixed http://bugs.webkit.org/show_bug.cgi?id=3293
  15677. Test cases added:
  15678. * tests/mozilla/expected.html: Updated for two fixed tests.
  15679. - also added a layout test
  15680. * bindings/objc/objc_runtime.h:
  15681. * bindings/objc/objc_runtime.mm:
  15682. (ObjcFallbackObjectImp::hasOwnProperty):
  15683. * bindings/runtime_array.cpp:
  15684. (RuntimeArrayImp::hasOwnProperty):
  15685. * bindings/runtime_array.h:
  15686. * bindings/runtime_object.cpp:
  15687. (RuntimeObjectImp::hasOwnProperty):
  15688. * bindings/runtime_object.h:
  15689. * kjs/array_instance.h:
  15690. * kjs/array_object.cpp:
  15691. (ArrayInstanceImp::hasOwnProperty):
  15692. * kjs/function.cpp:
  15693. (KJS::FunctionImp::hasOwnProperty):
  15694. (KJS::ActivationImp::hasOwnProperty):
  15695. * kjs/function.h:
  15696. * kjs/object.cpp:
  15697. (KJS::ObjectImp::hasProperty):
  15698. (KJS::ObjectImp::hasOwnProperty):
  15699. * kjs/object.h:
  15700. (KJS::Object::hasOwnProperty):
  15701. * kjs/object_object.cpp:
  15702. (ObjectPrototypeImp::ObjectPrototypeImp):
  15703. (ObjectProtoFuncImp::call):
  15704. * kjs/object_object.h:
  15705. (KJS::ObjectProtoFuncImp::):
  15706. * kjs/string_object.cpp:
  15707. (StringInstanceImp::hasOwnProperty):
  15708. * kjs/string_object.h:
  15709. 2005-06-18 Darin Adler <darin@apple.com>
  15710. Reviewed by Eric Seidel.
  15711. * pcre/get.c: (pcre_get_substring): Fix some computations so this works for UTF-16.
  15712. This is unused in the current JavaScriptCore, but still good to fix.
  15713. 2005-06-18 Darin Adler <darin@apple.com>
  15714. Change by Finlay Dobbie.
  15715. Reviewed by me.
  15716. - fixed <http://bugs.webkit.org/show_bug.cgi?id=3331>
  15717. 10.3.9 Build Failure: NSString may not respond to `+stringWithCString:encoding:'
  15718. * bindings/objc/WebScriptObject.mm: (-[WebScriptObject stringRepresentation]):
  15719. Undo change we did a while back to work around the gcc 3.3 compiler error.
  15720. It no longer seems to happen, and the workaround code was 10.4-specific.
  15721. 2005-06-16 Geoffrey Garen <ggaren@apple.com>
  15722. Fixed: <rdar://problem/4151759> 'delete' fails on variables declared inside 'eval' statements.
  15723. Reviewed by cblu.
  15724. * kjs/context.h:
  15725. (KJS::ContextImp::codeType): Added code type accessor for execution context objects.
  15726. * kjs/internal.cpp:
  15727. (ContextImp::ContextImp): Reflects change to ContextImp::codeType.
  15728. * kjs/nodes.cpp:
  15729. (VarDeclNode::evaluate): Added separate code path for variable declarations inside 'eval' statements.
  15730. * tests/mozilla/expected.html: Updated expected test results to reflect fix.
  15731. 2005-06-14 Geoffrey Garen <ggaren@apple.com>
  15732. Updated expected.html to reflect fix to <rdar://problem/4147745>.
  15733. Reviewed by cblu.
  15734. * tests/mozilla/expected.html:
  15735. 2005-06-14 Geoffrey Garen <ggaren@apple.com>
  15736. Fixed: <rdar://problem/4147745> JavaScript discards locally defined "arguments" property
  15737. No layout tests added because this change fixes existing tests:
  15738. ecma/ExecutionContexts/10.1.6.js
  15739. ecma_3/Function/regress-94506.js
  15740. js1_4/Functions/function-001.js
  15741. Reviewed by cblu.
  15742. * kjs/function.cpp:
  15743. (KJS::ActivationImp::get): get now checks for an "arguments" property defined in the local variable object
  15744. before trying to return the built-in arguments array.
  15745. * kjs/function.h: ActivationImp::put no longer overrides ObjectImp::put
  15746. 2005-06-10 Darin Adler <darin@apple.com>
  15747. Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
  15748. Reviewed by me.
  15749. - further improvements to exception file/line number fix
  15750. * kjs/nodes.h: Added setExceptionDetailsIfNeeded function.
  15751. * kjs/nodes.cpp: Updated macros to call the new setExceptionDetailsIfNeeded function.
  15752. (Node::setExceptionDetailsIfNeeded): Added.
  15753. 2005-06-09 Darin Adler <darin@apple.com>
  15754. Change by Mark Rowe <opendarwin.org@bdash.net.nz>
  15755. Reviewed by me.
  15756. * kjs/nodes.cpp: Get rid of unneeded this->.
  15757. 2005-06-08 Maciej Stachowiak <mjs@apple.com>
  15758. Change by Mark Rowe <opendarwin.org@bdash.net.nz>
  15759. Reviewed by me.
  15760. - fixed http://bugs.webkit.org/show_bug.cgi?id=3327
  15761. (Exception When Setting Style to Invalid Value Lacks Line/File Information)
  15762. * kjs/nodes.cpp: Include source file and line number when making exception in
  15763. KJS_CHECKEXCEPTIONVALUE.
  15764. 2005-06-07 Darin Adler <darin@apple.com>
  15765. Change by Toby Peterson <toby@opendarwin.org>.
  15766. Reviewed by me.
  15767. * JavaScriptCore.pbproj/project.pbxproj: Allow bison 2.0, which generates the file
  15768. with a different name.
  15769. 2005-06-07 Darin Adler <darin@apple.com>
  15770. Change by Toby Peterson <toby@opendarwin.org>.
  15771. Reviewed by me.
  15772. * kjs/grammar.y: Remove bogus extra line from grammar.y. Toby got this change from KDE KJS.
  15773. 2005-06-06 Darin Adler <darin@apple.com>
  15774. * tests/mozilla/run-mozilla-tests: Wrote a perl version of this so we don't require
  15775. the "jst" tool to run the tests.
  15776. 2005-06-04 Darin Adler <darin@apple.com>
  15777. Reviewed by Maciej.
  15778. - add libicu headers
  15779. * JavaScriptCore.pbproj/project.pbxproj: Added icu directory to header search path.
  15780. * icu/README: Added.
  15781. * icu/unicode/platform.h: Added.
  15782. * icu/unicode/uchar.h: Added.
  15783. * icu/unicode/uconfig.h: Added.
  15784. * icu/unicode/umachine.h: Added.
  15785. * icu/unicode/urename.h: Added.
  15786. * icu/unicode/utf.h: Added.
  15787. * icu/unicode/utf16.h: Added.
  15788. * icu/unicode/utf8.h: Added.
  15789. * icu/unicode/utf_old.h: Added.
  15790. * icu/unicode/utypes.h: Added.
  15791. * icu/unicode/uversion.h: Added.
  15792. 2005-05-19 Darin Adler <darin@apple.com>
  15793. Reviewed by Maciej.
  15794. - turned off exceptions and RTTI; seems to cut JavaScriptCore code size by about 22%
  15795. * JavaScriptCore.pbproj/project.pbxproj: Turn off exceptions and RTTI for both
  15796. the framework and testkjs tool.
  15797. 2005-05-18 Darin Adler <darin@apple.com>
  15798. Reviewed by Maciej.
  15799. - got rid of code that depended on RTTI
  15800. * kjs/collector.cpp:
  15801. (KJS::className): Added. Gets class name in a KJS way, rather than a C++ RTTI way.
  15802. (KJS::Collector::rootObjectClasses): Use className instead of typeid names.
  15803. 2005-05-18 Darin Adler <darin@apple.com>
  15804. Reviewed by Maciej.
  15805. - fix a failure seen in the Mozilla JavaScript tests where a live object was garbage-collected
  15806. when the only reference to it was in an argList on the stack
  15807. * kjs/list.h: Moved the operator= function into the .cpp file since it's too big to be
  15808. a good choice to inline.
  15809. * kjs/list.cpp: (KJS::List::operator=): Moved this formerly-inline function into a separate
  15810. file and added missing code to update valueRefCount. It's the latter that fixes the bug.
  15811. 2005-05-16 Darin Adler <darin@apple.com>
  15812. Reviewed by Adele.
  15813. - fixed issues preventing us from compiling with newer versions of gcc 4.0
  15814. * kjs/ustring.cpp:
  15815. (KJS::operator==): Remove redundant and illegal KJS:: prefix on this function's definition.
  15816. (KJS::operator<): Ditto.
  15817. (KJS::compare): Ditto.
  15818. 2005-05-09 Darin Adler <darin@apple.com>
  15819. Reviewed by John.
  15820. - turn on conservative GC unconditionally and start on SPI changes to
  15821. eliminate the now-unneeded smart pointers since we don't ref count any more
  15822. * kjs/value.h: Removed macros to turn conservative GC on and off.
  15823. Removed ref and deref functions.
  15824. (KJS::ValueImp::ValueImp): Removed non-conservative-GC code path.
  15825. (KJS::ValueImp::isUndefined): Added. New SPI to make it easier to deal with ValueImp directly.
  15826. (KJS::ValueImp::isNull): Ditto.
  15827. (KJS::ValueImp::isBoolean): Ditto.
  15828. (KJS::ValueImp::isNumber): Ditto.
  15829. (KJS::ValueImp::isString): Ditto.
  15830. (KJS::ValueImp::isObject): Ditto.
  15831. (KJS::Value::Value): Removed non-conservative-GC code path and made constructor no
  15832. longer explicit so we can quietly create Value wrappers from ValueImp *; inexpensive with
  15833. conservative GC and eases the transition.
  15834. (KJS::Value::operator ValueImp *): Added. Quietly creates ValueImp * from Value.
  15835. (KJS::ValueImp::marked): Removed non-conservative-GC code path.
  15836. * kjs/value.cpp:
  15837. (KJS::ValueImp::mark): Removed non-conservative-GC code path.
  15838. (KJS::ValueImp::isUndefinedOrNull): Added. New SPI to make it easier to deal with ValueImp directly.
  15839. (KJS::ValueImp::isBoolean): Ditto.
  15840. (KJS::ValueImp::isNumber): Ditto.
  15841. (KJS::ValueImp::isString): Ditto.
  15842. (KJS::ValueImp::asString): Ditto.
  15843. (KJS::ValueImp::isObject): Ditto.
  15844. (KJS::undefined): Ditto.
  15845. (KJS::null): Ditto.
  15846. (KJS::boolean): Ditto.
  15847. (KJS::string): Ditto.
  15848. (KJS::zero): Ditto.
  15849. (KJS::one): Ditto.
  15850. (KJS::two): Ditto.
  15851. (KJS::number): Ditto.
  15852. * kjs/object.h: Made constructor no longer explicit so we can quietly create Object
  15853. wrappers from ObjectImp *; inexpensive with conservative GC and eases the transition.
  15854. (KJS::Object::operator ObjectImp *): Added. Quietly creates ObjectImp * from Object.
  15855. (KJS::ValueImp::isObject): Added. Implementation of new object-related ValueImp function.
  15856. (KJS::ValueImp::asObject): Ditto.
  15857. * kjs/object.cpp:
  15858. (KJS::ObjectImp::setInternalValue): Remove non-conservative-GC code path.
  15859. (KJS::ObjectImp::putDirect): Ditto.
  15860. (KJS::error): Added. Function in the new SPI style to create an error object.
  15861. * kjs/internal.h: Added the new number-constructing functions as friends of NumberImp.
  15862. There may be a more elegant way to do this later; what's important now is the new SPI.
  15863. * kjs/collector.h: Remove non-conservative-GC code path and also take out some
  15864. unneeded APPLE_CHANGES.
  15865. * bindings/runtime_root.cpp:
  15866. (KJS::Bindings::addNativeReference): Remove non-conservative-GC code path.
  15867. (KJS::Bindings::removeNativeReference): Ditto.
  15868. (RootObject::removeAllNativeReferences): Ditto.
  15869. * bindings/runtime_root.h:
  15870. (KJS::Bindings::RootObject::~RootObject): Ditto.
  15871. (KJS::Bindings::RootObject::setRootObjectImp): Ditto.
  15872. * kjs/collector.cpp:
  15873. (KJS::Collector::allocate): Ditto.
  15874. (KJS::Collector::collect): Ditto.
  15875. (KJS::Collector::numGCNotAllowedObjects): Ditto.
  15876. (KJS::Collector::numReferencedObjects): Ditto.
  15877. (KJS::Collector::rootObjectClasses): Ditto.
  15878. * kjs/internal.cpp:
  15879. (NumberImp::create): Ditto.
  15880. (InterpreterImp::globalInit): Ditto.
  15881. (InterpreterImp::globalClear): Ditto.
  15882. * kjs/list.cpp:
  15883. (KJS::List::markProtectedLists): Ditto.
  15884. (KJS::List::clear): Ditto.
  15885. (KJS::List::append): Ditto.
  15886. * kjs/list.h:
  15887. (KJS::List::List): Ditto.
  15888. (KJS::List::deref): Ditto.
  15889. (KJS::List::operator=): Ditto.
  15890. * kjs/protect.h:
  15891. (KJS::gcProtect): Ditto.
  15892. (KJS::gcUnprotect): Ditto.
  15893. 2005-05-09 Chris Blumenberg <cblu@apple.com>
  15894. Workaround gcc 3.3 internal compiler errors.
  15895. Reviewed by darin.
  15896. * bindings/objc/WebScriptObject.mm:
  15897. (-[WebScriptObject stringRepresentation]): call [NSString stringWithCString:encoding] rather than using @""
  15898. 2005-05-09 Darin Adler <darin@apple.com>
  15899. * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
  15900. Not needed to make builds work, spews undesirable error messages too.
  15901. 2005-05-06 Darin Adler <darin@apple.com>
  15902. Reviewed by Maciej.
  15903. - make building multiple trees with make work better
  15904. * Makefile.am: Set up Xcode build directory before invoking xcodebuild.
  15905. 2005-05-04 Maciej Stachowiak <mjs@apple.com>
  15906. Reviewed by Darin.
  15907. <rdar://problem/4086570> Crash in JavaScriptCore with RSS Visualizer
  15908. * kjs/internal.cpp:
  15909. (InterpreterImp::mark): mark staticNaN, it is usually protected by the Number
  15910. prototype but there is a small window where it can get collected.
  15911. 2005-05-04 Darin Adler <darin@apple.com>
  15912. Reviewed by Dave Hyatt.
  15913. - another gcc-4.0-related fix
  15914. * bindings/runtime_root.h: Take off extra namespace prefixes that apparently cause problems
  15915. compiling with gcc 4.0, although I have not observed the problems.
  15916. 2005-05-04 Darin Adler <darin@apple.com>
  15917. Reviewed by Dave Hyatt.
  15918. - fixed build rules to match other projects
  15919. * JavaScriptCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
  15920. When built without a build style (by Apple B&I) we want to get the target from the
  15921. environment. But when built with a build style (by Safari engineers and others), we want
  15922. to use 10.3.
  15923. * Makefile.am: Took out extra parameters that make command-line building different from
  15924. Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
  15925. from command line to Xcode or back.
  15926. 2005-05-04 Maciej Stachowiak <mjs@apple.com>
  15927. - revert presumably accidental change to mozilla JS test expected results, this
  15928. was making the tests fail.
  15929. * tests/mozilla/expected.html:
  15930. 2005-05-03 Richard Williamson <rjw@apple.com>
  15931. Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
  15932. Correctly handle accessing nil objects from a Java object array.
  15933. Reviewed by John.
  15934. * bindings/jni/jni_runtime.cpp:
  15935. (JavaArray::valueAt):
  15936. 2005-05-01 Darin Adler <darin@apple.com>
  15937. - move to Xcode native targets and stop checking in generated files
  15938. * JavaScriptCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
  15939. files, so we don't have to check them in any more.
  15940. * Info.plist: Added. Native targets use a separate file for this.
  15941. * Makefile.am: Removed pcre and kjs SUBDIRS. Also removed code that deleted the embedded copy of this
  15942. framework, since we haven't been embedding it for some time.
  15943. * kjs/grammar_wrapper.cpp: Added. Shell used to compile grammar.cpp since we can't add a generated file
  15944. easily to the list of files to be compiled.
  15945. * kjs/.cvsignore: Removed.
  15946. * kjs/Makefile.am: Removed.
  15947. * kjs/array_object.lut.h: Removed.
  15948. * kjs/date_object.lut.h: Removed.
  15949. * kjs/grammar.cpp: Removed.
  15950. * kjs/grammar.cpp.h: Removed.
  15951. * kjs/grammar.h: Removed.
  15952. * kjs/lexer.lut.h: Removed.
  15953. * kjs/math_object.lut.h: Removed.
  15954. * kjs/number_object.lut.h: Removed.
  15955. * kjs/string_object.lut.h: Removed.
  15956. * pcre/.cvsignore: Removed.
  15957. * pcre/Makefile.am: Removed.
  15958. * pcre/chartables.c: Removed.
  15959. 2005-04-28 Darin Adler <darin@apple.com>
  15960. Reviewed by Dave Harrison.
  15961. - fixed problems preventing us from compiling with gcc 4.0
  15962. * JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
  15963. WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
  15964. * bindings/jni/jni_jsobject.cpp:
  15965. (JSObject::getSlot): Changed some %d to %ld where the parameters where long ints.
  15966. (JSObject::setSlot): Ditto.
  15967. * bindings/jni/jni_utility.cpp:
  15968. (KJS::Bindings::getJavaVM): Ditto.
  15969. (KJS::Bindings::getJNIEnv): Ditto.
  15970. * bindings/objc/objc_utility.mm: Fixed include of <JavascriptCore/internal.h> that needed the
  15971. letter "S" capitalized.
  15972. * kjs/bool_object.cpp: (BooleanProtoFuncImp::call): Rearranged how this function returns to
  15973. avoid incorrect gcc 4.0 warning.
  15974. * kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): Changed code to check
  15975. the alignment of the passed-in pointers to only require pointer-level alignment, not 8-byte alignment.
  15976. Prevents a crash on garbage collect when compiled with gcc 4.0.
  15977. * kjs/nodes.cpp:
  15978. (WhileNode::execute): Added a redundant return after an infinite loop to work around incorrect gcc 4.0 warning.
  15979. (ForNode::execute): Ditto.
  15980. (SwitchNode::execute):Rearranged how this function returns to avoid incorrect gcc 4.0 warning.
  15981. (LabelNode::execute): Ditto.
  15982. * kjs/string_object.cpp: (replace): Ditto.
  15983. 2005-04-26 Richard Williamson <rjw@apple.com>
  15984. Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
  15985. We were incompatible with Mozilla's implementation of the scripting APIs in
  15986. two ways:
  15987. Their NPN_SetException has the following signature:
  15988. void NPN_SetException(NPObject *npobj, const NPUTF8 *message);
  15989. ours has:
  15990. void NPN_SetException (NPObject * npobj, const NPString *message);
  15991. Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
  15992. We do not.
  15993. I changed both behaviors to match Mozilla.
  15994. Reviewed by Chris.
  15995. * bindings/NP_jsobject.cpp:
  15996. (_NPN_SetException):
  15997. * bindings/npruntime.cpp:
  15998. (_NPN_UTF8FromIdentifier):
  15999. (_NPN_IntFromIdentifier):
  16000. (_NPN_SetExceptionWithUTF8):
  16001. * bindings/npruntime.h:
  16002. * bindings/npruntime_impl.h:
  16003. 2005-04-26 Maciej Stachowiak <mjs@apple.com>
  16004. Reviewed by Chris.
  16005. <rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
  16006. * kjs/string_object.cpp:
  16007. (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.
  16008. 2005-04-22 Darin Adler <darin@apple.com>
  16009. Reviewed by Maciej.
  16010. * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.
  16011. 2005-04-22 Darin Adler <darin@apple.com>
  16012. Reviewed by John.
  16013. - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present
  16014. * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
  16015. Not sure why we missed this one earlier.
  16016. * kjs/grammar.cpp: Regenerated.
  16017. === JavaScriptCore-412.1 ===
  16018. 2005-04-20 Darin Adler <darin@apple.com>
  16019. Reviewed by Maciej.
  16020. - speedups, total 12% on JavaScript iBench
  16021. I ran the benchmark under Shark and followed its advice a lot, mainly.
  16022. * kjs/collector.cpp:
  16023. (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
  16024. Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
  16025. have to bump it each time we call allocate. Put numLiveObjects into a local variable to
  16026. cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
  16027. than a pointer so we don't need a special case for NULL. Allow freeList to point to some
  16028. bogus item when the entire block is full rather than going out of our way to make it
  16029. point to NULL.
  16030. (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
  16031. the loop to avoid re-loading them over and over again.
  16032. (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
  16033. variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
  16034. into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
  16035. rather than numAllocationsSinceLastCollect.
  16036. (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
  16037. the loop to avoid re-loading them over and over again.
  16038. (KJS::Collector::rootObjectClasses): Ditto.
  16039. * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
  16040. directly, avoiding the conversion from Number to Value.
  16041. * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
  16042. the thing is an object and we don't want to do all the extra work; just cast directly.
  16043. * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
  16044. a branch -- in the hot case this just meant avoiding checking a variable we just set to false.
  16045. * kjs/lookup.cpp: (keysMatch): Marked this inline.
  16046. * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
  16047. (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
  16048. into a Value.
  16049. (NumberNode::evaluate): Ditto.
  16050. (StringNode::evaluate): Ditto.
  16051. (ArrayNode::evaluate): Ditto.
  16052. (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
  16053. Also just use a pointer for func, rather than an Object.
  16054. (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
  16055. passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
  16056. integer and back.
  16057. (DeleteNode::evaluate): Make a Value directly.
  16058. (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
  16059. (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
  16060. passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
  16061. integer and back.
  16062. (UnaryPlusNode::evaluate): Make a Value directly.
  16063. (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
  16064. passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
  16065. integer and back.
  16066. (BitwiseNotNode::evaluate): Make a Value directly.
  16067. (LogicalNotNode::evaluate): Ditto.
  16068. (ShiftNode::evaluate): Don't convert to a double before making a Value.
  16069. (RelationalNode::evaluate): Make a Value directly.
  16070. (EqualNode::evaluate): Ditto.
  16071. (BitOperNode::evaluate): Ditto.
  16072. (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
  16073. boolean in, often avoiding a conversion from floating point to integer and back.
  16074. (VarDeclNode::evaluate): Make a Value directly.
  16075. (ForNode::execute): Remove unused local variable.
  16076. * kjs/operations.h:
  16077. (KJS::isNaN): Inlined.
  16078. (KJS::isInf): Ditto.
  16079. (KJS::isPosInf): Ditto.
  16080. (KJS::isNegInf): Ditto.
  16081. * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
  16082. (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
  16083. (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
  16084. (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
  16085. boolean in, often avoiding a conversion from floating point to integer and back.
  16086. (KJS::mult): Ditto.
  16087. * kjs/property_map.cpp:
  16088. (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
  16089. re-getting them inside the loop.
  16090. (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
  16091. look at the value pointer in the mark function.
  16092. (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
  16093. re-getting them inside the loop.
  16094. (KJS::PropertyMap::put): Ditto.
  16095. (KJS::PropertyMap::insert): Ditto.
  16096. (KJS::PropertyMap::remove): Ditto.
  16097. (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
  16098. re-getting them inside the loop. Don't bother checking key for 0, since we already have
  16099. to check value for 0. (Also had to change clear() to set value to 0.)
  16100. (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
  16101. loop to avoid re-getting them inside the loop.
  16102. (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
  16103. (KJS::PropertyMap::save): Ditto.
  16104. - other changes
  16105. * kjs/protected_values.h: Remove unneeded class name qualifiers.
  16106. * kjs/reference.h:
  16107. (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
  16108. (KJS::Reference::Reference): Inlined.
  16109. * kjs/reference.cpp:
  16110. (KJS::Reference::getValue): Rewrite to not use getBase.
  16111. (KJS::Reference::putValue): Ditto.
  16112. (KJS::Reference::deleteValue): Dittol
  16113. * kjs/simple_number.h:
  16114. (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.
  16115. * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
  16116. to double in various cases that involve integers.
  16117. * kjs/ustring.h:
  16118. (KJS::UString::attach): Inlined.
  16119. (KJS::UString::release): Inlined.
  16120. * kjs/ustring.cpp:
  16121. (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.
  16122. * kjs/value.cpp:
  16123. (Value::Value): Added overloads for all the various specific types of values, so you don't have
  16124. to convert from, say, Number to Value, just to create one.
  16125. (Number::Number): Added an overload that takes a boolean to indicate the number is already
  16126. known to be an integer.
  16127. * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
  16128. a boolean to indicate if the number is known to be an integer (because it was a "simple number").
  16129. (KJS::ValueImp::marked): Inlined.
  16130. (KJS::ValueImp::dispatchType): Inlined.
  16131. (KJS::ValueImp::dispatchToPrimitive): Inlined.
  16132. (KJS::ValueImp::dispatchToBoolean): Inlined.
  16133. (KJS::ValueImp::dispatchToNumber): Inlined.
  16134. (KJS::ValueImp::dispatchToString): Inlined.
  16135. (KJS::ValueImp::dispatchToUInt32): Inlined.
  16136. 2005-04-14 Maciej Stachowiak <mjs@apple.com>
  16137. - make fast_malloc.h a private header, not project
  16138. * JavaScriptCore.pbproj/project.pbxproj:
  16139. 2005-04-12 Maciej Stachowiak <mjs@apple.com>
  16140. Reviewed by Richard.
  16141. <rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator
  16142. - use custom single-threaded malloc for all non-GC JavaScriptCore
  16143. allocations, for a 9.1% speedup on JavaScript iBench
  16144. * JavaScriptCore.pbproj/project.pbxproj:
  16145. * kjs/collector.cpp:
  16146. (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
  16147. (KJS::Collector::collect): And dlfree to free it.
  16148. * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
  16149. * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
  16150. macro to give a class custom operator new/delete
  16151. * kjs/identifier.cpp:
  16152. (KJS::Identifier::add): Use dlmalloc/dlfree.
  16153. * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
  16154. * kjs/property_map.cpp:
  16155. (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
  16156. (KJS::PropertyMap::rehash): ditto
  16157. * kjs/scope_chain.h:
  16158. * kjs/ustring.cpp:
  16159. (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
  16160. buffer, to hide allocation details from webcore.
  16161. (KJS::UString::UString): use createCopying when appropriate.
  16162. (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
  16163. (KJS::UString::expandedSize): likewise
  16164. (KJS::UString::expandCapacity): likewise
  16165. (KJS::UString::expandPreCapacity): likewise
  16166. (KJS::UString::spliceSubstringsWithSeparators): likewise
  16167. (KJS::UString::append): likewise
  16168. (KJS::UString::operator=): likewise
  16169. (KJS::UString::detach): likewise
  16170. * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.
  16171. 2005-04-11 Maciej Stachowiak <mjs@apple.com>
  16172. Reviewed by John.
  16173. <rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup
  16174. - Avoid using protected values hash for the two most common cases
  16175. - Bump up ListImp high water mark, new testing shows 508 ListImps are
  16176. created during JS iBench.
  16177. Net result is a 5.6% speedup on JavaScript iBench
  16178. * kjs/collector.cpp:
  16179. (KJS::Collector::collect): mark protected lists as appropriate.
  16180. * kjs/context.h:
  16181. * kjs/list.cpp:
  16182. (KJS::ListImp::markValues): Moved implementation from List::markValues
  16183. (KJS::List::markProtectedLists): Implemented - scan pool and overflow
  16184. list.
  16185. (KJS::allocateListImp): link lists outside the pool into a separate
  16186. doubly linked list to be able to mark protected lists
  16187. (KJS::deallocateListImp): do the corresponding delinking
  16188. (KJS::List::derefValues): do nothing in conservative GC mode
  16189. (KJS::List::refValues): do nothing in conservative GC mode
  16190. (KJS::List::markValues): call ListImp version
  16191. (KJS::List::append):
  16192. * kjs/list.h:
  16193. === Safari-412 ===
  16194. === Safari-411 ===
  16195. === Safari-410 ===
  16196. === Safari-409 ===
  16197. === Safari-408 ===
  16198. === Safari-407 ===
  16199. 2005-03-16 Jens Alfke <jens@apple.com>
  16200. Reviewed by Kevin.
  16201. Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
  16202. JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
  16203. In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
  16204. Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.
  16205. * kjs/function.cpp:
  16206. (KJS::GlobalFuncImp::call):
  16207. 2005-03-15 Richard Williamson <rjw@apple.com>
  16208. Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C
  16209. Added JavaScript boolean to type that can be converted to
  16210. ObjC scalar parameters.
  16211. Reviewed by Ken Kocienda.
  16212. * bindings/objc/objc_utility.mm:
  16213. (KJS::Bindings::convertValueToObjcValue):
  16214. === Safari-406 ===
  16215. === Safari-405 ===
  16216. === Safari-403 ===
  16217. === Safari-402 ===
  16218. === Safari-401 ===
  16219. === Safari-400 ===
  16220. === Safari-188 ===
  16221. 2005-02-21 Darin Adler <darin@apple.com>
  16222. * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.
  16223. 2005-02-17 Richard Williamson <rjw@apple.com>
  16224. Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string
  16225. Added nil check.
  16226. Reviewed by John Sullivan.
  16227. * bindings/jni/jni_runtime.cpp:
  16228. (JavaField::valueFromInstance):
  16229. === Safari-187 ===
  16230. 2005-02-11 Richard Williamson <rjw@apple.com>
  16231. Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls
  16232. Re-factored how 'native' wrappers for JS objects are created. The interpreter now
  16233. creates these wrappers. The WebCore subclass of the interpreter now overrides
  16234. createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.
  16235. Reviewed by Ken.
  16236. * bindings/c/c_utility.cpp:
  16237. (convertValueToNPVariant):
  16238. * bindings/jni/jni_instance.cpp:
  16239. (JavaInstance::invokeMethod):
  16240. * bindings/jni/jni_objc.mm:
  16241. (KJS::Bindings::dispatchJNICall):
  16242. * bindings/jni/jni_runtime.cpp:
  16243. (JavaField::valueFromInstance):
  16244. (JavaArray::valueAt):
  16245. * bindings/objc/WebScriptObject.mm:
  16246. (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
  16247. (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
  16248. * bindings/objc/WebScriptObjectPrivate.h:
  16249. * bindings/objc/objc_utility.h:
  16250. * bindings/objc/objc_utility.mm:
  16251. (KJS::Bindings::convertObjcValueToValue):
  16252. (KJS::Bindings::createObjcInstanceForValue):
  16253. * bindings/runtime.cpp:
  16254. (Instance::createBindingForLanguageInstance):
  16255. (Instance::createRuntimeObject):
  16256. (Instance::createLanguageInstanceForValue):
  16257. * bindings/runtime.h:
  16258. * kjs/interpreter.cpp:
  16259. (Interpreter::createLanguageInstanceForValue):
  16260. * kjs/interpreter.h:
  16261. === Safari-186 ===
  16262. 2005-02-10 Darin Adler <darin@apple.com>
  16263. "Reviewed" by Richard (he told me the file was obsolete).
  16264. - got rid of an obsolete file
  16265. * bindings/npsap.h: Removed.
  16266. === Safari-185 ===
  16267. === Safari-183 ===
  16268. 2005-02-03 Richard Williamson <rjw@apple.com>
  16269. Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120
  16270. Revert to old (and correct) behavior of returning runtime object
  16271. when passed as a parameter, rather than it's corresponding DOM
  16272. object.
  16273. Reviewed by Chris.
  16274. * bindings/objc/WebScriptObject.mm:
  16275. (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
  16276. === Safari-182 ===
  16277. 2005-01-28 Richard Williamson <rjw@apple.com>
  16278. Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object
  16279. Only use special 'back door' property to get the runtime object if thisObj isn't
  16280. already a runtime object.
  16281. <gratuitous> Cleaned up a couple of strcmp on ClassInfo name. Used == on
  16282. ClassInfo pointer instead.
  16283. Reviewed by Chris.
  16284. * bindings/c/c_utility.cpp:
  16285. (convertValueToNPVariant):
  16286. * bindings/objc/WebScriptObject.mm:
  16287. (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
  16288. * bindings/runtime_method.cpp:
  16289. (RuntimeMethodImp::call):
  16290. === Safari-181 ===
  16291. 2005-01-26 Richard Williamson <rjw@apple.com>
  16292. Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test
  16293. I added a member variable to ObjectImp. This changed it's size and consequently
  16294. hampered the optimizations built into the garbage collector. Objects no longer
  16295. fit within the allocators cell size, and thus allocation fell back to a slower
  16296. allocator.
  16297. As a result of this fix I also dramatically cleaned up how runtime objects are
  16298. accessed. The path mostly *removes* code.
  16299. Reviewed by Chris.
  16300. * bindings/runtime_method.cpp:
  16301. (RuntimeMethodImp::call):
  16302. * bindings/runtime_object.cpp:
  16303. (RuntimeObjectImp::get):
  16304. (RuntimeObjectImp::put):
  16305. (RuntimeObjectImp::canPut):
  16306. (RuntimeObjectImp::hasProperty):
  16307. (RuntimeObjectImp::defaultValue):
  16308. * bindings/runtime_object.h:
  16309. * kjs/object.cpp:
  16310. (KJS::ObjectImp::ObjectImp):
  16311. * kjs/object.h:
  16312. 2005-01-20 Darin Adler <darin@apple.com>
  16313. Reviewed by me, changes by Han Ming Ong.
  16314. - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0
  16315. * bindings/objc/WebScriptObjectPrivate.h: Make members public.
  16316. * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.
  16317. 2005-01-20 Richard Williamson <rjw@apple.com>
  16318. Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement
  16319. The comprehensive fix for this problem requires new API, as described in 3965326. However,
  16320. given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
  16321. like and Undefined object if invokeUndefinedMethodFromWebScript:withArguments: isn't
  16322. implemented on the bound object.
  16323. Reviewed by Chris.
  16324. * bindings/objc/objc_runtime.h:
  16325. * bindings/objc/objc_runtime.mm:
  16326. (ObjcFallbackObjectImp::type):
  16327. (ObjcFallbackObjectImp::implementsCall):
  16328. (ObjcFallbackObjectImp::toBoolean):
  16329. * bindings/testbindings.mm:
  16330. (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
  16331. (+[MyFirstInterface isKeyExcludedFromWebScript:]):
  16332. === Safari-180 ===
  16333. 2005-01-19 Richard Williamson <rjw@apple.com>
  16334. Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue
  16335. Fixed the following problems with LiveConnect that are demonstrated by the application
  16336. described in 3853676.
  16337. 1. If a nil object is passed in an array from Java to JavaScript we will crash.
  16338. 2. We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
  16339. 3. We will sometimes fail to find the correct static method ID.
  16340. Reviewed by Maciej.
  16341. * bindings/jni/jni_jsobject.cpp:
  16342. (JSObject::convertJObjectToValue):
  16343. (JSObject::listFromJArray):
  16344. * bindings/jni/jni_runtime.cpp:
  16345. (JavaField::valueFromInstance):
  16346. (JavaField::setValueToInstance):
  16347. * bindings/jni/jni_utility.cpp:
  16348. (KJS::Bindings::getMethodID):
  16349. (KJS::Bindings::convertValueToJValue):
  16350. * bindings/runtime_array.h:
  16351. 2005-01-18 Richard Williamson <rjw@apple.com>
  16352. Fixed several issues all arising from analysis of plugin detection code at ifilm.com:
  16353. Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
  16354. Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
  16355. Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
  16356. Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in
  16357. We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
  16358. tags. Also, if any of these elements are named they can be accessed from the document or window objects.
  16359. Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.
  16360. Reviewed by Chris.
  16361. * bindings/objc/objc_instance.h:
  16362. * bindings/objc/objc_instance.mm:
  16363. (ObjcInstance::supportsSetValueOfUndefinedField):
  16364. * bindings/runtime.h:
  16365. (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
  16366. * bindings/runtime_object.cpp:
  16367. (RuntimeObjectImp::RuntimeObjectImp):
  16368. (RuntimeObjectImp::get):
  16369. (RuntimeObjectImp::put):
  16370. (RuntimeObjectImp::canPut):
  16371. (RuntimeObjectImp::hasProperty):
  16372. (RuntimeObjectImp::defaultValue):
  16373. * bindings/runtime_object.h:
  16374. (KJS::RuntimeObjectImp::fallbackObject):
  16375. * kjs/object.cpp:
  16376. (KJS::ObjectImp::ObjectImp):
  16377. * kjs/object.h:
  16378. (KJS::ObjectImp::forwardingScriptMessage):
  16379. (KJS::ObjectImp::setForwardingScriptMessage):
  16380. 2005-01-18 Richard Williamson <rjw@apple.com>
  16381. Back out a change that was incorrectly committed yesterday.
  16382. Reviewed by Chris.
  16383. * bindings/objc/objc_utility.mm:
  16384. (KJS::Bindings::convertValueToObjcValue):
  16385. 2005-01-17 Richard Williamson <rjw@apple.com>
  16386. Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)
  16387. Keep track of originating execution context and target execution
  16388. context for native JS object wrappers, and perform appropriate
  16389. security checks.
  16390. Reviewed by David Harrison.
  16391. * bindings/NP_jsobject.cpp:
  16392. (_isSafeScript):
  16393. (_NPN_CreateScriptObject):
  16394. (_NPN_Invoke):
  16395. (_NPN_Evaluate):
  16396. (_NPN_GetProperty):
  16397. (_NPN_SetProperty):
  16398. (_NPN_RemoveProperty):
  16399. (_NPN_HasProperty):
  16400. (_NPN_HasMethod):
  16401. (_NPN_SetException):
  16402. * bindings/NP_jsobject.h:
  16403. * bindings/c/c_instance.cpp:
  16404. (CInstance::CInstance):
  16405. (CInstance::stringValue):
  16406. * bindings/c/c_instance.h:
  16407. * bindings/c/c_utility.cpp:
  16408. (convertValueToNPVariant):
  16409. * bindings/jni/jni_instance.cpp:
  16410. (JavaInstance::JavaInstance):
  16411. (JavaInstance::valueOf):
  16412. * bindings/jni/jni_instance.h:
  16413. * bindings/objc/WebScriptObject.mm:
  16414. (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
  16415. (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
  16416. (-[WebScriptObject KJS::Bindings::]):
  16417. (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
  16418. (-[WebScriptObject _isSafeScript]):
  16419. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  16420. (-[WebScriptObject evaluateWebScript:]):
  16421. (-[WebScriptObject setValue:forKey:]):
  16422. (-[WebScriptObject valueForKey:]):
  16423. (-[WebScriptObject removeWebScriptKey:]):
  16424. (-[WebScriptObject stringRepresentation]):
  16425. (-[WebScriptObject webScriptValueAtIndex:]):
  16426. (-[WebScriptObject setWebScriptValueAtIndex:value:]):
  16427. (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
  16428. * bindings/objc/WebScriptObjectPrivate.h:
  16429. * bindings/objc/objc_instance.h:
  16430. * bindings/objc/objc_runtime.mm:
  16431. (convertValueToObjcObject):
  16432. * bindings/objc/objc_utility.mm:
  16433. (KJS::Bindings::convertValueToObjcValue):
  16434. * bindings/runtime.cpp:
  16435. (Instance::Instance):
  16436. (Instance::operator=):
  16437. * bindings/runtime.h:
  16438. (KJS::Bindings::Instance::Instance):
  16439. (KJS::Bindings::Instance::setExecutionContext):
  16440. (KJS::Bindings::Instance::executionContext):
  16441. * bindings/runtime_root.cpp:
  16442. (RootObject::setInterpreter):
  16443. * bindings/runtime_root.h:
  16444. * kjs/interpreter.h:
  16445. (KJS::Interpreter::isGlobalObject):
  16446. (KJS::Interpreter::interpreterForGlobalObject):
  16447. (KJS::Interpreter::isSafeScript):
  16448. === Safari-179 ===
  16449. 2005-01-13 Vicki Murley <vicki@apple.com>
  16450. Reviewed by Adele.
  16451. - fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
  16452. * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"
  16453. 2005-01-12 Richard Williamson <rjw@apple.com>
  16454. Avoid additional work on dealloc by adding early out to
  16455. removeNativeReference(). (This will save time on dealloc
  16456. for all ObjC DOM objects.)
  16457. Reviewed by Darin.
  16458. * bindings/runtime_root.cpp:
  16459. (KJS::Bindings::removeNativeReference):
  16460. 2005-01-12 Richard Williamson <rjw@apple.com>
  16461. Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly
  16462. We were always returning the first "root" object for all runtime
  16463. objects. Changed 0 in loop to i, the index.
  16464. Reviewed by David Harrison.
  16465. * bindings/runtime_root.cpp:
  16466. (KJS::Bindings::rootForImp):
  16467. 2005-01-11 Richard Williamson <rjw@apple.com>
  16468. Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)
  16469. Use the new dispatching API to invoke JNI, rather than calling JNI
  16470. directly.
  16471. Reviewed by David Harrison.
  16472. * bindings/jni/jni_instance.cpp:
  16473. (JavaInstance::invokeMethod):
  16474. * bindings/jni/jni_runtime.cpp:
  16475. (JavaField::dispatchValueFromInstance):
  16476. (JavaField::valueFromInstance):
  16477. (JavaField::dispatchSetValueToInstance):
  16478. (JavaField::setValueToInstance):
  16479. * bindings/jni/jni_runtime.h:
  16480. * bindings/jni/jni_utility.cpp:
  16481. (KJS::Bindings::convertValueToJValue):
  16482. === Safari-178 ===
  16483. === Safari-177 ===
  16484. === Safari-176 ===
  16485. 2004-12-17 Maciej Stachowiak <mjs@apple.com>
  16486. Reviewed by Kevin.
  16487. <rdar://problem/3926869> Opening caches window after running PLT causes crash
  16488. * kjs/protected_values.cpp:
  16489. (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
  16490. the protected value table.
  16491. (KJS::ProtectedValues::increaseProtectCount): Ditto.
  16492. (KJS::ProtectedValues::decreaseProtectCount): Ditto.
  16493. 2004-12-16 Darin Adler <darin@apple.com>
  16494. Reviewed by Maciej.
  16495. - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase
  16496. * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
  16497. * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
  16498. non-locale-specific versions.
  16499. * kjs/string_object.lut.h: Regenerated.
  16500. 2004-12-14 Richard Williamson <rjw@apple.com>
  16501. Pass URL of plugin view when call into JNI.
  16502. Reviewed by Chris.
  16503. * bindings/jni/jni_objc.mm:
  16504. (KJS::Bindings::dispatchJNICall):
  16505. 2004-12-13 Richard Williamson <rjw@apple.com>
  16506. Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)
  16507. Add support for calling static Java methods from JavaScript.
  16508. Reviewed by Maciej.
  16509. * bindings/jni/jni_instance.cpp:
  16510. (JavaInstance::invokeMethod):
  16511. * bindings/jni/jni_runtime.cpp:
  16512. (JavaMethod::JavaMethod):
  16513. * bindings/jni/jni_runtime.h:
  16514. (KJS::Bindings::JavaMethod::isStatic):
  16515. * bindings/jni/jni_utility.cpp:
  16516. (callJNIStaticMethod):
  16517. (KJS::Bindings::callJNIBooleanMethod):
  16518. (KJS::Bindings::callJNIStaticBooleanMethod):
  16519. * bindings/jni/jni_utility.h:
  16520. 2004-12-13 Richard Williamson <rjw@apple.com>
  16521. Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)
  16522. Reviewed by John.
  16523. * bindings/jni/jni_instance.cpp:
  16524. (JavaInstance::invokeMethod):
  16525. * bindings/jni/jni_objc.mm:
  16526. (KJS::Bindings::dispatchJNICall):
  16527. * bindings/jni/jni_runtime.h:
  16528. * bindings/jni/jni_utility.h:
  16529. === Safari-175 ===
  16530. 2004-12-07 Maciej Stachowiak <mjs@apple.com>
  16531. Reviewed by Darin.
  16532. <rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)
  16533. The fix was to implement copy constructor and assignment operator,
  16534. the ones that worked on the base class did not replace the
  16535. defaults apparently!
  16536. * kjs/protect.h:
  16537. (KJS::ProtectedValue::ProtectedValue):
  16538. (KJS::ProtectedValue::operator=):
  16539. (KJS::ProtectedObject::ProtectedObject):
  16540. (KJS::ProtectedObject::operator=):
  16541. Also fixed a bug in the GC test mode that compares the results of
  16542. the old collector and the new collector.
  16543. * kjs/value.cpp:
  16544. (ValueImp::mark):
  16545. === Safari-173 ===
  16546. 2004-11-23 Richard Williamson <rjw@apple.com>
  16547. Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)
  16548. Reviewed by Ken.
  16549. * bindings/c/c_class.cpp:
  16550. (CClass::_commonInit):
  16551. 2004-11-21 Maciej Stachowiak <mjs@apple.com>
  16552. Reviewed by Ken.
  16553. <rdar://problem/3889696> Enable conservative garbage collection for JavaScript
  16554. * kjs/collector.cpp:
  16555. (KJS::Collector::Thread::Thread):
  16556. (KJS::destroyRegisteredThread):
  16557. (KJS::initializeRegisteredThreadKey):
  16558. (KJS::Collector::registerThread):
  16559. (KJS::Collector::markStackObjectsConservatively):
  16560. (KJS::Collector::markCurrentThreadConservatively):
  16561. (KJS::Collector::markOtherThreadConservatively):
  16562. * kjs/collector.h:
  16563. * kjs/internal.cpp:
  16564. (lockInterpreter):
  16565. * kjs/value.h:
  16566. === Safari-172 ===
  16567. 2004-11-15 Richard Williamson <rjw@apple.com>
  16568. Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].
  16569. Reviewed by Hyatt.
  16570. * bindings/objc/objc_instance.mm:
  16571. (ObjcInstance::stringValue):
  16572. * bindings/objc/objc_utility.h:
  16573. * bindings/objc/objc_utility.mm:
  16574. (KJS::Bindings::convertNSStringToString):
  16575. (KJS::Bindings::convertObjcValueToValue):
  16576. === Safari-171 ===
  16577. 2004-11-09 Chris Blumenberg <cblu@apple.com>
  16578. Fixed: <rdar://problem/3872724> soft link against JavaVM to save ~2MB RSHRD
  16579. Reviewed by rjw.
  16580. * ChangeLog:
  16581. * JavaScriptCore.pbproj/project.pbxproj: don't link against JavaVM
  16582. * bindings/softlinking.c: Added.
  16583. (loadFramework): new
  16584. (getFunctionPointer): new
  16585. (JNI_GetCreatedJavaVMs): load JavaVM if not already loaded, get _JNI_GetCreatedJavaVMs symbol if we don't already have it, call JNI_GetCreatedJavaVMs
  16586. === Safari-170 ===
  16587. 2004-11-04 Darin Adler <darin@apple.com>
  16588. Reviewed by Ken.
  16589. - fixed <rdar://problem/3865365> since -[WebScriptObject dealloc] does not call [super dealloc], the build will fail due to a warning
  16590. - fixed behavior so that [[WebScriptObject alloc] initWithCoder:] doesn't leak WebUndefined instances
  16591. and incidentally so that [[WebScriptObject alloc] init] returns the single shared instance rather
  16592. than allocating a new one
  16593. * bindings/objc/WebScriptObject.mm: Removed some stray semicolons.
  16594. (+[WebUndefined allocWithZone:]): Made this the common bottleneck that returns the single instance
  16595. of WebUndefined, since it's the single method that normally allocates new instances. Calls super to
  16596. actually allocate only the very first time it's called.
  16597. (-[WebUndefined initWithCoder:]): Simplified to just return self (no reason to re-lookup the single
  16598. shared instance since there can be only one).
  16599. (-[WebUndefined copyWithZone:]): Ditto.
  16600. (-[WebUndefined retain]): Ditto.
  16601. (-[WebUndefined retainCount]): Use UINT_MAX constant here (matches usage in NSObject.m for retain count
  16602. of class).
  16603. (-[WebUndefined autorelease]): Simplified to just return self (see above).
  16604. (-[WebUndefined copy]): No need to override this since it just turns around and calls copyWithZone:.
  16605. (-[WebUndefined dealloc]): Added an assertion since this method should never be called. Also added
  16606. a call to [super dealloc] after return; to make the new -Wdealloc-check compiler happy (fixing the
  16607. bug mentioned above).
  16608. (+[WebUndefined undefined]): Reimplemented; calls allocWithZone:NULL to get to the shared instance.
  16609. No need to call init, since that's a no-op for this class.
  16610. 2004-11-03 David Harrison <harrison@apple.com>
  16611. Reviewed by Darin.
  16612. Eliminate the use of a marker file to determine how to build.
  16613. * .cvsignore:
  16614. * Makefile.am:
  16615. 2004-11-01 Richard Williamson <rjw@apple.com>
  16616. Fixed <rdar://problem/3861469> Latest Real player crashes Safari on some sites.
  16617. Reviewed by Ken.
  16618. * bindings/c/c_instance.cpp:
  16619. (CInstance::invokeMethod):
  16620. (CInstance::invokeDefaultMethod):
  16621. Initialize out parameters to void type.
  16622. * bindings/c/c_runtime.cpp:
  16623. (CField::valueFromInstance):
  16624. (CField::setValueToInstance):
  16625. Initialize out parameters to void type.
  16626. Also added additional checks to protect against classes that
  16627. don't implement all functions.
  16628. 2004-11-01 Richard Williamson <rjw@apple.com>
  16629. Fixed <rdar://problem/3861257> WebUndefined should be returned for undefined values
  16630. Reviewed by John.
  16631. * ChangeLog:
  16632. * bindings/objc/WebScriptObject.mm:
  16633. (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
  16634. Added additional conversion Undefined -> WebUndefined.
  16635. * bindings/objc/objc_utility.mm:
  16636. (KJS::Bindings::convertObjcValueToValue):
  16637. Added additional conversion WebUndefined -> Undefined.
  16638. 2004-11-01 Darin Adler <darin@apple.com>
  16639. - fixed <rdar://problem/3855573> Remove reference to "WebScriptMethods" from WebScriptObject.h comments
  16640. * bindings/objc/WebScriptObject.h: Removed unneeded #ifdef protection for multiple includes (since
  16641. this is an Objective-C header and we use #import for those). Fixed comments as requested in the bug
  16642. report to match the contents of the file.
  16643. === Safari-169 ===
  16644. === Safari-168 ===
  16645. 2004-10-22 Ken Kocienda <kocienda@apple.com>
  16646. Reviewed by me
  16647. * JavaScriptCore.pbproj/project.pbxproj:
  16648. Add GCC_ENABLE_OBJC_GC and GCC_FAST_OBJC_DISPATCH flags.
  16649. === Safari-167 ===
  16650. 2004-10-13 Richard Williamson <rjw@apple.com>
  16651. Moved boolean checks prior to NSNumber checks. booleans are
  16652. NSNumbers.
  16653. Follow on to <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number.
  16654. Reviewed by John.
  16655. * bindings/objc/objc_utility.mm:
  16656. (KJS::Bindings::convertObjcValueToValue):
  16657. 2004-10-12 Richard Williamson <rjw@apple.com>
  16658. Fixed access to DOM object via WebScriptObject API.
  16659. The execution context for DOM objects wasn't being found.
  16660. <rdar://problem/3831372> The valueForKey method for @"offsetLeft" on a paragraph element causes a crash.
  16661. Reviewed by Chris.
  16662. * bindings/objc/WebScriptObject.mm:
  16663. (_didExecute):
  16664. (-[WebScriptObject KJS::Bindings::]):
  16665. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  16666. (-[WebScriptObject evaluateWebScript:]):
  16667. (-[WebScriptObject setValue:forKey:]):
  16668. (-[WebScriptObject valueForKey:]):
  16669. (-[WebScriptObject stringRepresentation]):
  16670. * bindings/objc/WebScriptObjectPrivate.h:
  16671. 2004-10-09 Darin Adler <darin@apple.com>
  16672. Reviewed by Kevin.
  16673. - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
  16674. * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
  16675. creating an init routine.
  16676. * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
  16677. require a global constructor that creates an init routine.
  16678. 2004-10-09 Darin Adler <darin@apple.com>
  16679. Reviewed by Kevin.
  16680. - fixed <rdar://problem/3822618> REGRESSION (164-165): expedia.com's popup help doesn't work
  16681. * kjs/reference.cpp: (Reference::putValue): Change so that references not found in any object
  16682. work with the window object of the page the function is in, not the page of the caller. This
  16683. is what all other browsers do. This code was hidden before by the "everything is defined on
  16684. window object" hack in WebCore.
  16685. 2004-10-07 Richard Williamson <rjw@apple.com>
  16686. Added simple JavaScript call tracing. Very useful for
  16687. debugging complex pages.
  16688. Tracing is only available in development builds and is
  16689. enabled by:
  16690. (gdb) set traceJavaScript = 1
  16691. or programatically
  16692. setTraceJavaScript(true)
  16693. Function, args, and return values are printed to console. Very
  16694. verbose.
  16695. Reviewed by Ken.
  16696. * kjs/function_object.cpp:
  16697. (FunctionProtoFuncImp::call):
  16698. * kjs/object.cpp:
  16699. (KJS::Object::call):
  16700. === Safari-166 ===
  16701. 2004-10-05 Richard Williamson <rjw@apple.com>
  16702. Fixed <rdar://problem/3819234> NPN_SetException (and throwException:) isn't implemented
  16703. Reviewed by Chris.
  16704. * bindings/NP_jsobject.cpp:
  16705. (_NPN_SetException):
  16706. * bindings/npruntime.cpp:
  16707. (_NPN_SetExceptionWithUTF8):
  16708. * bindings/objc/WebScriptObject.mm:
  16709. (+[WebScriptObject throwException:]):
  16710. * kjs/internal.h:
  16711. (KJS::InterpreterImp::context):
  16712. 2004-10-05 Richard Williamson <rjw@apple.com>
  16713. Fixed <rdar://problem/3821515> binding layer needs to convert NSNumber-bools to js type boolean not number
  16714. Reviewed by Ken.
  16715. * bindings/objc/objc_utility.mm:
  16716. (KJS::Bindings::convertObjcValueToValue):
  16717. 2004-10-04 Darin Adler <darin@apple.com>
  16718. Reviewed by Ken.
  16719. - rolled in a fix the KDE folks did for the operations that generate HTML fragments
  16720. * kjs/string_object.cpp: (StringProtoFuncImp::call): Added quote marks to generated HTML.
  16721. - rolled out an old workaround we don't need any more
  16722. * JavaScriptCore.pbproj/project.pbxproj: Remove -Wno-long-double because the <math.h> issue that
  16723. required it is no longer there.
  16724. 2004-09-30 Richard Williamson <rjw@apple.com>
  16725. Fixed <rdar://problem/3821215> NPN hasMethod and hasProperty functions should take NPObjects, not NPClass
  16726. Reviewed by Chris.
  16727. * bindings/NP_jsobject.cpp:
  16728. (_NPN_GetProperty):
  16729. (_NPN_HasProperty):
  16730. (_NPN_HasMethod):
  16731. * bindings/c/c_class.cpp:
  16732. (CClass::methodsNamed):
  16733. (CClass::fieldNamed):
  16734. * bindings/c/c_class.h:
  16735. * bindings/c/c_instance.cpp:
  16736. (CInstance::invokeMethod):
  16737. * bindings/jni/jni_class.cpp:
  16738. (JavaClass::methodsNamed):
  16739. * bindings/jni/jni_class.h:
  16740. * bindings/npruntime.h:
  16741. * bindings/objc/objc_class.h:
  16742. * bindings/objc/objc_class.mm:
  16743. (ObjcClass::methodsNamed):
  16744. * bindings/runtime.h:
  16745. * bindings/runtime_object.cpp:
  16746. (RuntimeObjectImp::get):
  16747. (RuntimeObjectImp::hasProperty):
  16748. 2004-09-29 Chris Blumenberg <cblu@apple.com>
  16749. Prepended underscores to NPN methods so that when the QT plug-in loads these symbols, it uses the non-underscore versions in WebKit. Without this, the QT plug-in was failing to load when launching Safari from the command-line.
  16750. Reviewed by rjw.
  16751. * JavaScriptCore.pbproj/project.pbxproj:
  16752. * bindings/NP_jsobject.cpp:
  16753. (_NPN_CreateScriptObject):
  16754. (_NPN_InvokeDefault):
  16755. (_NPN_Invoke):
  16756. (_NPN_Evaluate):
  16757. (_NPN_GetProperty):
  16758. (_NPN_SetProperty):
  16759. (_NPN_RemoveProperty):
  16760. (_NPN_HasProperty):
  16761. (_NPN_HasMethod):
  16762. * bindings/c/c_class.cpp:
  16763. (CClass::methodsNamed):
  16764. (CClass::fieldNamed):
  16765. * bindings/c/c_instance.cpp:
  16766. (CInstance::CInstance):
  16767. (CInstance::~CInstance):
  16768. (CInstance::operator=):
  16769. (CInstance::invokeMethod):
  16770. (CInstance::invokeDefaultMethod):
  16771. * bindings/c/c_runtime.cpp:
  16772. * bindings/c/c_runtime.h:
  16773. (KJS::Bindings::CField::name):
  16774. (KJS::Bindings::CMethod::name):
  16775. * bindings/npruntime.cpp:
  16776. (_NPN_GetStringIdentifier):
  16777. (_NPN_GetStringIdentifiers):
  16778. (_NPN_GetIntIdentifier):
  16779. (_NPN_IdentifierIsString):
  16780. (_NPN_UTF8FromIdentifier):
  16781. (_NPN_IntFromIdentifier):
  16782. (NPN_InitializeVariantWithObject):
  16783. (_NPN_ReleaseVariantValue):
  16784. (_NPN_CreateObject):
  16785. (_NPN_RetainObject):
  16786. (_NPN_ReleaseObject):
  16787. (_NPN_SetExceptionWithUTF8):
  16788. (_NPN_SetException):
  16789. 2004-09-26 Darin Adler <darin@apple.com>
  16790. * kjs/string_object.cpp: (StringProtoFuncImp::call): Remove strange use of high() and
  16791. low() to get Unicode value of character, and just use unicode().
  16792. 2004-09-26 Darin Adler <darin@apple.com>
  16793. - refine charAt/charCodeAt fix slightly
  16794. * kjs/string_object.cpp: (StringProtoFuncImp::call): Treat undefined the same was as an
  16795. omitted parameter, as we do everywhere else, and as other browsers do here.
  16796. 2004-09-26 Darin Adler <darin@apple.com>
  16797. Reviewed by Kevin.
  16798. - fixed <rdar://problem/3816097> REGRESSION: mailblocks, and presumably many other pages, failing because variable not found
  16799. * kjs/internal.cpp: (InterpreterImp::evaluate): Process variable declarations before executing
  16800. the program. We were doing this properly for functions, but not entire programs.
  16801. - fixed <rdar://problem/3814706> REGRESSION: text fields in mailblocks wizards do not accept keystrokes due to use of charCodeAt()
  16802. * kjs/string_object.cpp: (StringProtoFuncImp::call): Changed the implementation of charAt
  16803. and charCodeAt to treat a missing parameter as an index of 0, rather than an invalid index.
  16804. * tests/mozilla/expected.html: Update for two tests that now pass with these changes.
  16805. === Safari-165 ===
  16806. === Safari-164 ===
  16807. 2004-09-14 Richard Williamson <rjw@apple.com>
  16808. 1. Add class parameter to object allocation function. This is somewhat redundant, given that
  16809. the allocation function is in the class function vector, but people wanted to use the same
  16810. allocation function for different classes.
  16811. 2. Renamed NPN_Class to NPN_Invoke to match the name in the function vector.
  16812. 3. Add support for a default function on an object. This is a feature that ActiveX supports,
  16813. and will allow JavaScript code to be written that will look exactly the same for both ActiveX
  16814. plugins and Netscape or WebKit plugins. There are implementations included for the 'C' and
  16815. 'Objective-C' bindings.
  16816. There bugs are covered by
  16817. <rdar://problem/3776343> Support for default functions in the JavaScript bindings
  16818. <rdar://problem/3779186> NPN_Call needs to be renamed to NPN_Invoke
  16819. <rdar://problem/3674754> Need to implement latest npruntime.h
  16820. Reviewed by John.
  16821. * bindings/NP_jsobject.cpp:
  16822. (jsAllocate):
  16823. (NPN_InvokeDefault):
  16824. (NPN_Invoke):
  16825. * bindings/c/c_class.cpp:
  16826. * bindings/c/c_instance.cpp:
  16827. (CInstance::CInstance):
  16828. (CInstance::operator=):
  16829. (CInstance::invokeMethod):
  16830. (CInstance::invokeDefaultMethod):
  16831. * bindings/c/c_instance.h:
  16832. * bindings/c/c_runtime.cpp:
  16833. * bindings/c/c_runtime.h:
  16834. * bindings/jni/jni_instance.cpp:
  16835. (JavaInstance::invokeDefaultMethod):
  16836. * bindings/jni/jni_instance.h:
  16837. * bindings/npruntime.cpp:
  16838. (NPN_CreateObject):
  16839. * bindings/npruntime.h:
  16840. * bindings/objc/WebScriptObject.h:
  16841. * bindings/objc/objc_class.mm:
  16842. (ObjcClass::fallbackObject):
  16843. * bindings/objc/objc_instance.h:
  16844. * bindings/objc/objc_instance.mm:
  16845. (ObjcInstance::invokeDefaultMethod):
  16846. * bindings/objc/objc_runtime.h:
  16847. * bindings/objc/objc_runtime.mm:
  16848. (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
  16849. (ObjcFallbackObjectImp::get):
  16850. (ObjcFallbackObjectImp::put):
  16851. (ObjcFallbackObjectImp::canPut):
  16852. (ObjcFallbackObjectImp::implementsCall):
  16853. (ObjcFallbackObjectImp::call):
  16854. (ObjcFallbackObjectImp::hasProperty):
  16855. (ObjcFallbackObjectImp::deleteProperty):
  16856. (ObjcFallbackObjectImp::defaultValue):
  16857. * bindings/runtime.h:
  16858. (KJS::Bindings::Class::fallbackObject):
  16859. (KJS::Bindings::Instance::getValueOfUndefinedField):
  16860. (KJS::Bindings::Instance::setValueOfUndefinedField):
  16861. (KJS::Bindings::Instance::valueOf):
  16862. * bindings/runtime_object.cpp:
  16863. (RuntimeObjectImp::implementsCall):
  16864. (RuntimeObjectImp::call):
  16865. * bindings/runtime_object.h:
  16866. 2004-09-13 Maciej Stachowiak <mjs@apple.com>
  16867. Reviewed by Darin.
  16868. <rdar://problem/3794735> Gmail- sending a very long message with Safari is so slow it seems like a hang
  16869. * kjs/string_object.cpp:
  16870. (StringProtoFuncImp::call): Replaced implementation of replace()
  16871. method with function below...
  16872. (replace): In order to avoid excessive allocation and copying,
  16873. figure out the ranges of the original string and replacement
  16874. strings to be assembled, instead of constantly creating new
  16875. strings at each substitution. The old behavior is basically O(N^2)
  16876. for a global replace on a pattern that matches many places in the
  16877. string.
  16878. (regExpIsGlobal): Helper function for the above.
  16879. (expandSourceRanges): ditto
  16880. (pushSourceRange): ditto
  16881. (expandReplacements): ditto
  16882. (pushReplacement): ditto
  16883. * kjs/ustring.cpp:
  16884. (KJS::UString::spliceSubstringsWithSeparators): New method that
  16885. pieces together substring ranges of this string together with
  16886. specified separators, all at one go.
  16887. * kjs/ustring.h:
  16888. (KJS::UString::Range::Range): Added new helper class to represent
  16889. substring choices.
  16890. 2004-09-14 Maciej Stachowiak <mjs@apple.com>
  16891. Reviewed by Darin.
  16892. - fixed <rdar://problem/3800315> encode-URI-test layout test is failing
  16893. * kjs/function.cpp:
  16894. (KJS::GlobalFuncImp::call): Make sure to escape null
  16895. characters. This is a bug in the new code that made part of the
  16896. test fail.
  16897. 2004-09-13 Darin Adler <darin@apple.com>
  16898. Reviewed by Kevin and Maciej.
  16899. - new function to support fix for DIG bug in WebCore
  16900. * kjs/scope_chain.h: Added new push function that pushes another entire scope chain.
  16901. * kjs/scope_chain.cpp: (KJS::ScopeChain::push): Ditto.
  16902. 2004-09-12 Darin Adler <darin@apple.com>
  16903. * tests/mozilla/expected.html: Updated test results for 3 more tests that pass with the new version
  16904. of escape and unescape.
  16905. 2004-09-12 Darin Adler <darin@apple.com>
  16906. Reviewed by Maciej.
  16907. - fixed <rdar://problem/3798209> any non-ASCII characters are garbled in the result of toLocaleString
  16908. * kjs/date_object.cpp:
  16909. (formatLocaleDate): Replaced two old functions that used LongDateTime with this one new function that
  16910. uses CFDateFormatter.
  16911. (DateProtoFuncImp::call): Call the new formatLocaleDate instead of both formatLocaleDate and formatLocaleTime.
  16912. 2004-09-09 Maciej Stachowiak <mjs@apple.com>
  16913. Reviewed by Richard.
  16914. <rdar://problem/3493140> REGRESSION (85-100): cedille displays %-escaped in JavaScript message at hotmail.com
  16915. * kjs/function.cpp:
  16916. (KJS::GlobalFuncImp::call): Replace our escape() and unescape() implementations with
  16917. ones from KDE KJS, which have the proper latin-1 behavior to match Win IE.
  16918. * kjs/lexer.cpp:
  16919. (Lexer::isHexDigit): Made static and non-const.
  16920. * kjs/lexer.h:
  16921. === Safari-163 ===
  16922. 2004-09-06 Darin Adler <darin@apple.com>
  16923. * JavaScriptCore.pbproj/project.pbxproj: Bump MACOSX_DEPLOYMENT_TARGET to 10.3.
  16924. === Safari-162 ===
  16925. 2004-09-01 Richard Williamson <rjw@apple.com>
  16926. Add pid to exception messages (to help debug dashboard clients).
  16927. Reviewed by Chris.
  16928. * kjs/interpreter.cpp:
  16929. (Interpreter::evaluate):
  16930. === Safari-161 ===
  16931. 2004-08-20 Richard Williamson <rjw@apple.com>
  16932. Implemented new JNI abstraction. We no longer invoke Java methods
  16933. directly with JNI, rather we call into the plugin. This allows the
  16934. plugin to dispatch the call to the appropriate VM thread. This
  16935. change should (will?) fix a whole class of threading related problems with
  16936. the Java VM.
  16937. Reviewed by Hyatt.
  16938. * JavaScriptCore.pbproj/project.pbxproj:
  16939. * bindings/c/c_instance.h:
  16940. (KJS::Bindings::CInstance::setExecutionContext):
  16941. (KJS::Bindings::CInstance::executionContext):
  16942. * bindings/jni/jni_instance.cpp:
  16943. (JavaInstance::JavaInstance):
  16944. (JavaInstance::invokeMethod):
  16945. (JavaInstance::setExecutionContext):
  16946. (JavaInstance::executionContext):
  16947. * bindings/jni/jni_instance.h:
  16948. * bindings/jni/jni_jsobject.cpp:
  16949. (JSObject::convertJObjectToValue):
  16950. * bindings/jni/jni_runtime.cpp:
  16951. (JavaField::JavaField):
  16952. (JavaArray::convertJObjectToArray):
  16953. (JavaField::valueFromInstance):
  16954. (JavaArray::JavaArray):
  16955. (JavaArray::valueAt):
  16956. * bindings/jni/jni_runtime.h:
  16957. (KJS::Bindings::JavaArray::operator=):
  16958. (KJS::Bindings::JavaArray::executionContext):
  16959. * bindings/jni/jni_utility.h:
  16960. * bindings/objc/objc_instance.h:
  16961. (KJS::Bindings::ObjcInstance::setExecutionContext):
  16962. (KJS::Bindings::ObjcInstance::executionContext):
  16963. * bindings/runtime.cpp:
  16964. (Instance::createBindingForLanguageInstance):
  16965. * bindings/runtime.h:
  16966. * bindings/runtime_root.h:
  16967. (KJS::Bindings::RootObject::nativeHandle):
  16968. === Safari-158 ===
  16969. 2004-08-19 Vicki Murley <vicki@apple.com>
  16970. Reviewed by John.
  16971. * kjs/property_map.cpp:
  16972. (KJS::PropertyMap::put): initialize deletedElementIndex to zero, to make the compiler happy
  16973. 2004-08-17 Darin Adler <darin@apple.com>
  16974. Reviewed by Adele.
  16975. - fixed <rdar://problem/3746676> SAP WebDynpro app hangs inside JavaScript property map hash table code (deleted sentinel problem)
  16976. * kjs/property_map.h: Added some private functions.
  16977. * kjs/property_map.cpp:
  16978. (KJS::PropertyMap::clear): Set sentinelCount to 0.
  16979. (KJS::PropertyMap::put): Complete search for the element before choosing to use the deleted-element sentinel.
  16980. Also keep sentinel count up to date when we destroy a sentinel by overwriting with a new added element.
  16981. (KJS::PropertyMap::expand): Added. Calls rehash with a size 2x the old size, or 16.
  16982. (KJS::PropertyMap::rehash): Added. Refactored the rehash code into a separate function.
  16983. (KJS::PropertyMap::remove): Add one to sentinelCount, and rehash if 1/4 or more of the elements are
  16984. deleted-element sentinels.
  16985. (KJS::PropertyMap::checkConsistency): Check the sentinelCount.
  16986. 2004-08-16 Maciej Stachowiak <mjs@apple.com>
  16987. Code change by Eric Albert, reviewd by me.
  16988. <rdar://problem/3571960> washingtonpost.com claims I don't have cookies enabled and won't let me read articles
  16989. * kjs/date_object.cpp:
  16990. (timetUsingCF): Clamp time to LONG_MAX (getting rid of time_t
  16991. entirely would be even better, but is not required to fix this bug.
  16992. === Safari-157 ===
  16993. 2004-08-16 Richard Williamson <rjw@apple.com>
  16994. Fixed <rdar://problem/3581092> cash in KJS::Bindings::JSObject::eval at tcvetantcvetkov.com
  16995. Adds bullet proofing to protect against evaluation of bogus JS in all the flavors of bindings (Java, C, and ObjC).
  16996. Reviewed by Chris.
  16997. * bindings/NP_jsobject.cpp:
  16998. (NPN_Evaluate):
  16999. * bindings/jni/jni_jsobject.cpp:
  17000. (JSObject::eval):
  17001. * bindings/objc/WebScriptObject.mm:
  17002. (-[WebScriptObject evaluateWebScript:]):
  17003. 2004-08-15 Richard Williamson <rjw@apple.com>
  17004. More updates to np headers. Implemented new NPN functions.
  17005. Reviewed by Darin.
  17006. * bindings/NP_jsobject.cpp:
  17007. (NPN_HasProperty):
  17008. (NPN_HasMethod):
  17009. * bindings/npapi.h:
  17010. * bindings/npruntime.h:
  17011. 2004-08-13 Darin Adler <darin@apple.com>
  17012. - fix build so we can compile again
  17013. * bindings/npapi.h: Added. Richard forgot to check this in. The one I'm checking in here
  17014. is good enough so that we can compile, but it's only a stopgap measure, because I think
  17015. Richard has a newer one he wants to check in.
  17016. 2004-08-12 Richard Williamson <rjw@apple.com>
  17017. Bring npruntime.h and friends closer to compliance with
  17018. latest spec.
  17019. Reviewed by Maciej.
  17020. * JavaScriptCore.pbproj/project.pbxproj:
  17021. * bindings/NP_jsobject.cpp:
  17022. (jsAllocate):
  17023. (_NPN_CreateScriptObject):
  17024. (NPN_Call):
  17025. (NPN_Evaluate):
  17026. (NPN_GetProperty):
  17027. (NPN_SetProperty):
  17028. (NPN_RemoveProperty):
  17029. * bindings/NP_jsobject.h:
  17030. * bindings/c/c_instance.cpp:
  17031. (CInstance::invokeMethod):
  17032. * bindings/c/c_utility.cpp:
  17033. (convertNPVariantToValue):
  17034. * bindings/npruntime.cpp:
  17035. (NPN_IdentifierIsString):
  17036. (NPN_VariantIsVoid):
  17037. (NPN_VariantIsNull):
  17038. (NPN_VariantIsUndefined):
  17039. (NPN_VariantIsBool):
  17040. (NPN_VariantIsInt32):
  17041. (NPN_VariantIsDouble):
  17042. (NPN_VariantIsString):
  17043. (NPN_VariantIsObject):
  17044. (NPN_VariantToBool):
  17045. (NPN_VariantToString):
  17046. (NPN_VariantToInt32):
  17047. (NPN_VariantToDouble):
  17048. (NPN_VariantToObject):
  17049. (NPN_InitializeVariantAsVoid):
  17050. (NPN_InitializeVariantAsNull):
  17051. (NPN_InitializeVariantAsUndefined):
  17052. (NPN_InitializeVariantWithBool):
  17053. (NPN_InitializeVariantWithInt32):
  17054. (NPN_InitializeVariantWithDouble):
  17055. (NPN_InitializeVariantWithString):
  17056. (NPN_InitializeVariantWithStringCopy):
  17057. (NPN_InitializeVariantWithObject):
  17058. (NPN_InitializeVariantWithVariant):
  17059. (NPN_ReleaseVariantValue):
  17060. (NPN_CreateObject):
  17061. * bindings/npruntime.h:
  17062. (_NPString::):
  17063. (_NPString::_NPVariant::):
  17064. * bindings/npruntime_priv.h: Added.
  17065. 2004-08-12 Darin Adler <darin@apple.com>
  17066. Reviewed by Adele.
  17067. - fixed 3 problems with parse functions that I just wrote, fixing 3 more Mozilla JavaScript tests
  17068. * kjs/function.cpp:
  17069. (KJS::parseDigit): Fix typo, 'Z' instead of 'z', that prevented lowercase hex digits from working.
  17070. (KJS::parseInt): Add octal support. Specification says it's optional, but I guess not.
  17071. (KJS::parseFloat): Fix check for "0x" in parseFloat to return 0 rather than NaN. Also add code
  17072. to skip leading "+" or "-".
  17073. === Safari-156 ===
  17074. 2004-08-12 Darin Adler <darin@apple.com>
  17075. Reviewed by Ken.
  17076. - fixed 43 Mozilla JavaScript tests
  17077. * kjs/date_object.h: Change parseDate and timeClip to take and return doubles.
  17078. * kjs/date_object.cpp:
  17079. (DateObjectImp::construct): Change to use a timeClip function that takes and returns a double rather
  17080. than constructing a number object to pass to it.
  17081. (DateObjectFuncImp::call): Change to use a parseDate function that returns a double.
  17082. (KJS::parseDate): Change to return a double instead of creating the Number object here.
  17083. (KJS::timeClip): Implement this as specified in the language standard.
  17084. * kjs/error_object.cpp: (NativeErrorImp::NativeErrorImp): Set the DontDelete, ReadOnly, and DontEnum
  17085. flags on the prototype property.
  17086. * kjs/function.cpp:
  17087. (KJS::FunctionImp::get): Return null rather than undefined for arguments when the function is not
  17088. currently in scope.
  17089. (KJS::isStrWhiteSpace): Added. Matches specification for StrWhiteSpace. Could move it to some utility
  17090. file later.
  17091. (KJS::parseDigit): Added. Helper function for parseInt.
  17092. (KJS::parseInt): Added. Integer parser that puts result in a double so we're not limited to what
  17093. strtoll can handle. Also matches standard more closely.
  17094. (KJS::parseFloat): Added. Handles "0x" properly and passes flag to make empty string turn into NaN
  17095. instead of 0.
  17096. (KJS::GlobalFuncImp::call): Use the new parseInt and parseFloat.
  17097. * kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): Add a length property.
  17098. * kjs/lexer.h: Added error flag and sawError() function for detecting errors.
  17099. * kjs/lexer.cpp:
  17100. (Lexer::setCode): Clear error state.
  17101. (Lexer::lex): Set error state if the lexer encounters an error
  17102. * kjs/internal.cpp:
  17103. (NumberImp::toString): Roll in change from KDE version to special case 0 so we handle -0 correctly.
  17104. (Parser::parse): Use new lexer error method so those errors are treated like parser errors.
  17105. * kjs/math_object.cpp: (MathFuncImp::call): Change min and max to treat -0 as less than +0.
  17106. Change round to round values between -0.5 and -0 to -0 instead of +0.
  17107. * kjs/nodes.h: Add evaluateReference function to GroupNode.
  17108. * kjs/nodes.cpp: (GroupNode::evaluateReference): Pass references through groups (parenthesized
  17109. expressions) properly so that expressions like "delete (x.y)" work. Before, the parentheses
  17110. would change x.y into a value that can't be deleted as a side effect.
  17111. * kjs/string_object.cpp: Change parameter count for indexOf and lastIndexOf from 2 to 1 to match
  17112. the specification.
  17113. * kjs/testkjs.cpp: Rolled in changes from KDE to add a "quit" function to the test tool and
  17114. get rid of the fixed size limit for code.
  17115. * kjs/ustring.cpp: (KJS::UString::substr): Added optimized case for substr(0, length) so it just
  17116. returns the string without creating a new Rep, since I'm using substr in a place where it will
  17117. often be passed a 0.
  17118. * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed one wrong entry in the Unicode table I added to
  17119. the other day that was making a couple tests fail.
  17120. * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
  17121. * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
  17122. * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
  17123. * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
  17124. * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
  17125. * kjs/string_object.lut.h: Regenerated.
  17126. 2004-08-11 Darin Adler <darin@apple.com>
  17127. - fixed a tiny problem with the UTF-16 PCRE check-in
  17128. * pcre/maketables.c: (pcre_maketables): Fix mistake in table-generating code that sometimes caused
  17129. the ctype_meta flag to get set in items that should not have it.
  17130. * pcre/chartables.c: Regenerated.
  17131. 2004-08-10 Richard Williamson <rjw@apple.com>
  17132. Fixed <rdar://problem/3674747> Need to implement invokeUndefinedMethodFromWebScript:withArguments:
  17133. The following WebScripting methods are now supported on bound
  17134. objects:
  17135. - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args;
  17136. - (void)setValue:(id)value forUndefinedKey:(NSString *)key
  17137. - (id)valueForUndefinedKey:(NSString *)key
  17138. Reviewed by Chris.
  17139. * bindings/c/c_class.cpp:
  17140. (CClass::fieldNamed):
  17141. * bindings/c/c_class.h:
  17142. * bindings/jni/jni_class.cpp:
  17143. (JavaClass::fieldNamed):
  17144. * bindings/jni/jni_class.h:
  17145. * bindings/objc/objc_class.h:
  17146. (KJS::Bindings::ObjcClass::isa):
  17147. * bindings/objc/objc_class.mm:
  17148. (ObjcClass::methodsNamed):
  17149. (ObjcClass::fieldNamed):
  17150. (ObjcClass::fallbackObject):
  17151. * bindings/objc/objc_instance.h:
  17152. * bindings/objc/objc_instance.mm:
  17153. (ObjcInstance::invokeMethod):
  17154. (ObjcInstance::setValueOfField):
  17155. (ObjcInstance::setValueOfUndefinedField):
  17156. (ObjcInstance::getValueOfField):
  17157. (ObjcInstance::getValueOfUndefinedField):
  17158. * bindings/objc/objc_runtime.h:
  17159. (KJS::Bindings::ObjcField::~ObjcField):
  17160. (KJS::Bindings::ObjcField::ObjcField):
  17161. (KJS::Bindings::ObjcField::operator=):
  17162. (KJS::Bindings::FallbackObjectImp::classInfo):
  17163. * bindings/objc/objc_runtime.mm:
  17164. (ObjcField::ObjcField):
  17165. (ObjcField::name):
  17166. (ObjcField::type):
  17167. (ObjcField::valueFromInstance):
  17168. (ObjcField::setValueToInstance):
  17169. (FallbackObjectImp::FallbackObjectImp):
  17170. (FallbackObjectImp::get):
  17171. (FallbackObjectImp::put):
  17172. (FallbackObjectImp::canPut):
  17173. (FallbackObjectImp::implementsCall):
  17174. (FallbackObjectImp::call):
  17175. (FallbackObjectImp::hasProperty):
  17176. (FallbackObjectImp::deleteProperty):
  17177. (FallbackObjectImp::defaultValue):
  17178. * bindings/runtime.h:
  17179. (KJS::Bindings::Class::fallbackObject):
  17180. (KJS::Bindings::Instance::getValueOfUndefinedField):
  17181. (KJS::Bindings::Instance::setValueOfUndefinedField):
  17182. * bindings/runtime_object.cpp:
  17183. (RuntimeObjectImp::get):
  17184. (RuntimeObjectImp::put):
  17185. (RuntimeObjectImp::canPut):
  17186. (RuntimeObjectImp::hasProperty):
  17187. * bindings/testbindings.mm:
  17188. (-[MyFirstInterface valueForUndefinedKey:]):
  17189. (-[MyFirstInterface setValue:forUndefinedKey:]):
  17190. 2004-08-10 Darin Adler <darin@apple.com>
  17191. Reviewed by Dave.
  17192. - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed
  17193. * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
  17194. or uint16_t depending on the mode, and used appropriate in the 7 public functions
  17195. that need to use it.
  17196. * pcre/pcre.c: Add UTF-16 support to all functions.
  17197. * pcre/study.c: Ditto.
  17198. * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
  17199. the mode. Changed declarations to use symbolic constants and typedefs so we size
  17200. things to ichar when needed.
  17201. * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
  17202. sized to 16-bit characters instead of 8-bit.
  17203. * pcre/get.c:
  17204. (pcre_copy_substring): Use pcre_char instead of char.
  17205. (pcre_get_substring_list): Ditto.
  17206. (pcre_free_substring_list): Ditto.
  17207. (pcre_get_substring): Ditto.
  17208. (pcre_free_substring): Ditto.
  17209. * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
  17210. of hard-coding 8-bit table sizes.
  17211. * pcre/chartables.c: Regenerated.
  17212. * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
  17213. * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
  17214. is not null. The null string still has a null pointer. This prevents us from
  17215. passing a null through to the regular expression engine (which results in a null
  17216. error even when the string length is 0).
  17217. * kjs/regexp.cpp:
  17218. (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
  17219. (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.
  17220. 2004-08-09 Darin Adler <darin@apple.com>
  17221. Reviewed by Maciej.
  17222. - fixed 28 Mozilla JavaScript tests
  17223. * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Check for undefined rather than
  17224. checking the number of arguments for the join method.
  17225. * kjs/lexer.cpp: (Lexer::lex): Parse hexadecimal and octal constants in doubles rather
  17226. than integers, so we aren't limited to 32 bits.
  17227. * kjs/math_object.cpp: (MathFuncImp::call): Get rid of many unneeded special cases in
  17228. the implementation of the pow operation. Also simplied a case that was handling positive
  17229. and negative infinity separately.
  17230. * kjs/nodes.cpp: (ShiftNode::evaluate): Keep the result of shifts in a double instead of
  17231. putting them in a long, so that unsigned shift will work properly.
  17232. * kjs/number_object.cpp: Add the DontDelete and ReadOnly flags to the numeric constants.
  17233. * kjs/operations.cpp:
  17234. (KJS::isPosInf): Added an implementation inside APPLE_CHANGES that does not depend on the
  17235. sign of isinf; our isinf function returns +1 even for negative infinity.
  17236. (KJS::isNegInf): And again.
  17237. (KJS::relation): Put in a nice simple implementation of comparison inside APPLE_CHANGES.
  17238. Our floating point already handles the various infinity cases correctly.
  17239. * kjs/regexp_object.cpp:
  17240. (RegExpProtoFuncImp::call): Add missing return before Null() in Exec method.
  17241. (RegExpObjectImp::arrayOfMatches): Put undefined rather than an empty string into the
  17242. array in cases where we did not match.
  17243. (RegExpObjectImp::construct): Set the DontDelete, ReadOnly, and DontEnum flags for
  17244. "global", "ignoreCase", "multiline", and "source".
  17245. * kjs/string_object.cpp: (StringProtoFuncImp::call): For the match method, turn a null
  17246. string into undefined rather than an empty string. For the slice method, handle an
  17247. undefined parameter for the limit properly as decribed in the specification, and add
  17248. the limit to one case that didn't have the limit at all. For the methods that generate
  17249. HTML strings, use lowercase tags instead of uppercase.
  17250. * kjs/ustring.cpp:
  17251. (KJS::UChar::toLower): Use u_tolower from the ICU library.
  17252. (KJS::UChar::toUpper): Use u_toupper from the ICU library.
  17253. (KJS::UString::append): Fix some math that caused a buffer overflow.
  17254. (KJS::convertUTF16OffsetsToUTF8Offsets): Ignore negative numbers (-1 is used as a special
  17255. flag) rather than converting them all to 0.
  17256. (KJS::convertUTF8OffsetsToUTF16Offsets): Ditto.
  17257. * tests/mozilla/jsDriver.pl: Fixed the relative links to point to our actual test files.
  17258. * tests/mozilla/ecma/String/15.5.4.11-1.js: Fixed the Unicode table in this test to match
  17259. the Unicode specification in a few cases where it was wrong before.
  17260. * tests/mozilla/ecma/String/15.5.4.11-2.js: Ditto.
  17261. * tests/mozilla/ecma/String/15.5.4.11-3.js: Ditto.
  17262. * tests/mozilla/ecma/String/15.5.4.11-5.js: Ditto.
  17263. * tests/mozilla/ecma/String/15.5.4.11-6.js: Ditto.
  17264. * tests/mozilla/ecma/String/15.5.4.12-1.js: Ditto.
  17265. * tests/mozilla/ecma/String/15.5.4.12-2.js: Ditto.
  17266. * tests/mozilla/ecma/String/15.5.4.12-3.js: Ditto.
  17267. * tests/mozilla/ecma/String/15.5.4.12-4.js: Ditto.
  17268. * tests/mozilla/ecma/String/15.5.4.12-5.js: Ditto.
  17269. * JavaScriptCore.pbproj/project.pbxproj: Link to libicu.
  17270. * kjs/number_object.lut.h: Regenerated.
  17271. 2004-08-09 Darin Adler <darin@apple.com>
  17272. Reviewed by Maciej.
  17273. - fixed <rdar://problem/3753467> REGRESSION (137-138): reproducible buffer overrun in UString manipulation code
  17274. * kjs/ustring.cpp: (KJS::UString::append): Fix incorrect size computation. Without it
  17275. we get a buffer overflow.
  17276. === Safari-155 ===
  17277. 2004-08-05 Richard Williamson <rjw@apple.com>
  17278. Fixed part of 3674747. The QT guys need this for feature freeze.
  17279. This patch implements support for the
  17280. - (id)invokeUndefinedMethodFromWebScript:(NSString *)name withArguments:(NSArray *)args
  17281. method of objects bound to JavaScript.
  17282. Reviewed by John.
  17283. * ChangeLog:
  17284. * bindings/objc/objc_class.mm:
  17285. (ObjcClass::methodsNamed):
  17286. (ObjcClass::fieldNamed):
  17287. * bindings/objc/objc_instance.mm:
  17288. (ObjcInstance::invokeMethod):
  17289. * bindings/objc/objc_runtime.h:
  17290. (KJS::Bindings::ObjcMethod::~ObjcMethod):
  17291. (KJS::Bindings::ObjcMethod::isFallbackMethod):
  17292. (KJS::Bindings::ObjcMethod::javaScriptName):
  17293. * bindings/objc/objc_runtime.mm:
  17294. (ObjcMethod::ObjcMethod):
  17295. (ObjcMethod::getMethodSignature):
  17296. (ObjcMethod::setJavaScriptName):
  17297. * bindings/testbindings.mm:
  17298. 2004-08-04 Vicki Murley <vicki@apple.com>
  17299. Reviewed by mjs.
  17300. - fix <rdar://problem/3649789> SAP WebGUI has problems loading first page because of parse error
  17301. * kjs/lexer.cpp:
  17302. (Lexer::lex): if the current character is a '\' and the next character is a line terminator,
  17303. go to the next line and continue parsing the string (instead of failing). This matches
  17304. behavior in Mac IE and Mozilla.
  17305. 2004-08-03 Kevin Decker <kdecker@apple.com>
  17306. Reviewed by Darin.
  17307. Rolled in changes from the latest KJS sources that support additional
  17308. Number.prototype functions.
  17309. Specifically this patch covers the follow parts of the ECMA 3 spec:
  17310. 15.7.4.5, 15.7.4.6, and 15.7.4.7
  17311. Fixes:
  17312. <rdar://problem/3663716> missing Number.toFixed (and toPrecision, toExponential)
  17313. <rdar://problem/3749492> missing Number.toPrecision prototype implementation
  17314. <rdar://problem/3749591> missing Number.toExponential prototype implementation
  17315. * kjs/identifier.h: Added toFixed, toPrecision, and toExponential to the
  17316. list of supported identifiers (a macro).
  17317. * kjs/number_object.cpp: Implemented support for toFixed(), toPrecision(),
  17318. and toExponential().
  17319. (NumberPrototypeImp::NumberPrototypeImp):
  17320. (NumberProtoFuncImp::call):
  17321. * kjs/number_object.h: Added property names for toFixed, toPrecision,
  17322. and toExponential.
  17323. (KJS::NumberProtoFuncImp::):
  17324. * tests/mozilla/expected.html: Update results.
  17325. 2004-08-03 Darin Adler <darin@apple.com>
  17326. Reviewed by Ken.
  17327. - added support for copying RegExp objects so 7 more Mozilla regexp tests pass
  17328. * kjs/regexp_object.cpp: (RegExpObjectImp::construct): Check for case where
  17329. we are supposed to just copy the regular expression object, and do so.
  17330. Also tighten up arguments check to handle case where an actual "undefined"
  17331. is passed rather than just omitting an argument.
  17332. * tests/mozilla/expected.html: Update results.
  17333. 2004-08-02 Darin Adler <darin@apple.com>
  17334. * tests/mozilla/.cvsignore: Added.
  17335. * tests/mozilla/expected.html: Update results.
  17336. 2004-08-02 Darin Adler <darin@apple.com>
  17337. Reviewed by Ken.
  17338. - fixed RegExp.toString so 3 more Mozilla regexp tests pass
  17339. * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call):
  17340. Append the flags here so more tests paseed.
  17341. 2004-08-02 Darin Adler <darin@apple.com>
  17342. Reviewed by Ken.
  17343. - fixed a couple things making 5 Mozilla regexp tests pass
  17344. * kjs/regexp_object.cpp: (RegExpProtoFuncImp::call): Implement toString
  17345. for the prototype.
  17346. (RegExpObjectImp::construct): Fix bug where the string "undefined" would
  17347. be used as the flags string when no parameter was passed.
  17348. * kjs/regexp_object.h: (KJS::RegExpPrototypeImp::classInfo):
  17349. Added a class info object for RegExp prototype so it can return
  17350. a string instead of raising an exception when converting to a string.
  17351. * tests/mozilla/expected.html: Update results.
  17352. 2004-08-02 Darin Adler <darin@apple.com>
  17353. Reviewed by Kevin.
  17354. - fix crashes in mozilla tests due to mishandling NaN
  17355. * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Rerranged range checks after
  17356. calls to toInteger so that NaN will get turned into something that fits in an integer.
  17357. These were the ones John already fixed, but his fix used isnan and the new fix is
  17358. more efficient.
  17359. * kjs/number_object.cpp: (NumberProtoFuncImp::call): Rearranged radix range checks
  17360. after a call to toInteger to handle NaN properly. Also removed separate check
  17361. for undefined that's not needed.
  17362. * kjs/string_object.cpp: (StringProtoFuncImp::call): More of the same kinds of changes
  17363. as in the above two files, but for a lot more functions. Also changed one place with
  17364. an explicit check for undefined to instead just check isNaN.
  17365. * tests/mozilla/run-mozilla-tests: Changed to invoke jst using $SYMROOTS for people
  17366. like me who don't keep $SYMROOTS in their $PATH.
  17367. === Safari-154 ===
  17368. === Safari-153 ===
  17369. 2004-07-26 Kevin Decker <kdecker@apple.com>
  17370. Changes done by Darin, reviewed by Kevin.
  17371. - changed testkjs to build in Xcode rather than from Makefile
  17372. * .cvsignore: Removed obsolete files from this list.
  17373. * Makefile.am: Removed code to build testkjs; we do this in Xcode now.
  17374. Changed to build target "All" rather than default target. This makes us
  17375. build the testkjs test tool.
  17376. * dummy.cpp: Removed.
  17377. * kjs/.cvsignore: Removed obsolete files from this list, including
  17378. the testkjs tool, which is now built in the symroots directory.
  17379. * kjs/testkjs.cpp: Added copyright notice that was missing, since we have
  17380. changed this file. Also this has the nice side effect of causing the tool
  17381. to be rebuilt in the new location even if there are no other changes in
  17382. your tree when you check this out.
  17383. * tests/mozilla/run-mozilla-tests: Invoke perl explicitly so this works
  17384. without setting the execute bit on jsDriver.pl.
  17385. 2004-07-22 Kevin Decker <kdecker@apple.com>
  17386. Reviewed by Darin
  17387. Fixed <rdar://problem/3682340> (error console does not include source urls or line numbers of event exceptions).
  17388. * kjs/function_object.cpp:
  17389. (FunctionObjectImp::construct):
  17390. * kjs/function_object.h:
  17391. * kjs/object.cpp:
  17392. (KJS::ObjectImp::construct):
  17393. * kjs/object.h:
  17394. (KJS::Object::construct):
  17395. 2004-07-21 Darin Adler <darin@apple.com>
  17396. * bindings/npruntime.h: Fixed typo.
  17397. 2004-07-19 John Sullivan <sullivan@apple.com>
  17398. Reviewed by Maciej.
  17399. - bulletproofed array.slice() against NAN arguments. Harri noticed this
  17400. vulnerability in my patch for 3714644
  17401. * kjs/array_object.cpp:
  17402. (ArrayProtoFuncImp::call):
  17403. handle NAN parameters passed to slice() by clamping to 0 and length.
  17404. 2004-07-19 Richard Williamson <rjw@apple.com>
  17405. Fixed 3733349. Prevent Java applet callbacks into JavaScript after applet
  17406. has been destroyed.
  17407. Reviewed by John.
  17408. * bindings/jni/jni_jsobject.cpp:
  17409. (JSObject::invoke):
  17410. (JSObject::JSObject):
  17411. 2004-07-16 John Sullivan <sullivan@apple.com>
  17412. Reviewed by Maciej.
  17413. - fixed <rdar://problem/3714644> REGRESSION (125.8-146): bugzilla submit link
  17414. hangs browser with javascript
  17415. * kjs/array_object.cpp:
  17416. (ArrayProtoFuncImp::call):
  17417. Check for undefined type for args[0] the same way we were already checking
  17418. for args[1]. In this case, args was zero-length, but we were treating
  17419. args[0] like an integer anyway. Resulted in some code looping from a NAN
  17420. value to 4, taking approximately forever.
  17421. * JavaScriptCore.pbproj/project.pbxproj:
  17422. version wars
  17423. === Safari-152 ===
  17424. 2004-07-14 Maciej Stachowiak <mjs@apple.com>
  17425. Reviewed by John.
  17426. <rdar://problem/3711474>: (REGRESSION (125-146): JavaScript 'toString(16)' is broken)
  17427. <rdar://problem/3644873>: (REGRESSION (125-140u): secondary list doesn't fill in at Southwest.com)
  17428. * kjs/number_object.cpp:
  17429. (NumberProtoFuncImp::call): Initialize radix from dradix, not from itself!
  17430. 2004-07-13 Kevin Decker <kdecker@apple.com>
  17431. Reviewed by kocienda.
  17432. - made testkjs and JavaScriptCore a subtarget of 'All'
  17433. - testkjs now builds in $SYMROOTS
  17434. * JavaScriptCore.pbproj/project.pbxproj:
  17435. === Safari-151 ===
  17436. 2004-06-24 Chris Blumenberg <cblu@apple.com>
  17437. Ignore .mode1 files in JavaScriptCore.pbproj
  17438. Reviewed by kocienda.
  17439. * JavaScriptCore.pbproj/.cvsignore:
  17440. 2004-06-23 Richard Williamson <rjw@apple.com>
  17441. Implemented changes for latest npruntime.h.
  17442. Reviewed by Chris.
  17443. * JavaScriptCore.pbproj/project.pbxproj:
  17444. * bindings/NP_jsobject.cpp:
  17445. (listFromVariantArgs):
  17446. (identiferFromNPIdentifier):
  17447. (_NPN_CreateScriptObject):
  17448. (NPN_Call):
  17449. (NPN_Evaluate):
  17450. (NPN_GetProperty):
  17451. (NPN_SetProperty):
  17452. (NPN_RemoveProperty):
  17453. * bindings/NP_jsobject.h:
  17454. * bindings/c/c_class.cpp:
  17455. (CClass::methodsNamed):
  17456. (CClass::fieldNamed):
  17457. * bindings/c/c_instance.cpp:
  17458. (CInstance::invokeMethod):
  17459. * bindings/c/c_utility.cpp:
  17460. (convertNPVariantToValue):
  17461. * bindings/c/c_utility.h:
  17462. * bindings/npruntime.cpp:
  17463. (stringIdentifierEqual):
  17464. (stringIdentifierHash):
  17465. (getStringIdentifierDictionary):
  17466. (intIdentifierEqual):
  17467. (intIdentifierHash):
  17468. (getIntIdentifierDictionary):
  17469. (NPN_GetStringIdentifier):
  17470. (NPN_GetStringIdentifiers):
  17471. (NPN_GetIntIdentifier):
  17472. (NPN_IdentifierIsString):
  17473. (NPN_UTF8FromIdentifier):
  17474. (NPN_VariantToInt32):
  17475. (NPN_VariantToDouble):
  17476. (NPN_SetException):
  17477. * bindings/npruntime.h:
  17478. * bindings/objc/WebScriptObject.mm:
  17479. (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
  17480. * bindings/runtime_object.cpp:
  17481. (RuntimeObjectImp::~RuntimeObjectImp):
  17482. * bindings/runtime_root.cpp:
  17483. (KJS::Bindings::rootForInterpreter):
  17484. * bindings/testbindings.cpp:
  17485. (initializeIdentifiers):
  17486. (logMessage):
  17487. (setDoubleValue):
  17488. (setIntValue):
  17489. (setBooleanValue):
  17490. === JavaScriptCore-146.1 ===
  17491. 2004-06-16 Richard Williamson <rjw@apple.com>
  17492. Fixed <rdar://problem/3702287> Crash returning nil from bound ObjC
  17493. This turned out to be a show stopper for Dashboard. Accessing a nil
  17494. ObjC property from JS caused a crash. Similar to the problem
  17495. 3696112 fixed below.
  17496. Reviewed by Trey.
  17497. * bindings/objc/objc_runtime.mm:
  17498. (KJS::Bindings::ObjcField::valueFromInstance):
  17499. === Safari-146 ===
  17500. 2004-06-16 Richard Williamson <rjw@apple.com>
  17501. Fixed <rdar://problem/3696112>: nil from an Objective-C class seems to get wrapped as a JavaScript proxy that will not print.
  17502. This turned out to be a show stopper for Dashboard. We now
  17503. return Undefined() when nil is returned from a ObjC method
  17504. that returns an object type.
  17505. Reviewed by Maciej.
  17506. * bindings/objc/objc_utility.mm:
  17507. (KJS::Bindings::convertObjcValueToValue):
  17508. === Safari-145 ===
  17509. 2004-06-15 Richard Williamson <rjw@apple.com>
  17510. Fixed <rdar://problem/3695875>: Objective-C instances that are exported to JavaScript are too promiscuous
  17511. No longer need to check respondsToSelector: for
  17512. isSelectorExcludedFromWebScript: and isKeyExcludedFromWebScript:
  17513. because these now have a default implementation on NSObject.
  17514. Reviewed by Trey.
  17515. * bindings/objc/objc_class.mm:
  17516. (ObjcClass::methodsNamed):
  17517. (ObjcClass::fieldNamed):
  17518. 2004-06-14 Darin Adler <darin@apple.com>
  17519. Reviewed by Maciej.
  17520. - fixed some things for GC that Patrick missed, or that happened after the branch
  17521. * bindings/objc/WebScriptObject.mm:
  17522. (-[WebScriptObject dealloc]): Moved removeNativeReference call here from private object.
  17523. (-[WebScriptObject finalize]): Added.
  17524. - added some missing nil checks
  17525. * bindings/objc/objc_instance.mm:
  17526. (ObjcInstance::ObjcInstance): Check for nil.
  17527. (ObjcInstance::~ObjcInstance): Check for nil.
  17528. (ObjcInstance::operator=): Check for nil.
  17529. 2004-06-14 Darin Adler <darin@apple.com>
  17530. Reviewed by me, code changes by Patrick Beard.
  17531. - fixed <rdar://problem/3671507>: (WebKit should adopt GC changes and compile with GC enabled)
  17532. * bindings/objc/objc_instance.mm:
  17533. (ObjcInstance::ObjcInstance): Use CFRetain instead of retain.
  17534. (ObjcInstance::~ObjcInstance): Use CFRelease instead of release.
  17535. (ObjcInstance::operator=): More of the same.
  17536. (ObjcInstance::end): Use [pool drain] if compiling on Tiger.
  17537. * bindings/objc/objc_runtime.mm:
  17538. (ObjcArray::ObjcArray): Use CFRetain instead of retain.
  17539. (ObjcArray::~ObjcArray): Use CFRelease instead of release.
  17540. (ObjcArray::operator=): More of the same.
  17541. * bindings/testbindings.mm: Fixed incorrect license.
  17542. (main): Use [pool drain] if compiling on Tiger.
  17543. === Safari-144 ===
  17544. 2004-06-10 Kevin Decker <kdecker@apple.com>
  17545. Reviewed by John.
  17546. * kjs/lexer.cpp:
  17547. (Lexer::setCode):
  17548. - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
  17549. * kjs/lexer.h:
  17550. (KJS::Lexer::lineNo):
  17551. - fixed <rdar://problem/3682398>: (error console line numbers are offset by 1)
  17552. === JavaScriptCore-143.2 ===
  17553. 2004-06-07 Darin Adler <darin@apple.com>
  17554. - fixed <rdar://problem/3682489>: (JavaScriptGlue no longer compiles because Interpreter::evaluate parameters changed)
  17555. * kjs/interpreter.h: Added an overload to make JavaScriptGlue compile.
  17556. * kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Implemented the overload.
  17557. === JavaScriptCore-143.1 ===
  17558. 2004-06-04 Kevin Decker <kdecker@apple.com>
  17559. Reviewed by Darin
  17560. - fixed <rdar://problem/3680594>
  17561. * kjs/object.cpp:
  17562. (KJS::Error::create):
  17563. === Safari-143 ===
  17564. 2004-06-04 Darin Adler <darin@apple.com>
  17565. * kjs/testkjs.cpp: (main): Fix build breakage by adding URL and line number parameters.
  17566. 2004-06-04 Kevin Decker <kdecker@apple.com>
  17567. Reviewed by Dave.
  17568. - ObjC bindings do not (yet) pass along sourceurl or line numbers
  17569. - we don't have a way as of yet to accomidate line numbers and urls for dynamic javascript
  17570. - changed the wording of an error message
  17571. - the lexer, parser, and interpreter have been made "sourceURL aware"
  17572. - stored the url into Error
  17573. * bindings/NP_jsobject.cpp:
  17574. (NPN_Evaluate):
  17575. * bindings/jni/jni_jsobject.cpp:
  17576. (JSObject::eval):
  17577. * bindings/objc/WebScriptObject.mm:
  17578. (-[WebScriptObject evaluateWebScript:]):
  17579. * kjs/function.cpp:
  17580. (GlobalFuncImp::call):
  17581. * kjs/function_object.cpp:
  17582. (FunctionObjectImp::construct):
  17583. * kjs/internal.cpp:
  17584. (Parser::parse):
  17585. (InterpreterImp::checkSyntax):
  17586. (InterpreterImp::evaluate):
  17587. * kjs/internal.h:
  17588. * kjs/interpreter.cpp:
  17589. (Interpreter::evaluate):
  17590. * kjs/interpreter.h:
  17591. * kjs/lexer.cpp:
  17592. (Lexer::setCode):
  17593. * kjs/lexer.h:
  17594. (KJS::Lexer::sourceURL):
  17595. * kjs/nodes.cpp:
  17596. (Node::Node):
  17597. (Node::throwError):
  17598. (FunctionCallNode::evaluate):
  17599. * kjs/nodes.h:
  17600. * kjs/object.cpp:
  17601. (KJS::Error::create):
  17602. * kjs/object.h:
  17603. 2004-06-04 Richard Williamson <rjw@apple.com>
  17604. Fixed crash when attempting to access properties on nil
  17605. object.
  17606. Reviewed by John.
  17607. * bindings/objc/objc_instance.mm:
  17608. (ObjcInstance::getClass):
  17609. * bindings/runtime_object.cpp:
  17610. (RuntimeObjectImp::get):
  17611. * bindings/testM.js:
  17612. * bindings/testbindings.mm:
  17613. (-[MyFirstInterface getString]):
  17614. 2004-05-27 Kevin Decker <kdecker@apple.com>
  17615. Reviewed by Ken.
  17616. -revised generated error message content
  17617. * kjs/error_object.cpp:
  17618. (ErrorProtoFuncImp::call):
  17619. * kjs/internal.cpp:
  17620. (Parser::parse):
  17621. * kjs/object.cpp:
  17622. (KJS::Error::create):
  17623. === Safari-142 ===
  17624. 2004-05-27 Richard Williamson <rjw@apple.com>
  17625. Renamed WebScriptMethods to WebScripting based on feedback from Nancy.
  17626. Reviewed by Chris.
  17627. * bindings/objc/WebScriptObject.h:
  17628. 2004-05-27 Darin Adler <darin@apple.com>
  17629. Reviewed by Maciej.
  17630. - moved to new symlink technique for embedding frameworks
  17631. * JavaScriptCore.pbproj/project.pbxproj: Get rid of embed-frameworks build step
  17632. because we don't need it any more.
  17633. 2004-05-24 Richard Williamson <rjw@apple.com>
  17634. Changed RuntimeArrayImp to inherit from ArrayInstanceImp and
  17635. fixed ClassInfo to correctly reflect inheritance. This is required
  17636. because of the runtime checks in JSC for arrays, i.e. in
  17637. the Function objects apply method.
  17638. Reviewed by Ken.
  17639. * bindings/jni/jni_runtime.cpp:
  17640. (JavaArray::convertJObjectToArray):
  17641. * bindings/objc/objc_utility.mm:
  17642. (KJS::Bindings::convertObjcValueToValue):
  17643. * bindings/runtime_array.cpp:
  17644. (RuntimeArrayImp::RuntimeArrayImp):
  17645. * bindings/runtime_array.h:
  17646. * bindings/testM.js: Added.
  17647. * bindings/testbindings.mm:
  17648. (+[MyFirstInterface webScriptNameForSelector:]):
  17649. (-[MyFirstInterface logMessages:]):
  17650. (-[MyFirstInterface logMessage:prefix:]):
  17651. (-[MyFirstInterface callJSObject::]):
  17652. 2004-05-22 Darin Adler <darin@apple.com>
  17653. Reviewed by Maciej.
  17654. - fixed <rdar://problem/3664260>: (JS needs to listen to timezone change notifications)
  17655. * kjs/date_object.cpp: (CopyLocalTimeZone): As per Chris Kane and Jordan Hubbard, use <notify.h>
  17656. with a hardcoded string of "com.apple.system.timezone", and do CFTimeZoneResetSystem since
  17657. CoreFoundation doesn't do this itself. Turns out this affects the default time zone as long as
  17658. it hasn't been set explicitly.
  17659. === Safari-141 ===
  17660. 2004-05-20 Richard Williamson <rjw@apple.com>
  17661. Implemented WebScriptObject/DOM wrapper voodoo. DOM wrappers
  17662. can now be referenced like any other WebScriptObject, meaning
  17663. you can do JS operations on them.
  17664. All added implementation of finalizeForWebScript.
  17665. Reviewed by Ken.
  17666. * bindings/objc/WebScriptObject.h:
  17667. * bindings/objc/WebScriptObject.mm:
  17668. (-[WebScriptObject _initializeWithObjectImp:KJS::root:Bindings::]):
  17669. (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
  17670. (-[WebScriptObject KJS::]):
  17671. (-[WebScriptObject dealloc]):
  17672. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  17673. (-[WebScriptObject evaluateWebScript:]):
  17674. (-[WebScriptObject setValue:forKey:]):
  17675. (-[WebScriptObject valueForKey:]):
  17676. (-[WebScriptObject stringRepresentation]):
  17677. * bindings/objc/WebScriptObjectPrivate.h:
  17678. * bindings/objc/objc_instance.mm:
  17679. (ObjcInstance::~ObjcInstance):
  17680. 2004-05-19 Richard Williamson <rjw@apple.com>
  17681. Removed extraneous tabs that were added (by XCode?).
  17682. * bindings/objc/WebScriptObject.h:
  17683. 2004-05-19 Darin Adler <darin@apple.com>
  17684. - fixed headers with licenses mangled by Xcode auto-indenting
  17685. * bindings/jni/jni_jsobject.cpp:
  17686. * bindings/jni/jni_jsobject.h:
  17687. * bindings/runtime_array.h:
  17688. * bindings/runtime_root.cpp:
  17689. * bindings/runtime_root.h:
  17690. 2004-05-18 Richard Williamson <rjw@apple.com>
  17691. Added exception logging. Also check for exception and
  17692. set results as appropriate.
  17693. Reviewed by Maciej (partially reviewed).
  17694. * bindings/objc/WebScriptObject.mm:
  17695. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  17696. (-[WebScriptObject evaluateWebScript:]):
  17697. (-[WebScriptObject setValue:forKey:]):
  17698. (-[WebScriptObject valueForKey:]):
  17699. 2004-05-18 Richard Williamson <rjw@apple.com>
  17700. Finsished implementing support for windowScriptObject.
  17701. Had to make WebScriptObjectPrivate.h accessible from
  17702. WebCore.
  17703. Reviewed by Maciej.
  17704. * JavaScriptCore.pbproj/project.pbxproj:
  17705. * bindings/objc/WebScriptObjectPrivate.h:
  17706. 2004-05-18 Richard Williamson <rjw@apple.com>
  17707. Use KVC to set/get values instead of directly accessing
  17708. ivars.
  17709. Reviewed by Maciej.
  17710. * bindings/objc/WebScriptObject.mm:
  17711. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  17712. (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
  17713. * bindings/objc/objc_runtime.mm:
  17714. (ObjcField::valueFromInstance):
  17715. (convertValueToObjcObject):
  17716. (ObjcField::setValueToInstance):
  17717. 2004-05-17 Richard Williamson <rjw@apple.com>
  17718. Implemented new API for WebScriptObject.
  17719. Fixed <rdar://problem/3657145>: (objc to javascript method calls do not cause updates.)
  17720. Fixed <rdar://problem/3654887>: (Update to JSC to refer to new JSObject LiveConnect object) (w/ help from Vicki)
  17721. Reviewed by Hyatt.
  17722. * JavaScriptCore.pbproj/project.pbxproj:
  17723. * bindings/c/c_instance.cpp:
  17724. (CInstance::invokeMethod):
  17725. * bindings/jni/jni_instance.cpp:
  17726. (JavaInstance::invokeMethod):
  17727. * bindings/jni/jni_jsobject.cpp:
  17728. (JSObject::convertValueToJObject):
  17729. * bindings/jni/jni_utility.cpp:
  17730. (KJS::Bindings::getJNIField):
  17731. * bindings/objc/WebScriptObject.mm:
  17732. (_didExecute):
  17733. (-[WebScriptObject _initWithObjectImp:KJS::root:Bindings::]):
  17734. (-[WebScriptObject KJS::]):
  17735. (-[WebScriptObject dealloc]):
  17736. (+[WebScriptObject throwException:]):
  17737. (listFromNSArray):
  17738. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  17739. (-[WebScriptObject evaluateWebScript:]):
  17740. (-[WebScriptObject setValue:forKey:]):
  17741. (-[WebScriptObject valueForKey:]):
  17742. (-[WebScriptObject stringRepresentation]):
  17743. (+[WebScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
  17744. (+[WebUndefined undefined]):
  17745. (-[WebUndefined initWithCoder:]):
  17746. (-[WebUndefined encodeWithCoder:]):
  17747. (-[WebUndefined copyWithZone:]):
  17748. (-[WebUndefined retain]):
  17749. (-[WebUndefined release]):
  17750. (-[WebUndefined retainCount]):
  17751. (-[WebUndefined autorelease]):
  17752. (-[WebUndefined dealloc]):
  17753. (-[WebUndefined copy]):
  17754. (-[WebUndefined replacementObjectForPortCoder:]):
  17755. * bindings/objc/WebScriptObjectPrivate.h: Added.
  17756. * bindings/objc/objc_class.mm:
  17757. (ObjcClass::methodsNamed):
  17758. (ObjcClass::fieldNamed):
  17759. * bindings/objc/objc_instance.mm:
  17760. (ObjcInstance::invokeMethod):
  17761. * bindings/objc/objc_jsobject.h:
  17762. * bindings/objc/objc_jsobject.mm:
  17763. * bindings/objc/objc_runtime.mm:
  17764. (ObjcField::valueFromInstance):
  17765. * bindings/objc/objc_utility.mm:
  17766. (KJS::Bindings::JSMethodNameToObjCMethodName):
  17767. (KJS::Bindings::convertValueToObjcValue):
  17768. (KJS::Bindings::convertObjcValueToValue):
  17769. * bindings/runtime.cpp:
  17770. (Instance::setDidExecuteFunction):
  17771. (Instance::didExecuteFunction):
  17772. (Instance::setValueOfField):
  17773. * bindings/runtime.h:
  17774. * bindings/testbindings.mm:
  17775. (+[MyFirstInterface webScriptNameForSelector:]):
  17776. (-[MyFirstInterface callJSObject::]):
  17777. 2004-05-14 Vicki Murley <vicki@apple.com>
  17778. Reviewed by mjs.
  17779. <rdar://problem/3642427>: framework marketing number should be 2.0 for DoubleBarrel release
  17780. * JavaScriptCore.pbproj/project.pbxproj: change CFBundleShortVersionString to 2.0
  17781. === Safari-140 ===
  17782. 2004-05-13 Richard Williamson <rjw@apple.com>
  17783. Fixed indentation.
  17784. Reviewed by Chris.
  17785. * ChangeLog:
  17786. * bindings/objc/WebScriptObject.h:
  17787. 2004-05-13 Richard Williamson <rjw@apple.com>
  17788. Approved API changes. Currently unimplemented.
  17789. Reviewed by Chris.
  17790. * ChangeLog:
  17791. * JavaScriptCore.pbproj/project.pbxproj:
  17792. * bindings/objc/WebScriptObject.h: Added.
  17793. * bindings/objc/WebScriptObject.mm: Added.
  17794. (+[WebScriptObject throwException:]):
  17795. (-[WebScriptObject callWebScriptMethod:withArguments:]):
  17796. (-[WebScriptObject evaluateWebScript:]):
  17797. (-[WebScriptObject stringRepresentation]):
  17798. (+[WebUndefined undefined]):
  17799. (-[WebUndefined initWithCoder:]):
  17800. (-[WebUndefined encodeWithCoder:]):
  17801. (-[WebUndefined copyWithZone:]):
  17802. 2004-05-07 Vicki Murley <vicki@apple.com>
  17803. Reviewed by darin.
  17804. Turn off GC since it uses ppc only instructions (which breaks
  17805. the B&I build).
  17806. * kjs/value.h: set USE_CONSERVATIVE_GC to 0
  17807. === Safari-139 ===
  17808. 2004-05-07 Maciej Stachowiak <mjs@apple.com>
  17809. Reviewed by Darin.
  17810. - add -funroll-loops=16 compiler option for approx .5% speedup on
  17811. HTML iBench and .5-1% speedup on JS iBench.
  17812. * JavaScriptCore.pbproj/project.pbxproj:
  17813. 2004-04-25 Maciej Stachowiak <mjs@apple.com>
  17814. Reviewed by Darin.
  17815. Enable full conservative GC mode in addition to test mode. When
  17816. conservative GC is enabled, we now get an 11% speed improvement on
  17817. the iBench. Also fix some spots I missed before.
  17818. Specific noteworth changes:
  17819. * kjs/collector.cpp:
  17820. (KJS::Collector::markStackObjectsConservatively): Check possible
  17821. cell pointers for 8-byte aligment and verify they are not 0.
  17822. * kjs/protected_values.cpp:
  17823. (KJS::ProtectedValues::increaseProtectCount): Move null-tolerance from here...
  17824. (KJS::ProtectedValues::decreaseProtectCount): ...and here...
  17825. * kjs/protect.h:
  17826. (KJS::gcProtectNullTolerant): ...to here...
  17827. (KJS::gcUnprotectNullTolerant): ...and here, because not all callers need the null
  17828. tolerance, and doing the check is expensive.
  17829. * kjs/protected_values.cpp:
  17830. (KJS::ProtectedValues::computeHash): Replace hash function with a much faster one
  17831. that is still very good.
  17832. * kjs/protect.h:
  17833. (KJS::gcProtect):
  17834. (KJS::gcUnprotect):
  17835. (KJS::ProtectedValue::ProtectedValue):
  17836. (KJS::ProtectedValue::~ProtectedValue):
  17837. (KJS::ProtectedValue::operator=):
  17838. (KJS::ProtectedObject::ProtectedObject):
  17839. (KJS::ProtectedObject::~ProtectedObject):
  17840. (KJS::ProtectedObject::operator=):
  17841. (KJS::ProtectedReference::ProtectedReference):
  17842. (KJS::ProtectedReference::~ProtectedReference):
  17843. (KJS::ProtectedReference::operator=):
  17844. * kjs/protected_values.cpp:
  17845. (KJS::ProtectedValues::getProtectCount):
  17846. (KJS::ProtectedValues::increaseProtectCount):
  17847. (KJS::ProtectedValues::decreaseProtectCount):
  17848. (KJS::ProtectedValues::computeHash):
  17849. * bindings/runtime_root.cpp:
  17850. (KJS::Bindings::addNativeReference):
  17851. (KJS::Bindings::removeNativeReference):
  17852. (RootObject::removeAllNativeReferences):
  17853. * bindings/runtime_root.h:
  17854. (KJS::Bindings::RootObject::~RootObject):
  17855. (KJS::Bindings::RootObject::setRootObjectImp):
  17856. * kjs/collector.cpp:
  17857. (KJS::Collector::allocate):
  17858. (KJS::Collector::collect):
  17859. * kjs/collector.h:
  17860. * kjs/internal.cpp:
  17861. (NumberImp::create):
  17862. (InterpreterImp::globalInit):
  17863. (InterpreterImp::globalClear):
  17864. (InterpreterImp::mark):
  17865. * kjs/list.cpp:
  17866. (KJS::List::derefValues):
  17867. (KJS::List::refValues):
  17868. (KJS::List::append):
  17869. * kjs/object.cpp:
  17870. (KJS::ObjectImp::setInternalValue):
  17871. (KJS::ObjectImp::putDirect):
  17872. * kjs/value.cpp:
  17873. (ValueImp::mark):
  17874. (ValueImp::marked):
  17875. * kjs/value.h:
  17876. (KJS::ValueImp::ValueImp):
  17877. (KJS::ValueImp::~ValueImp):
  17878. (KJS::ValueImp::):
  17879. (KJS::Value::Value):
  17880. (KJS::Value::~Value):
  17881. (KJS::Value::operator=):
  17882. 2004-04-30 Richard Williamson <rjw@apple.com>
  17883. Asking an NSInvocation for it's return value when return type
  17884. is void throws an exception. Added check for void return types
  17885. to avoid this exception.
  17886. Reviewed by Ken.
  17887. * bindings/objc/objc_instance.mm:
  17888. (ObjcInstance::invokeMethod):
  17889. 2004-04-29 Richard Williamson <rjw@apple.com>
  17890. Fixed several bad problems with the ObjC bindings. In particular, conversion
  17891. to/from JavaScriptObject (soon to be WebScriptObject) was completely broken.
  17892. Reviewed by Chris.
  17893. * bindings/objc/objc_jsobject.h:
  17894. * bindings/objc/objc_jsobject.mm:
  17895. (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
  17896. (-[JavaScriptObject KJS::]):
  17897. (+[JavaScriptObject _convertValueToObjcValue:KJS::root:Bindings::]):
  17898. (-[JavaScriptObject call:arguments:]):
  17899. (-[JavaScriptObject evaluate:]):
  17900. (-[JavaScriptObject getMember:]):
  17901. (-[JavaScriptObject getSlot:]):
  17902. * bindings/objc/objc_runtime.mm:
  17903. (ObjcField::valueFromInstance):
  17904. (ObjcField::setValueToInstance):
  17905. * bindings/objc/objc_utility.mm:
  17906. (KJS::Bindings::convertValueToObjcValue):
  17907. (KJS::Bindings::convertObjcValueToValue):
  17908. * bindings/runtime.h:
  17909. * bindings/runtime_root.cpp:
  17910. (KJS::Bindings::rootForInterpreter):
  17911. (KJS::Bindings::addNativeReference):
  17912. (KJS::Bindings::removeNativeReference):
  17913. * bindings/runtime_root.h:
  17914. * bindings/testbindings.mm:
  17915. (-[MyFirstInterface logMessage:]):
  17916. (-[MyFirstInterface setJSObject:]):
  17917. (-[MyFirstInterface callJSObject::]):
  17918. 2004-04-24 Darin Adler <darin@apple.com>
  17919. Reviewed by Dave.
  17920. * kjs/ustring.cpp: (KJS::UString::append): Fix one case that was allocating a buffer
  17921. that is 2x too big.
  17922. 2004-04-23 Maciej Stachowiak <mjs@apple.com>
  17923. Reviewed by Darin.
  17924. Implementation of conservative GC, based partly on code from
  17925. Darin. It's turned off for now, so it shouldn't have any effect on
  17926. the normal build.
  17927. * JavaScriptCore.pbproj/project.pbxproj:
  17928. * kjs/collector.cpp:
  17929. (KJS::Collector::markStackObjectsConservatively):
  17930. (KJS::Collector::markProtectedObjects):
  17931. (KJS::Collector::collect):
  17932. * kjs/collector.h:
  17933. * kjs/protect.h:
  17934. (KJS::gcProtect):
  17935. (KJS::gcUnprotect):
  17936. * kjs/protected_values.cpp: Added.
  17937. (KJS::ProtectedValues::getProtectCount):
  17938. (KJS::ProtectedValues::increaseProtectCount):
  17939. (KJS::ProtectedValues::insert):
  17940. (KJS::ProtectedValues::decreaseProtectCount):
  17941. (KJS::ProtectedValues::expand):
  17942. (KJS::ProtectedValues::shrink):
  17943. (KJS::ProtectedValues::rehash):
  17944. (KJS::ProtectedValues::computeHash):
  17945. * kjs/protected_values.h: Added.
  17946. * kjs/value.cpp:
  17947. (ValueImp::useConservativeMark):
  17948. (ValueImp::mark):
  17949. (ValueImp::marked):
  17950. * kjs/value.h:
  17951. (KJS::ValueImp::):
  17952. === Safari-138 ===
  17953. 2004-04-22 Richard Williamson <rjw@apple.com>
  17954. Fixed build snafu (re-declaration of NPBool in npruntime.h and
  17955. npapi.h).
  17956. * bindings/npruntime.h:
  17957. 2004-04-22 Richard Williamson <rjw@apple.com>
  17958. Updated plugin binding API to reflect latest revision from
  17959. working group.
  17960. Biggest change is the introduction of NPVariant used to represent
  17961. value types. NPVariant replaces the use of NPObject for the
  17962. exchange of values between scripting environment and native code.
  17963. Reviewed by John.
  17964. * JavaScriptCore.pbproj/project.pbxproj:
  17965. * bindings/NP_jsobject.cpp:
  17966. (identiferFromNPIdentifier):
  17967. (NPN_Call):
  17968. (NPN_Evaluate):
  17969. (NPN_GetProperty):
  17970. (NPN_SetProperty):
  17971. (NPN_ToString):
  17972. (NPN_GetPropertyAtIndex):
  17973. (NPN_SetPropertyAtIndex):
  17974. * bindings/c/c_class.cpp:
  17975. (CClass::methodsNamed):
  17976. (CClass::fieldNamed):
  17977. * bindings/c/c_instance.cpp:
  17978. (CInstance::invokeMethod):
  17979. (CInstance::defaultValue):
  17980. * bindings/c/c_runtime.cpp:
  17981. (CField::valueFromInstance):
  17982. (CField::setValueToInstance):
  17983. * bindings/c/c_utility.cpp:
  17984. (convertNPStringToUTF16):
  17985. (convertUTF8ToUTF16):
  17986. (coerceValueToNPVariantStringType):
  17987. (convertValueToNPVariant):
  17988. (convertNPVariantToValue):
  17989. * bindings/c/c_utility.h:
  17990. * bindings/npruntime.cpp:
  17991. (NPN_GetIdentifier):
  17992. (NPN_GetIdentifiers):
  17993. (NPN_UTF8FromIdentifier):
  17994. (NPN_VariantIsVoid):
  17995. (NPN_VariantIsNull):
  17996. (NPN_VariantIsUndefined):
  17997. (NPN_VariantIsBool):
  17998. (NPN_VariantIsInt32):
  17999. (NPN_VariantIsDouble):
  18000. (NPN_VariantIsString):
  18001. (NPN_VariantIsObject):
  18002. (NPN_VariantToBool):
  18003. (NPN_VariantToString):
  18004. (NPN_VariantToInt32):
  18005. (NPN_VariantToDouble):
  18006. (NPN_VariantToObject):
  18007. (NPN_InitializeVariantAsVoid):
  18008. (NPN_InitializeVariantAsNull):
  18009. (NPN_InitializeVariantAsUndefined):
  18010. (NPN_InitializeVariantWithBool):
  18011. (NPN_InitializeVariantWithInt32):
  18012. (NPN_InitializeVariantWithDouble):
  18013. (NPN_InitializeVariantWithString):
  18014. (NPN_InitializeVariantWithStringCopy):
  18015. (NPN_InitializeVariantWithObject):
  18016. (NPN_InitializeVariantWithVariant):
  18017. (NPN_ReleaseVariantValue):
  18018. (NPN_CreateObject):
  18019. (NPN_RetainObject):
  18020. (NPN_ReleaseObject):
  18021. (NPN_IsKindOfClass):
  18022. (NPN_SetExceptionWithUTF8):
  18023. (NPN_SetException):
  18024. * bindings/npruntime.h:
  18025. (_NPString::):
  18026. (_NPString::_NPVariant::):
  18027. * bindings/testbindings.cpp:
  18028. (logMessage):
  18029. (setDoubleValue):
  18030. (setIntValue):
  18031. (setStringValue):
  18032. (setBooleanValue):
  18033. (getDoubleValue):
  18034. (getIntValue):
  18035. (getStringValue):
  18036. (getBooleanValue):
  18037. (myGetProperty):
  18038. (mySetProperty):
  18039. (myInvoke):
  18040. (myAllocate):
  18041. 2004-04-22 Darin Adler <darin@apple.com>
  18042. Reviewed by Maciej.
  18043. - fixed <rdar://problem/3627473>: "REGRESSION (125-137): memory trasher in UString::append, causing many different crashes"
  18044. * kjs/ustring.cpp:
  18045. (KJS::UString::expandCapacity): Fix sizeof(UChar *) that should be sizeof(UChar).
  18046. Was resulting in a buffer 2x the needed size.
  18047. (KJS::UString::expandPreCapacity): Ditto.
  18048. (KJS::UString::append): Fix malloc that is missing a sizeof(UChar).
  18049. 2004-04-21 Maciej Stachowiak <mjs@apple.com>
  18050. Reviewed by Darin.
  18051. Preliminary change for conservative GC. Create "protected"
  18052. subclasses to GC-protect objects when on heap, since we will soon
  18053. remove the built-in refcounting of the normal wrapper classes. Use
  18054. them where needed.
  18055. * JavaScriptCore.pbproj/project.pbxproj:
  18056. * kjs/context.h:
  18057. * kjs/internal.h:
  18058. (KJS::InterpreterImp::globalObject):
  18059. * kjs/interpreter.h:
  18060. * kjs/property_map.cpp:
  18061. * kjs/reference.h:
  18062. * kjs/reference_list.cpp:
  18063. 2004-04-19 Maciej Stachowiak <mjs@apple.com>
  18064. Reviewed by Dave.
  18065. Optimize prepend using the shared substring optimization. Also,
  18066. limit the applicability of shared append and shared prepend. If
  18067. you overdo it, it does more harm than good, because you create a
  18068. bunch of strings that are disqualified from future shared
  18069. append/prepend, for not much immediate savings in allocate/copy
  18070. expense.
  18071. * kjs/ustring.cpp:
  18072. (KJS::):
  18073. (KJS::UString::Rep::create):
  18074. (KJS::UString::expandedSize):
  18075. (KJS::UString::usedPreCapacity):
  18076. (KJS::UString::expandCapacity):
  18077. (KJS::UString::expandPreCapacity):
  18078. (KJS::UString::UString):
  18079. (KJS::UString::append):
  18080. (KJS::UString::operator=):
  18081. * kjs/ustring.h:
  18082. (KJS::UString::Rep::data):
  18083. 2004-04-16 Maciej Stachowiak <mjs@apple.com>
  18084. Reviewed by Richard.
  18085. No more need for Completion or Reference to privately inherit from
  18086. Value, none of the superclass functionality is used.
  18087. * kjs/completion.h:
  18088. * kjs/reference.h:
  18089. === Safari-137 ===
  18090. 2004-04-16 Richard Williamson <rjw@apple.com>
  18091. Added interpreter lock protection around object creation.
  18092. Reviewed by Chris.
  18093. * bindings/runtime.cpp:
  18094. (Instance::createRuntimeObject):
  18095. 2004-04-16 Maciej Stachowiak <mjs@apple.com>
  18096. Reviewed by Ken.
  18097. Another JavaScript speed improvement: use the mechanism from
  18098. string append optimization to make taking a substring fast, again
  18099. sharing the buffer.
  18100. A further 22% improvement on the 24fun string speed test.
  18101. * kjs/ustring.cpp:
  18102. (KJS::):
  18103. (KJS::UString::Rep::create):
  18104. (KJS::UString::UString):
  18105. (KJS::UString::append):
  18106. (KJS::UString::operator=):
  18107. (KJS::UString::substr):
  18108. * kjs/ustring.h:
  18109. (KJS::UString::Rep::data):
  18110. 2004-04-13 Maciej Stachowiak <mjs@apple.com>
  18111. Reviewed by Darin.
  18112. - fixed <rdar://problem/3600695>: String manipulation in JavaScript 24fun test is very slow (slow)
  18113. - fixed <rdar://problem/3600691>: Table generation test is really slow
  18114. - fixed <rdar://problem/3600661>: 24fun date test is really slow
  18115. 80% speedup on the string test, lesser speedups on the other two.
  18116. Two different optimizations here:
  18117. 1) Avoid large overhead of scanning strings to see if they are all
  18118. ASCII before numeric conversion.
  18119. * kjs/nodes.cpp:
  18120. (AssignNode::evaluate): Don't convert to integer until we know for
  18121. sure the operation will need it. Attempting to convert strings to
  18122. numbers is a waste when they are being appended with +=.
  18123. 2) Avoid huge cost of appending strings.
  18124. This is done by allowing multiple strings to share a buffer but
  18125. actually use different ranges of it. The first time a string is
  18126. appended to, we start leaving at least 10% extra space in the
  18127. buffer, so doing N appends to the same string takes O(log N)
  18128. mallocs instead of O(N).
  18129. * kjs/identifier.cpp:
  18130. (KJS::Identifier::equal):
  18131. (KJS::Identifier::add):
  18132. * kjs/ustring.cpp:
  18133. (KJS::):
  18134. (KJS::UCharReference::operator=):
  18135. (KJS::UCharReference::ref):
  18136. (KJS::UString::Rep::create):
  18137. (KJS::UString::Rep::destroy):
  18138. (KJS::UString::expandedSize):
  18139. (KJS::UString::usedCapacity):
  18140. (KJS::UString::expandCapacity):
  18141. (KJS::UString::UString):
  18142. (KJS::UString::null):
  18143. (KJS::UString::append):
  18144. (KJS::UString::operator=):
  18145. (KJS::UString::toStrictUInt32):
  18146. (KJS::UString::detach):
  18147. (KJS::KJS::operator==):
  18148. * kjs/ustring.h:
  18149. (KJS::UString::Rep::data):
  18150. (KJS::UString::Rep::hash):
  18151. 2004-04-09 Maciej Stachowiak <mjs@apple.com>
  18152. Reviewed by John.
  18153. - fix deployment build by avoiding deployment-only warning.
  18154. * kjs/scope_chain.cpp:
  18155. (KJS::ScopeChain::bottom):
  18156. 2004-04-09 Maciej Stachowiak <mjs@apple.com>
  18157. Reviewed by John.
  18158. Changed things so that newly created objects get a prototype based
  18159. on the scope chain of the current function, rather than the
  18160. interpreter that started execution. This fixes the following bugs:
  18161. <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
  18162. <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
  18163. * JavaScriptCore.pbproj/project.pbxproj:
  18164. * kjs/array_object.cpp:
  18165. (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
  18166. (ArrayProtoFuncImp::ArrayProtoFuncImp):
  18167. (ArrayProtoFuncImp::call):
  18168. (ArrayObjectImp::construct):
  18169. * kjs/bool_object.cpp:
  18170. (BooleanObjectImp::construct):
  18171. * kjs/date_object.cpp:
  18172. (DateProtoFuncImp::DateProtoFuncImp):
  18173. (DateProtoFuncImp::call):
  18174. (DateObjectImp::construct):
  18175. * kjs/error_object.cpp:
  18176. (ErrorObjectImp::construct):
  18177. * kjs/function.cpp:
  18178. (FunctionImp::FunctionImp):
  18179. (FunctionImp::call):
  18180. (DeclaredFunctionImp::construct):
  18181. (ArgumentsImp::ArgumentsImp):
  18182. (GlobalFuncImp::call):
  18183. * kjs/function_object.cpp:
  18184. (FunctionProtoFuncImp::call):
  18185. (FunctionObjectImp::construct):
  18186. * kjs/internal.cpp:
  18187. (BooleanImp::toObject):
  18188. (StringImp::toObject):
  18189. (NumberImp::toObject):
  18190. (InterpreterImp::InterpreterImp):
  18191. (InterpreterImp::clear):
  18192. (InterpreterImp::interpreterWithGlobalObject):
  18193. * kjs/internal.h:
  18194. * kjs/interpreter.cpp:
  18195. (ExecState::lexicalInterpreter):
  18196. * kjs/interpreter.h:
  18197. (KJS::ExecState::dynamicInterpreter):
  18198. (KJS::ExecState::interpreter):
  18199. * kjs/math_object.cpp:
  18200. (MathFuncImp::MathFuncImp):
  18201. * kjs/nodes.cpp:
  18202. (StatementNode::hitStatement):
  18203. (StatementNode::abortStatement):
  18204. (RegExpNode::evaluate):
  18205. (ElementNode::evaluate):
  18206. (ArrayNode::evaluate):
  18207. (ObjectLiteralNode::evaluate):
  18208. (PropertyValueNode::evaluate):
  18209. (FunctionCallNode::evaluate):
  18210. (FuncDeclNode::processFuncDecl):
  18211. (FuncExprNode::evaluate):
  18212. * kjs/number_object.cpp:
  18213. (NumberObjectImp::construct):
  18214. * kjs/object.cpp:
  18215. (KJS::ObjectImp::defaultValue):
  18216. (KJS::Error::create):
  18217. * kjs/object_object.cpp:
  18218. (ObjectObjectImp::construct):
  18219. * kjs/reference.cpp:
  18220. (Reference::putValue):
  18221. * kjs/regexp_object.cpp:
  18222. (RegExpProtoFuncImp::call):
  18223. (RegExpObjectImp::arrayOfMatches):
  18224. (RegExpObjectImp::construct):
  18225. * kjs/scope_chain.cpp:
  18226. (KJS::ScopeChain::bottom):
  18227. * kjs/scope_chain.h:
  18228. * kjs/string_object.cpp:
  18229. (StringProtoFuncImp::StringProtoFuncImp):
  18230. (StringProtoFuncImp::call):
  18231. (StringObjectImp::construct):
  18232. === Safari-136 ===
  18233. === Safari-135 ===
  18234. 2004-03-31 Richard Williamson <rjw@apple.com>
  18235. Tedious renames based on feedback from plugin-futures list.
  18236. NP_ functions are renamed with NPN_ prefix.
  18237. Types prefix renamed from NP_ to NP.
  18238. NPN_CreateStringWithUTF8 and NPN_SetExceptionWithUTF8 now take a length, optionally -1 if string is null terminated.
  18239. No review because this was just a renaming patch.
  18240. * bindings/NP_jsobject.cpp:
  18241. (listFromNPArray):
  18242. (jsAllocate):
  18243. (identiferFromNPIdentifier):
  18244. (NPN_Call):
  18245. (NPN_Evaluate):
  18246. (NPN_GetProperty):
  18247. (NPN_SetProperty):
  18248. (NPN_RemoveProperty):
  18249. (NPN_ToString):
  18250. (NPN_GetPropertyAtIndex):
  18251. (NPN_SetPropertyAtIndex):
  18252. * bindings/NP_jsobject.h:
  18253. * bindings/c/c_class.cpp:
  18254. (CClass::_commonInit):
  18255. (CClass::classForIsA):
  18256. (CClass::CClass):
  18257. (CClass::methodsNamed):
  18258. (CClass::fieldNamed):
  18259. * bindings/c/c_class.h:
  18260. * bindings/c/c_instance.cpp:
  18261. (CInstance::CInstance):
  18262. (CInstance::~CInstance):
  18263. (CInstance::operator=):
  18264. (CInstance::invokeMethod):
  18265. (CInstance::defaultValue):
  18266. * bindings/c/c_instance.h:
  18267. (KJS::Bindings::CInstance::getObject):
  18268. * bindings/c/c_runtime.cpp:
  18269. (CField::valueFromInstance):
  18270. (CField::setValueToInstance):
  18271. * bindings/c/c_runtime.h:
  18272. (KJS::Bindings::CField::CField):
  18273. (KJS::Bindings::CField::name):
  18274. (KJS::Bindings::CMethod::CMethod):
  18275. (KJS::Bindings::CMethod::name):
  18276. * bindings/c/c_utility.cpp:
  18277. (coerceValueToNPString):
  18278. (convertValueToNPValueType):
  18279. (convertNPValueTypeToValue):
  18280. * bindings/c/c_utility.h:
  18281. * bindings/npruntime.cpp:
  18282. (NPN_IdentifierFromUTF8):
  18283. (NPN_IsValidIdentifier):
  18284. (NPN_GetIdentifiers):
  18285. (NPN_UTF8FromIdentifier):
  18286. (NPN_CreateObject):
  18287. (NPN_RetainObject):
  18288. (NPN_ReleaseObject):
  18289. (NPN_IsKindOfClass):
  18290. (NPN_SetExceptionWithUTF8):
  18291. (NPN_SetException):
  18292. (numberAllocate):
  18293. (NPN_CreateNumberWithInt):
  18294. (NPN_CreateNumberWithFloat):
  18295. (NPN_CreateNumberWithDouble):
  18296. (NPN_IntFromNumber):
  18297. (NPN_FloatFromNumber):
  18298. (NPN_DoubleFromNumber):
  18299. (stringAllocate):
  18300. (NPN_CreateStringWithUTF8):
  18301. (NPN_CreateStringWithUTF16):
  18302. (NPN_DeallocateUTF8):
  18303. (NPN_UTF8FromString):
  18304. (NPN_UTF16FromString):
  18305. (NPN_StringLength):
  18306. (booleanAllocate):
  18307. (NPN_CreateBoolean):
  18308. (NPN_BoolFromBoolean):
  18309. (nullAllocate):
  18310. (NPN_GetNull):
  18311. (undefinedAllocate):
  18312. (NPN_GetUndefined):
  18313. (arrayAllocate):
  18314. (arrayDeallocate):
  18315. (NPN_CreateArray):
  18316. (NPN_CreateArrayV):
  18317. (NPN_ObjectAtIndex):
  18318. * bindings/npruntime.h:
  18319. * bindings/runtime.cpp:
  18320. (Instance::createBindingForLanguageInstance):
  18321. * bindings/testbindings.cpp:
  18322. (initializeIdentifiers):
  18323. (myHasProperty):
  18324. (myHasMethod):
  18325. (myGetProperty):
  18326. (mySetProperty):
  18327. (logMessage):
  18328. (setDoubleValue):
  18329. (setIntValue):
  18330. (setStringValue):
  18331. (setBooleanValue):
  18332. (getDoubleValue):
  18333. (getIntValue):
  18334. (getStringValue):
  18335. (getBooleanValue):
  18336. (myInvoke):
  18337. (myAllocate):
  18338. (myInvalidate):
  18339. (myDeallocate):
  18340. (main):
  18341. 2004-03-31 Richard Williamson <rjw@apple.com>
  18342. Changed references to NP_runtime.h to npruntime.h
  18343. * JavaScriptCore.pbproj/project.pbxproj:
  18344. * bindings/NP_jsobject.h:
  18345. * bindings/c/c_class.h:
  18346. * bindings/c/c_instance.h:
  18347. * bindings/c/c_runtime.h:
  18348. * bindings/c/c_utility.h:
  18349. * bindings/npruntime.cpp:
  18350. 2004-03-31 Richard Williamson <rjw@apple.com>
  18351. Renamed NP_runtime.h to npruntime.h to match Netscape SDK.
  18352. * JavaScriptCore.pbproj/project.pbxproj:
  18353. * bindings/NP_jsobject.h:
  18354. * bindings/npruntime.cpp:
  18355. === Safari-134 ===
  18356. 2004-03-23 Richard Williamson <rjw@apple.com>
  18357. Added implementation of KJS::Value <-> NP_Object conversion functions.
  18358. Augmented test program for 'C' bindings.
  18359. Added asserts and parameter checking to all public API.
  18360. Reviewed by Ken.
  18361. * JavaScriptCore.pbproj/project.pbxproj:
  18362. * bindings/NP_jsobject.cpp:
  18363. (NP_ToString):
  18364. * bindings/NP_jsobject.h: Added.
  18365. * bindings/NP_runtime.cpp:
  18366. (NP_IdentifierFromUTF8):
  18367. (NP_IsValidIdentifier):
  18368. (NP_GetIdentifiers):
  18369. (NP_CreateObject):
  18370. (NP_RetainObject):
  18371. (NP_ReleaseObject):
  18372. (NP_IsKindOfClass):
  18373. (NP_SetExceptionWithUTF8):
  18374. (NP_SetException):
  18375. (NP_IntFromNumber):
  18376. (NP_FloatFromNumber):
  18377. (NP_DoubleFromNumber):
  18378. (NP_CreateStringWithUTF8):
  18379. (NP_CreateStringWithUTF16):
  18380. (NP_DeallocateUTF8):
  18381. (NP_UTF8FromString):
  18382. (NP_UTF16FromString):
  18383. (NP_StringLength):
  18384. (NP_BoolFromBoolean):
  18385. * bindings/NP_runtime.h:
  18386. * bindings/c/c_instance.cpp:
  18387. (CInstance::invokeMethod):
  18388. * bindings/c/c_utility.cpp:
  18389. (coerceValueToNPString):
  18390. (convertValueToNPValueType):
  18391. (convertNPValueTypeToValue):
  18392. * bindings/c/c_utility.h:
  18393. * bindings/test.js:
  18394. * bindings/testC.js: Added.
  18395. * bindings/testbindings.cpp:
  18396. (logMessage):
  18397. (setDoubleValue):
  18398. (setIntValue):
  18399. (setStringValue):
  18400. (setBooleanValue):
  18401. (getDoubleValue):
  18402. (getIntValue):
  18403. (getStringValue):
  18404. (getBooleanValue):
  18405. (myInterfaceInvoke):
  18406. (myInterfaceAllocate):
  18407. === Safari-133 ===
  18408. 2004-03-19 Darin Adler <darin@apple.com>
  18409. Reviewed by Ken.
  18410. - fixed problem with methods like setUTCHour
  18411. * kjs/date_object.cpp: (DateProtoFuncImp::call): Fix conversion back to time_t to use the appropriate
  18412. GMT vs. local time function based on the utc flag.
  18413. 2004-03-17 Richard Williamson <rjw@apple.com>
  18414. Added a context parameter to result callbacks use by JavaScriptObject functions. This was a change requested by Eric Carlson on the QT plugin team.
  18415. Reviewed by Ken.
  18416. * bindings/NP_jsobject.cpp:
  18417. (NP_Call):
  18418. (NP_Evaluate):
  18419. (NP_GetProperty):
  18420. (NP_ToString):
  18421. (NP_GetPropertyAtIndex):
  18422. * bindings/NP_runtime.h:
  18423. 2004-03-16 Richard Williamson <rjw@apple.com>
  18424. Fixed 3590169. Regression (crash) caused by the switch to MethodLists. Crash when attempting to invoke a method from JavaScript to Java that is not implemented.
  18425. Reviewed by John.
  18426. * bindings/jni/jni_class.cpp:
  18427. (JavaClass::methodsNamed):
  18428. 2004-03-15 Richard Williamson <rjw@apple.com>
  18429. Fixed 3570854. Don't attempt to convert Null to strings. We
  18430. were incorrectly converting to "Null".
  18431. Actually fixed by Scott Kovatch.
  18432. Reviewed by Richard.
  18433. * bindings/jni/jni_utility.cpp:
  18434. (KJS::Bindings::convertValueToJValue):
  18435. === Safari-132 ===
  18436. 2004-03-11 Richard Williamson <rjw@apple.com>
  18437. Stitched together the NP stuff to our language independent
  18438. JavaScript binding stuff. Very close to being done.
  18439. Added program to test C bindings (and NP stuff). Just tests
  18440. properties. Will add methods and JavaScript access, etc.
  18441. Updated Makefile.am to account for new bindings/c directory.
  18442. Change NP_UTF8 from "const char *" to "char" to allow for
  18443. declarations like "const NP_UTF8 *" and "NP_UTF8 *". Ditto
  18444. for NP_UTF16.
  18445. Added NP_IsValidIdentifier().
  18446. Reviewed by Chris.
  18447. * JavaScriptCore.pbproj/project.pbxproj:
  18448. * Makefile.am:
  18449. * bindings/NP_jsobject.cpp:
  18450. (identiferFromNPIdentifier):
  18451. (NP_Evaluate):
  18452. * bindings/NP_runtime.cpp:
  18453. (NP_IdentifierFromUTF8):
  18454. (NP_IsValidIdentifier):
  18455. (NP_GetIdentifiers):
  18456. (NP_UTF8FromIdentifier):
  18457. (NP_SetExceptionWithUTF8):
  18458. (NP_SetException):
  18459. (NP_CreateStringWithUTF8):
  18460. (NP_CreateStringWithUTF16):
  18461. (NP_UTF8FromString):
  18462. (NP_UTF16FromString):
  18463. * bindings/NP_runtime.h:
  18464. * bindings/c/c_class.cpp: Added.
  18465. (CClass::_commonDelete):
  18466. (CClass::_commonCopy):
  18467. (CClass::_commonInit):
  18468. (_createClassesByIsAIfNecessary):
  18469. (CClass::classForIsA):
  18470. (CClass::CClass):
  18471. (CClass::name):
  18472. (CClass::methodsNamed):
  18473. (CClass::fieldNamed):
  18474. * bindings/c/c_class.h: Added.
  18475. (KJS::Bindings::CClass::~CClass):
  18476. (KJS::Bindings::CClass::CClass):
  18477. (KJS::Bindings::CClass::operator=):
  18478. (KJS::Bindings::CClass::constructorAt):
  18479. (KJS::Bindings::CClass::numConstructors):
  18480. * bindings/c/c_instance.cpp: Added.
  18481. (CInstance::CInstance):
  18482. (CInstance::~CInstance):
  18483. (CInstance::operator=):
  18484. (CInstance::getClass):
  18485. (CInstance::begin):
  18486. (CInstance::end):
  18487. (CInstance::invokeMethod):
  18488. (CInstance::defaultValue):
  18489. (CInstance::stringValue):
  18490. (CInstance::numberValue):
  18491. (CInstance::booleanValue):
  18492. (CInstance::valueOf):
  18493. * bindings/c/c_instance.h: Added.
  18494. (KJS::Bindings::CInstance::getObject):
  18495. * bindings/c/c_runtime.cpp: Added.
  18496. (CField::valueFromInstance):
  18497. (CField::setValueToInstance):
  18498. * bindings/c/c_runtime.h: Added.
  18499. (KJS::Bindings::CField::CField):
  18500. (KJS::Bindings::CField::name):
  18501. (KJS::Bindings::CField::type):
  18502. (KJS::Bindings::CMethod::CMethod):
  18503. (KJS::Bindings::CMethod::name):
  18504. (KJS::Bindings::CMethod::numParameters):
  18505. * bindings/c/c_utility.cpp: Added.
  18506. (coerceValueToNPValueType):
  18507. (convertValueToNPValueType):
  18508. (convertNPValueTypeToValue):
  18509. * bindings/c/c_utility.h: Added.
  18510. * bindings/make_testbindings:
  18511. * bindings/runtime.cpp:
  18512. (Instance::createBindingForLanguageInstance):
  18513. * bindings/runtime.h:
  18514. (KJS::Bindings::Instance::):
  18515. * bindings/testbindings.cpp: Added.
  18516. (initializeIdentifiers):
  18517. (myInterfaceHasProperty):
  18518. (myInterfaceHasMethod):
  18519. (myInterfaceGetProperty):
  18520. (myInterfaceSetProperty):
  18521. (myInterfaceInvoke):
  18522. (myInterfaceAllocate):
  18523. (myInterfaceInvalidate):
  18524. (myInterfaceDeallocate):
  18525. (GlobalImp::className):
  18526. (readJavaScriptFromFile):
  18527. (main):
  18528. 2004-03-10 Richard Williamson <rjw@apple.com>
  18529. Made changes to support new asychronous approach to calls from
  18530. plugin to JavaScript
  18531. Reviewed by Chris.
  18532. * bindings/NP_jsobject.cpp:
  18533. (NP_Call):
  18534. (NP_Evaluate):
  18535. (NP_GetProperty):
  18536. (NP_ToString):
  18537. (NP_GetPropertyAtIndex):
  18538. * bindings/NP_runtime.h:
  18539. * bindings/make_testbindings:
  18540. * bindings/runtime.cpp:
  18541. (Instance::createBindingForLanguageInstance):
  18542. 2004-03-10 Richard Williamson <rjw@apple.com>
  18543. Updated header to include proposed changes from
  18544. plugin-futures list. Calls from plugin to JavaScript
  18545. are now asynchronous.
  18546. Reviewed by Chris.
  18547. * bindings/NP_runtime.h:
  18548. === Safari-131 ===
  18549. 2004-03-04 Richard Williamson <rjw@apple.com>
  18550. Implementation of NP_JavaScriptObject. This is the 'C' class
  18551. that wraps a JavaScript object.
  18552. Reviewed by Chris.
  18553. * JavaScriptCore.pbproj/project.pbxproj:
  18554. * bindings/NP_jsobject.cpp: Added.
  18555. (coerceValueToNPValueType):
  18556. (convertValueToNPValueType):
  18557. (convertNPValueTypeToValue):
  18558. (listFromNPArray):
  18559. (jsAllocate):
  18560. (jsDeallocate):
  18561. (identiferFromNPIdentifier):
  18562. (NP_Call):
  18563. (NP_Evaluate):
  18564. (NP_GetProperty):
  18565. (NP_SetProperty):
  18566. (NP_RemoveProperty):
  18567. (NP_ToString):
  18568. (NP_GetPropertyAtIndex):
  18569. (NP_SetPropertyAtIndex):
  18570. * bindings/NP_runtime.cpp:
  18571. (NP_ObjectAtIndex):
  18572. * bindings/NP_runtime.h:
  18573. * bindings/runtime_object.h:
  18574. 2004-03-04 Richard Williamson <rjw@apple.com>
  18575. Added NP_Array implementation.
  18576. Changed NP_Boolean to just depend on two static instances, no
  18577. space is required for values.
  18578. Reviewed by Chris.
  18579. * bindings/NP_runtime.cpp:
  18580. (NP_CreateBoolean):
  18581. (NP_BoolFromBoolean):
  18582. (arrayAllocate):
  18583. (arrayDeallocate):
  18584. (NP_CreateArray):
  18585. (NP_CreateArrayV):
  18586. (NP_ObjectAtIndex):
  18587. * bindings/NP_runtime.h:
  18588. 2004-03-03 Darin Adler <darin@apple.com>
  18589. Reviewed by Vicki.
  18590. * English.lproj/InfoPlist.strings: Removed. No need to localize the version and
  18591. copyright string, and that's all that was in here.
  18592. * JavaScriptCore.pbproj/project.pbxproj: Removed InfoPlist.strings from build.
  18593. 2004-03-03 Richard Williamson <rjw@apple.com>
  18594. More 'C' binding implementation. Fleshed out all the
  18595. 'primitive' data types.
  18596. Reviewed by Chris.
  18597. * bindings/NP_runtime.cpp:
  18598. (NP_ReleaseObject):
  18599. (numberAllocate):
  18600. (stringAllocate):
  18601. (stringDeallocate):
  18602. (NP_CreateStringWithUTF8):
  18603. (NP_CreateStringWithUTF16):
  18604. (NP_UTF8FromString):
  18605. (NP_UTF16FromString):
  18606. (NP_StringLength):
  18607. (booleanAllocate):
  18608. (booleanDeallocate):
  18609. (NP_CreateBoolean):
  18610. (NP_BoolFromBoolean):
  18611. (nullAllocate):
  18612. (nullDeallocate):
  18613. (NP_GetNull):
  18614. (undefinedAllocate):
  18615. (undefinedDeallocate):
  18616. (NP_GetUndefined):
  18617. * bindings/NP_runtime.h:
  18618. 2004-03-03 Richard Williamson <rjw@apple.com>
  18619. More 'C' binding implementation.
  18620. Reviewed by Chris.
  18621. * bindings/NP_runtime.cpp:
  18622. (identifierEqual):
  18623. (identifierHash):
  18624. (getIdentifierDictionary):
  18625. (NP_IdentifierFromUTF8):
  18626. (NP_UTF8FromIdentifier):
  18627. (NP_CreateObject):
  18628. (NP_ReleaseObject):
  18629. (NP_IsKindOfClass):
  18630. (numberCreate):
  18631. (NP_CreateNumberWithInt):
  18632. (NP_CreateNumberWithFloat):
  18633. (NP_CreateNumberWithDouble):
  18634. (NP_IntFromNumber):
  18635. (NP_FloatFromNumber):
  18636. (NP_DoubleFromNumber):
  18637. * bindings/NP_runtime.h:
  18638. 2004-03-02 Richard Williamson <rjw@apple.com>
  18639. Removed retain/release from NP_Class. Classes will not be allowed to implement their
  18640. own customer retain/release scheme.
  18641. Reviewed by Chris.
  18642. * bindings/NP_runtime.cpp:
  18643. (NP_RetainObject):
  18644. (NP_ReleaseObject):
  18645. * bindings/NP_runtime.h:
  18646. 2004-03-02 Richard Williamson <rjw@apple.com>
  18647. C binding API. Partial implementation.
  18648. Completed ObjectiveC bindings (not based on the C API). These will re-implemented over the C binding API, but I wanted to get this code in the tree.
  18649. Factored root object reference counting scheme. It is now useful independent
  18650. of LiveConnect.
  18651. Reviewed by Chris.
  18652. * JavaScriptCore.pbproj/project.pbxproj:
  18653. * bindings/NP_runtime.cpp: Added.
  18654. (NP_IdentifierFromUTF8):
  18655. (NP_GetIdentifiers):
  18656. (NP_UTF8FromIdentifier):
  18657. (NP_CreateObject):
  18658. (NP_RetainObject):
  18659. (NP_ReleaseObject):
  18660. (NP_IsKindOfClass):
  18661. (NP_SetException):
  18662. (NP_Call):
  18663. (NP_Evaluate):
  18664. (NP_GetProperty):
  18665. (NP_SetProperty):
  18666. (NP_RemoveProperty):
  18667. (NP_ToString):
  18668. (NP_GetPropertyAtIndex):
  18669. (NP_SetPropertyAtIndex):
  18670. (NP_CreateNumberWithInt):
  18671. (NP_CreateNumberWithFloat):
  18672. (NP_CreateNumberWithDouble):
  18673. (NP_IntFromNumber):
  18674. (NP_FloatFromNumber):
  18675. (NP_DoubleFromNumber):
  18676. (NP_CreateStringWithUTF8):
  18677. (NP_CreateStringWithUTF16):
  18678. (NP_UTF8FromString):
  18679. (NP_UTF16FromString):
  18680. (NP_CreateBoolean):
  18681. (NP_BoolFromBoolean):
  18682. (NP_GetNull):
  18683. (NP_GetUndefined):
  18684. (NP_CreateArray):
  18685. (NP_CreateArrayV):
  18686. (NP_ObjectAtIndex):
  18687. * bindings/NP_runtime.h: Added.
  18688. * bindings/jni/jni_jsobject.cpp:
  18689. (JSObject::invoke):
  18690. (JSObject::finalize):
  18691. (JSObject::createNative):
  18692. (JSObject::convertValueToJObject):
  18693. * bindings/jni/jni_jsobject.h:
  18694. * bindings/objc/objc_jsobject.h:
  18695. * bindings/objc/objc_jsobject.mm:
  18696. (rootForView):
  18697. (windowJavaScriptObject):
  18698. (-[JavaScriptObject initWithObjectImp:KJS::root:Bindings::]):
  18699. (-[JavaScriptObject dealloc]):
  18700. (-[JavaScriptObject _convertValueToObjcValue:KJS::]):
  18701. (-[JavaScriptObject call:arguments:]):
  18702. (-[JavaScriptObject evaluate:]):
  18703. (-[JavaScriptObject getMember:]):
  18704. (-[JavaScriptObject setMember:value:]):
  18705. (-[JavaScriptObject removeMember:]):
  18706. (-[JavaScriptObject toString]):
  18707. (-[JavaScriptObject getSlot:]):
  18708. (-[JavaScriptObject setSlot:value:]):
  18709. * bindings/objc/objc_utility.h:
  18710. * bindings/objc/objc_utility.mm:
  18711. (KJS::Bindings::convertValueToObjcValue):
  18712. * bindings/runtime_root.cpp: Added.
  18713. (getReferencesByRootDictionary):
  18714. (getReferencesDictionary):
  18715. (KJS::Bindings::findReferenceDictionary):
  18716. (KJS::Bindings::rootForImp):
  18717. (KJS::Bindings::addNativeReference):
  18718. (KJS::Bindings::removeNativeReference):
  18719. (completedJavaScriptAccess):
  18720. (initializeJavaScriptAccessLock):
  18721. (lockJavaScriptAccess):
  18722. (unlockJavaScriptAccess):
  18723. (RootObject::dispatchToJavaScriptThread):
  18724. (performJavaScriptAccess):
  18725. (RootObject::setFindRootObjectForNativeHandleFunction):
  18726. (RootObject::removeAllNativeReferences):
  18727. * bindings/runtime_root.h: Added.
  18728. (KJS::Bindings::RootObject::RootObject):
  18729. (KJS::Bindings::RootObject::~RootObject):
  18730. (KJS::Bindings::RootObject::setRootObjectImp):
  18731. (KJS::Bindings::RootObject::rootObjectImp):
  18732. (KJS::Bindings::RootObject::setInterpreter):
  18733. (KJS::Bindings::RootObject::interpreter):
  18734. (KJS::Bindings::RootObject::findRootObjectForNativeHandleFunction):
  18735. (KJS::Bindings::RootObject::runLoop):
  18736. (KJS::Bindings::RootObject::performJavaScriptSource):
  18737. === Safari-130 ===
  18738. === Safari-129 ===
  18739. 2004-02-18 Richard Williamson <rjw@apple.com>
  18740. Added NSNumber/Number conversion.
  18741. Removed some unnecessary KJS:: namespace specifiers.
  18742. Reviewed by Ken.
  18743. * bindings/objc/objc_utility.mm:
  18744. (KJS::Bindings::convertValueToObjcValue):
  18745. (KJS::Bindings::convertObjcValueToValue):
  18746. * bindings/runtime_array.h:
  18747. 2004-02-18 Richard Williamson <rjw@apple.com>
  18748. Added support for export NSArrays.
  18749. Updated valueAt() to take an ExecState so we can throw
  18750. JS exceptions.
  18751. Implemented excludeSelectorFromJavaScript: in ObjcClass. This allows
  18752. ObjectiveC classes to control the visibility of their methods in
  18753. JavaScript.
  18754. Reviewed by Ken.
  18755. * bindings/jni/jni_runtime.cpp:
  18756. (JavaField::valueFromInstance):
  18757. (JavaArray::valueAt):
  18758. * bindings/jni/jni_runtime.h:
  18759. * bindings/objc/objc_class.mm:
  18760. (ObjcClass::methodsNamed):
  18761. * bindings/objc/objc_runtime.h:
  18762. (KJS::Bindings::ObjcArray::getObjcArray):
  18763. * bindings/objc/objc_runtime.mm:
  18764. (ObjcField::valueFromInstance):
  18765. (ObjcField::setValueToInstance):
  18766. (ObjcArray::ObjcArray):
  18767. (ObjcArray::~ObjcArray):
  18768. (ObjcArray::operator=):
  18769. (ObjcArray::setValueAt):
  18770. (ObjcArray::valueAt):
  18771. (ObjcArray::getLength):
  18772. * bindings/objc/objc_utility.mm:
  18773. (KJS::Bindings::convertValueToObjcValue):
  18774. (KJS::Bindings::convertObjcValueToValue):
  18775. * bindings/runtime.cpp:
  18776. (Instance::getValueOfField):
  18777. * bindings/runtime.h:
  18778. * bindings/runtime_array.cpp:
  18779. (RuntimeArrayImp::get):
  18780. * bindings/runtime_object.cpp:
  18781. (RuntimeObjectImp::get):
  18782. 2004-02-17 Richard Williamson <rjw@apple.com>
  18783. Added String <-> NSString conversion.
  18784. Added tests of String <-> NSString conversion to test program.
  18785. Reviewed by Chris.
  18786. * bindings/objc/objc_utility.mm:
  18787. (KJS::Bindings::convertValueToObjcValue):
  18788. (KJS::Bindings::convertObjcValueToValue):
  18789. * bindings/test.js:
  18790. * bindings/testbindings.mm:
  18791. (-[MyFirstInterface getString]):
  18792. 2004-02-15 Darin Adler <darin@apple.com>
  18793. Reviewed by Dave.
  18794. * JavaScriptCore.pbproj/project.pbxproj: Tweak build styles a bit, fixing OptimizedWithSymbols,
  18795. and removing redundant settings of things that match defaults in other build styles.
  18796. 2004-02-13 Richard Williamson <rjw@apple.com>
  18797. Work towards the JavaScript ObjC bindings. The bindings now work for
  18798. simple scalar types. testbindings.mm is an illustration of how the
  18799. bindings work.
  18800. Reviewed by Ken.
  18801. * JavaScriptCore.pbproj/project.pbxproj:
  18802. * Makefile.am:
  18803. * bindings/jni/jni_class.cpp:
  18804. (JavaClass::methodsNamed):
  18805. * bindings/jni/jni_class.h:
  18806. * bindings/jni/jni_instance.cpp:
  18807. (JavaInstance::invokeMethod):
  18808. * bindings/jni/jni_instance.h:
  18809. * bindings/jni/jni_runtime.h:
  18810. (KJS::Bindings::JavaMethod::returnType):
  18811. * bindings/make_testbindings: Added.
  18812. * bindings/objc/objc_class.h: Added.
  18813. (KJS::Bindings::ObjcClass::~ObjcClass):
  18814. (KJS::Bindings::ObjcClass::ObjcClass):
  18815. (KJS::Bindings::ObjcClass::operator=):
  18816. (KJS::Bindings::ObjcClass::constructorAt):
  18817. (KJS::Bindings::ObjcClass::numConstructors):
  18818. * bindings/objc/objc_class.mm: Added.
  18819. (ObjcClass::_commonDelete):
  18820. (ObjcClass::_commonCopy):
  18821. (ObjcClass::_commonInit):
  18822. (_createClassesByIsAIfNecessary):
  18823. (ObjcClass::classForIsA):
  18824. (ObjcClass::ObjcClass):
  18825. (ObjcClass::name):
  18826. (ObjcClass::methodsNamed):
  18827. (ObjcClass::fieldNamed):
  18828. * bindings/objc/objc_header.h: Added.
  18829. * bindings/objc/objc_instance.h: Added.
  18830. (KJS::Bindings::ObjcInstance::getObject):
  18831. * bindings/objc/objc_instance.mm: Added.
  18832. (ObjcInstance::ObjcInstance):
  18833. (ObjcInstance::~ObjcInstance):
  18834. (ObjcInstance::operator=):
  18835. (ObjcInstance::begin):
  18836. (ObjcInstance::end):
  18837. (ObjcInstance::getClass):
  18838. (ObjcInstance::invokeMethod):
  18839. (ObjcInstance::defaultValue):
  18840. (ObjcInstance::stringValue):
  18841. (ObjcInstance::numberValue):
  18842. (ObjcInstance::booleanValue):
  18843. (ObjcInstance::valueOf):
  18844. * bindings/objc/objc_jsobject.h: Added.
  18845. * bindings/objc/objc_jsobject.mm: Added.
  18846. * bindings/objc/objc_runtime.h:
  18847. (KJS::Bindings::ObjcField::~ObjcField):
  18848. (KJS::Bindings::ObjcField::ObjcField):
  18849. (KJS::Bindings::ObjcField::operator=):
  18850. (KJS::Bindings::ObjcMethod::ObjcMethod):
  18851. (KJS::Bindings::ObjcMethod::~ObjcMethod):
  18852. (KJS::Bindings::ObjcMethod::operator=):
  18853. * bindings/objc/objc_runtime.mm: Added.
  18854. (ObjcMethod::ObjcMethod):
  18855. (ObjcMethod::name):
  18856. (ObjcMethod::numParameters):
  18857. (ObjcMethod::getMethodSignature):
  18858. (ObjcField::ObjcField):
  18859. (ObjcField::name):
  18860. (ObjcField::type):
  18861. (ObjcField::valueFromInstance):
  18862. (ObjcField::setValueToInstance):
  18863. * bindings/objc/objc_utility.h: Added.
  18864. (KJS::Bindings::):
  18865. * bindings/objc/objc_utility.mm: Added.
  18866. (KJS::Bindings::JSMethodNameToObjCMethodName):
  18867. (KJS::Bindings::convertValueToObjcValue):
  18868. (KJS::Bindings::convertObjcValueToValue):
  18869. (KJS::Bindings::objcValueTypeForType):
  18870. * bindings/runtime.cpp:
  18871. (MethodList::MethodList):
  18872. (MethodList::operator=):
  18873. (Instance::setValueOfField):
  18874. (Instance::createBindingForLanguageInstance):
  18875. (Instance::createRuntimeObject):
  18876. * bindings/runtime.h:
  18877. * bindings/runtime_method.cpp:
  18878. (RuntimeMethodImp::RuntimeMethodImp):
  18879. (RuntimeMethodImp::get):
  18880. (RuntimeMethodImp::call):
  18881. * bindings/runtime_method.h:
  18882. * bindings/runtime_object.cpp:
  18883. (RuntimeObjectImp::get):
  18884. (RuntimeObjectImp::hasProperty):
  18885. * bindings/test.js: Added.
  18886. * bindings/testbindings.mm: Added.
  18887. (-[MySecondInterface init]):
  18888. (-[MyFirstInterface init]):
  18889. (-[MyFirstInterface dealloc]):
  18890. (+[MyFirstInterface JavaScriptNameForSelector:]):
  18891. (-[MyFirstInterface getInt]):
  18892. (-[MyFirstInterface setInt:]):
  18893. (-[MyFirstInterface getMySecondInterface]):
  18894. (-[MyFirstInterface logMessage:]):
  18895. (GlobalImp::className):
  18896. (readJavaScriptFromFile):
  18897. (main):
  18898. === Safari-128 ===
  18899. 2004-02-08 Darin Adler <darin@apple.com>
  18900. Reviewed by Dave.
  18901. - fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
  18902. * JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h>
  18903. macros from working right in C++ code that uses the <cctype> header.
  18904. * kjs/ustring.cpp:
  18905. (KJS::inlineUTF8SequenceLengthNonASCII): Added.
  18906. (KJS::UTF8SequenceLengthNonASCII): Added.
  18907. (KJS::inlineUTF8SequenceLength): Added.
  18908. (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now.
  18909. (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
  18910. (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those.
  18911. (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
  18912. (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
  18913. - fixed the test program so it won't hit the interpreter lock assertion
  18914. * kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
  18915. === Safari-127 ===
  18916. 2004-02-06 Richard Williamson <rjw@apple.com>
  18917. Fixed 3550242 and 3546977. The first diff prevents an assert from firing. The second diff prevents a JavaScript exception, caused be an invalid conversion, which has a downstream consequence of preventing a valid conversion.
  18918. Reviewed by John.
  18919. * bindings/jni/jni_jsobject.cpp:
  18920. (JSObject::toString):
  18921. * bindings/jni/jni_utility.cpp:
  18922. (KJS::Bindings::convertValueToJValue):
  18923. 2004-02-02 Darin Adler <darin@apple.com>
  18924. Reviewed by Maciej.
  18925. - fixed <rdar://problem/3546613>: array of negative size leads to crash (test page at oscar.the-rileys.net)
  18926. * kjs/array_object.cpp:
  18927. (ArrayInstanceImp::ArrayInstanceImp): If the length is greater than 10,000, don't allocate an array until
  18928. we start putting values in. This prevents new Array(2147483647) from causing trouble.
  18929. (ArrayObjectImp::construct): Check number as described in specification, and raise a range error if the
  18930. number is out of range. This prevents new Array(-1) from causing trouble.
  18931. - fixed <rdar://problem/3545756>: Math.round screws up on numbers bigger than 2^31 (incorrect results on HP-35 calculator page)
  18932. * kjs/math_object.cpp: (MathFuncImp::call): Change implementation to be much simpler and not involve
  18933. casting to int. Results now match those in other browsers.
  18934. 2004-02-02 Darin Adler <darin@apple.com>
  18935. Reviewed by Maciej.
  18936. - fixed <rdar://problem/3519285>: integer operations on large negative numbers yield bad results (discovered with "HTMLCrypt")
  18937. - fixed other related overflow issues
  18938. * kjs/value.h: Changed return types of toInteger, toInt32, toUInt32, and toUInt16.
  18939. * kjs/value.cpp:
  18940. (ValueImp::toInteger): Change to return a double, since this operation, from the ECMA specification,
  18941. must not restrict values to the range of a particular integer type.
  18942. (ValueImp::toInt32): Used a sized integer type for the result of this function, and also added
  18943. proper handling for negative results from fmod.
  18944. (ValueImp::toUInt32): Ditto.
  18945. (ValueImp::toUInt16): Ditto.
  18946. (ValueImp::dispatchToUInt32): Changed result type from unsigned to uint32_t.
  18947. * kjs/array_object.cpp: (ArrayProtoFuncImp::call): Use a double instead of an int to handle
  18948. out-of-integer-range values better in the slice function.
  18949. * kjs/internal.cpp: (KJS::roundValue): Streamline the function, handling NAN and infinity properly.
  18950. * kjs/number_object.cpp: (NumberProtoFuncImp::call): Use a double instead of an int to handle
  18951. out-of-integer-range values better in the toString function.
  18952. * kjs/string_object.cpp: (StringProtoFuncImp::call): Use a double instead of an int to handle
  18953. out-of-integer-range values better in the charAt, charCodeAt, indexOf, lastIndexOf, slice,
  18954. and substr functions.
  18955. === Safari-126 ===
  18956. 2004-01-30 Richard Williamson <rjw@apple.com>
  18957. Fixed 3542044. Create KJS::String using UString constructor instead of passing UTF8 string to char* constructor.
  18958. Reviewed by Darin.
  18959. * bindings/jni/jni_instance.cpp:
  18960. (JavaInstance::stringValue):
  18961. 2004-01-26 Darin Adler <darin@apple.com>
  18962. * Makefile.am: Switch from pbxbuild to xcodebuild.
  18963. 2004-01-22 Richard Williamson <rjw@apple.com>
  18964. Added stubs for ObjC language binding to JavaScript.
  18965. * JavaScriptCore.pbproj/project.pbxproj:
  18966. * bindings/jni/jni_runtime.h:
  18967. * bindings/objc/objc_runtime.h: Added.
  18968. (KJS::Bindings::ObjcParameter::ObjcParameter):
  18969. (KJS::Bindings::ObjcParameter::~ObjcParameter):
  18970. (KJS::Bindings::ObjcParameter::operator=):
  18971. (KJS::Bindings::ObjcParameter::type):
  18972. (KJS::Bindings::ObjcConstructor::ObjcConstructor):
  18973. (KJS::Bindings::ObjcConstructor::~ObjcConstructor):
  18974. (KJS::Bindings::ObjcConstructor::_commonCopy):
  18975. (KJS::Bindings::ObjcConstructor::operator=):
  18976. (KJS::Bindings::ObjcConstructor::value):
  18977. (KJS::Bindings::ObjcConstructor::parameterAt):
  18978. (KJS::Bindings::ObjcConstructor::numParameters):
  18979. (KJS::Bindings::ObjcField::ObjcField):
  18980. (KJS::Bindings::ObjcField::~ObjcField):
  18981. * bindings/runtime.h:
  18982. 2004-01-22 Richard Williamson <rjw@apple.com>
  18983. Simplified JavaString by using UString as backing store. This
  18984. revealed a bug in CString's assignment operator which I fixed.
  18985. Removed some dead code.
  18986. Reviewed by John.
  18987. * bindings/jni/jni_runtime.h:
  18988. (KJS::Bindings::JavaString::JavaString):
  18989. (KJS::Bindings::JavaString::_commonInit):
  18990. (KJS::Bindings::JavaString::UTF8String):
  18991. (KJS::Bindings::JavaString::uchars):
  18992. (KJS::Bindings::JavaString::length):
  18993. (KJS::Bindings::JavaString::ustring):
  18994. * bindings/runtime_object.cpp:
  18995. (RuntimeObjectImp::RuntimeObjectImp):
  18996. * bindings/runtime_object.h:
  18997. * kjs/ustring.cpp:
  18998. (KJS::CString::CString):
  18999. (KJS::CString::operator=):
  19000. === Safari-125 ===
  19001. === Safari-124 ===
  19002. 2004-01-16 Richard Williamson <rjw@apple.com>
  19003. Fixed 3525853. We weren't handling mapping to overloaded Java
  19004. methods very well. Even though this is undefined the other
  19005. browsers support it. Also fixed a bug with returning arrays
  19006. from Java functions.
  19007. Reviewed by John.
  19008. * bindings/jni/jni_class.cpp:
  19009. (JavaClass::_commonInit):
  19010. (JavaClass::methodsNamed):
  19011. * bindings/jni/jni_class.h:
  19012. * bindings/jni/jni_instance.cpp:
  19013. (JavaInstance::invokeMethod):
  19014. * bindings/jni/jni_instance.h:
  19015. * bindings/jni/jni_runtime.cpp:
  19016. (JavaArray::convertJObjectToArray):
  19017. (JavaField::valueFromInstance):
  19018. (JavaMethod::signature):
  19019. (JavaArray::valueAt):
  19020. * bindings/jni/jni_runtime.h:
  19021. * bindings/jni_jsobject.cpp:
  19022. (JSObject::call):
  19023. (JSObject::convertJObjectToValue):
  19024. * bindings/runtime.cpp:
  19025. (MethodList::addMethod):
  19026. (MethodList::length):
  19027. (MethodList::methodAt):
  19028. (MethodList::~MethodList):
  19029. * bindings/runtime.h:
  19030. (KJS::Bindings::MethodList::MethodList):
  19031. * bindings/runtime_method.cpp:
  19032. (RuntimeMethodImp::RuntimeMethodImp):
  19033. (RuntimeMethodImp::get):
  19034. (RuntimeMethodImp::call):
  19035. * bindings/runtime_method.h:
  19036. * bindings/runtime_object.cpp:
  19037. (RuntimeObjectImp::get):
  19038. (RuntimeObjectImp::hasProperty):
  19039. 2004-01-16 Richard Williamson <rjw@apple.com>
  19040. Fixed 3531229. Another place that needs the Push/PopLocalFrame
  19041. protection implemented for 3530401.
  19042. Reviewed by John.
  19043. * bindings/runtime_method.cpp:
  19044. (RuntimeMethodImp::call):
  19045. 2004-01-15 Richard Williamson <rjw@apple.com>
  19046. Fixed 3530401. JNI doesn't cleanup local refs created on the
  19047. main thread. IMO this is a bad bug in our JMI implementation.
  19048. To work-around the problem I explicitly delete all local refs.
  19049. Further, I've added Push/PopLocalFrame calls to catch any refs
  19050. that I may have missed. This will guarantee that we don't leak
  19051. any Java references.
  19052. Reviewed by John.
  19053. * bindings/jni/jni_class.cpp:
  19054. (JavaClass::_commonInit):
  19055. (JavaClass::JavaClass):
  19056. * bindings/jni/jni_instance.cpp:
  19057. (JavaInstance::begin):
  19058. (JavaInstance::end):
  19059. * bindings/jni/jni_instance.h:
  19060. * bindings/jni/jni_runtime.cpp:
  19061. (JavaConstructor::JavaConstructor):
  19062. (JavaMethod::JavaMethod):
  19063. * bindings/jni_jsobject.cpp:
  19064. (JSObject::listFromJArray):
  19065. * bindings/runtime.h:
  19066. (KJS::Bindings::Instance::begin):
  19067. (KJS::Bindings::Instance::end):
  19068. * bindings/runtime_object.cpp:
  19069. (RuntimeObjectImp::get):
  19070. (RuntimeObjectImp::put):
  19071. (RuntimeObjectImp::canPut):
  19072. (RuntimeObjectImp::hasProperty):
  19073. (RuntimeObjectImp::defaultValue):
  19074. 2004-01-15 Vicki Murley <vicki@apple.com>
  19075. Reviewed by Darin.
  19076. * JavaScriptCore.pbproj/project.pbxproj: Update copyright date to 2004.
  19077. 2004-01-14 Richard Williamson <rjw@apple.com>
  19078. Fixed 3529466. With recent changes to Java plugin we must no
  19079. longer call DeleteLocalRef(). Not a problem, it was an optimization anyway.
  19080. Reviewed by John.
  19081. * bindings/jni/jni_instance.cpp:
  19082. (JObjectWrapper::JObjectWrapper):
  19083. === Safari-122 ===
  19084. 2004-01-14 Richard Williamson <rjw@apple.com>
  19085. Fixed 3529010.
  19086. Finalize may be called on an JSObject after we've already remove all our references. The assert in this case is firing because we've received a finalize call from Java for an instance that we no longer know about. The fix is to check in finalize that we're getting a call on an instance that we still care about.
  19087. Reviewed by John.
  19088. * bindings/jni_jsobject.cpp:
  19089. (addJavaReference):
  19090. (removeJavaReference):
  19091. (RootObject::removeAllJavaReferencesForRoot):
  19092. (JSObject::invoke):
  19093. 2004-01-13 Richard Williamson <rjw@apple.com>
  19094. Fixed 3528324.
  19095. The run loop that is used to execute JavaScript (in practice, always the main run loop) is held in a class variable. It is set and retained once and should not be released. Unfortunately is it being released when the 'root' object on a LiveConnect applet is released. This has the symptom of eventually causing an deallocation of the main run loop! Usually after about 5 instantiations/destructions of a LiveConnect applet. The CFRelease of the run loop was removed.
  19096. Reviewed by Hyatt.
  19097. * bindings/jni_jsobject.h:
  19098. (KJS::Bindings::RootObject::~RootObject):
  19099. === Safari-121 ===
  19100. === Safari-120 ===
  19101. 2004-01-06 Richard Williamson <rjw@apple.com>
  19102. Fixed 3521814. Finalize messages weren't being dispatched!
  19103. Reviewed by John.
  19104. * bindings/jni_jsobject.cpp:
  19105. (JSObject::invoke):
  19106. 2004-01-05 Richard Williamson <rjw@apple.com>
  19107. Added cache of JNI method IDs to minimize allocations. This mitigates the problem
  19108. described by 3515579.
  19109. Also cleanup up logging of Java exceptions.
  19110. Reviewed by John.
  19111. * bindings/jni/jni_class.cpp:
  19112. (JavaClass::classForInstance):
  19113. * bindings/jni/jni_instance.cpp:
  19114. (JavaInstance::JavaInstance):
  19115. (JavaInstance::getClass):
  19116. (JavaInstance::invokeMethod):
  19117. (JObjectWrapper::JObjectWrapper):
  19118. (JObjectWrapper::~JObjectWrapper):
  19119. * bindings/jni/jni_instance.h:
  19120. (KJS::Bindings::JavaInstance::operator=):
  19121. * bindings/jni/jni_runtime.cpp:
  19122. (JavaMethod::JavaMethod):
  19123. (JavaMethod::methodID):
  19124. * bindings/jni/jni_runtime.h:
  19125. (KJS::Bindings::JavaMethod::JavaMethod):
  19126. * bindings/jni/jni_utility.cpp:
  19127. (callJNIMethod):
  19128. (callJNIMethodIDA):
  19129. (callJNIMethodA):
  19130. (KJS::Bindings::getMethodID):
  19131. (KJS::Bindings::callJNIVoidMethodIDA):
  19132. (KJS::Bindings::callJNIObjectMethodIDA):
  19133. (KJS::Bindings::callJNIByteMethodIDA):
  19134. (KJS::Bindings::callJNICharMethodIDA):
  19135. (KJS::Bindings::callJNIShortMethodIDA):
  19136. (KJS::Bindings::callJNIIntMethodIDA):
  19137. (KJS::Bindings::callJNILongMethodIDA):
  19138. (KJS::Bindings::callJNIFloatMethodIDA):
  19139. (KJS::Bindings::callJNIDoubleMethodIDA):
  19140. (KJS::Bindings::callJNIBooleanMethodIDA):
  19141. (KJS::Bindings::getCharactersFromJStringInEnv):
  19142. (KJS::Bindings::getUCharactersFromJStringInEnv):
  19143. (KJS::Bindings::getJNIField):
  19144. * bindings/jni/jni_utility.h:
  19145. l2003-12-23 John Sullivan <sullivan@apple.com>
  19146. * JavaScriptCore.pbproj/project.pbxproj:
  19147. Xcode version wars, harmless
  19148. 2003-12-23 Darin Adler <darin@apple.com>
  19149. Reviewed by John (concept, not code, which is just the old code coming back).
  19150. - fixed 3518092: REGRESSION (100-119): getting NaN instead of HH:MM times
  19151. * kjs/date_object.cpp: Added back our CF-based implementations of gmtime, localtime,
  19152. mktime, timegm, and time, because mktime, at least, won't handle a year of 0.
  19153. 2003-12-19 Richard Williamson <rjw@apple.com>
  19154. Fixed 3515597. When an error occurs we need
  19155. to make sure result values are zeroed.
  19156. Cleaned up logs by adding a newline.
  19157. Reviewed by John.
  19158. * bindings/jni/jni_utility.cpp:
  19159. (KJS::Bindings::getJavaVM):
  19160. (KJS::Bindings::getJNIEnv):
  19161. (callJNIMethod):
  19162. (callJNIMethodA):
  19163. (KJS::Bindings::getJNIField):
  19164. * bindings/jni_jsobject.cpp:
  19165. (JSObject::convertValueToJObject):
  19166. === Safari-119 ===
  19167. 2003-12-17 Richard Williamson <rjw@apple.com>
  19168. Ensure that all the symbols we export are in the KJS
  19169. namespace (3512245).
  19170. Also renamed JavaString.characters() to JavaString.UTF8String()
  19171. for enhanced clarity.
  19172. Added some sanity checking to constructor of JObjectWrapper.
  19173. Reviewed by Dave.
  19174. * ChangeLog:
  19175. * bindings/jni/jni_class.cpp:
  19176. * bindings/jni/jni_class.h:
  19177. * bindings/jni/jni_instance.cpp:
  19178. (JavaInstance::invokeMethod):
  19179. (JObjectWrapper::JObjectWrapper):
  19180. * bindings/jni/jni_instance.h:
  19181. * bindings/jni/jni_runtime.cpp:
  19182. (JavaParameter::JavaParameter):
  19183. (JavaField::JavaField):
  19184. (JavaMethod::JavaMethod):
  19185. (JavaMethod::signature):
  19186. * bindings/jni/jni_runtime.h:
  19187. (KJS::Bindings::JavaString::ascii):
  19188. (KJS::Bindings::JavaString::UTF8String):
  19189. (KJS::Bindings::JavaString::JavaString):
  19190. (KJS::Bindings::JavaString::_commonInit):
  19191. (KJS::Bindings::JavaString::uchars):
  19192. (KJS::Bindings::JavaString::length):
  19193. (KJS::Bindings::JavaString::ustring):
  19194. (KJS::Bindings::JavaParameter::type):
  19195. (KJS::Bindings::JavaField::name):
  19196. (KJS::Bindings::JavaField::type):
  19197. (KJS::Bindings::JavaMethod::name):
  19198. (KJS::Bindings::JavaMethod::returnType):
  19199. * bindings/jni/jni_utility.cpp:
  19200. (KJS::Bindings::getJavaVM):
  19201. (KJS::Bindings::getJNIEnv):
  19202. (KJS::Bindings::callJNIVoidMethod):
  19203. (KJS::Bindings::callJNIObjectMethod):
  19204. (KJS::Bindings::callJNIBooleanMethod):
  19205. (KJS::Bindings::callJNIByteMethod):
  19206. (KJS::Bindings::callJNICharMethod):
  19207. (KJS::Bindings::callJNIShortMethod):
  19208. (KJS::Bindings::callJNIIntMethod):
  19209. (KJS::Bindings::callJNILongMethod):
  19210. (KJS::Bindings::callJNIFloatMethod):
  19211. (KJS::Bindings::callJNIDoubleMethod):
  19212. (KJS::Bindings::callJNIVoidMethodA):
  19213. (KJS::Bindings::callJNIObjectMethodA):
  19214. (KJS::Bindings::callJNIByteMethodA):
  19215. (KJS::Bindings::callJNICharMethodA):
  19216. (KJS::Bindings::callJNIShortMethodA):
  19217. (KJS::Bindings::callJNIIntMethodA):
  19218. (KJS::Bindings::callJNILongMethodA):
  19219. (KJS::Bindings::callJNIFloatMethodA):
  19220. (KJS::Bindings::callJNIDoubleMethodA):
  19221. (KJS::Bindings::callJNIBooleanMethodA):
  19222. (KJS::Bindings::getCharactersFromJString):
  19223. (KJS::Bindings::releaseCharactersForJString):
  19224. (KJS::Bindings::getCharactersFromJStringInEnv):
  19225. (KJS::Bindings::releaseCharactersForJStringInEnv):
  19226. (KJS::Bindings::getUCharactersFromJStringInEnv):
  19227. (KJS::Bindings::releaseUCharactersForJStringInEnv):
  19228. (KJS::Bindings::JNITypeFromClassName):
  19229. (KJS::Bindings::signatureFromPrimitiveType):
  19230. (KJS::Bindings::JNITypeFromPrimitiveType):
  19231. (KJS::Bindings::getJNIField):
  19232. (KJS::Bindings::convertValueToJValue):
  19233. * bindings/jni/jni_utility.h:
  19234. * bindings/jni_jsobject.cpp:
  19235. (KJS::Bindings::JSObject::invoke):
  19236. (KJS::Bindings::JSObject::JSObject):
  19237. (KJS::Bindings::JSObject::call):
  19238. (KJS::Bindings::JSObject::eval):
  19239. (KJS::Bindings::JSObject::getMember):
  19240. (KJS::Bindings::JSObject::setMember):
  19241. (KJS::Bindings::JSObject::removeMember):
  19242. (KJS::Bindings::JSObject::getSlot):
  19243. (KJS::Bindings::JSObject::setSlot):
  19244. (KJS::Bindings::JSObject::toString):
  19245. (KJS::Bindings::JSObject::finalize):
  19246. (KJS::Bindings::JSObject::createNative):
  19247. (KJS::Bindings::JSObject::convertValueToJObject):
  19248. (KJS::Bindings::JSObject::convertJObjectToValue):
  19249. (KJS::Bindings::JSObject::listFromJArray):
  19250. * bindings/jni_jsobject.h:
  19251. * bindings/runtime.cpp:
  19252. * bindings/runtime.h:
  19253. * bindings/runtime_method.cpp:
  19254. * bindings/runtime_method.h:
  19255. === Safari-118 ===
  19256. 2003-12-16 Richard Williamson <rjw@apple.com>
  19257. Ack! More assertions. Lock ALL entry points into the interpreter!
  19258. (3511733).
  19259. Reviewed by Ken.
  19260. * bindings/jni_jsobject.cpp:
  19261. (Bindings::JSObject::call):
  19262. (Bindings::JSObject::eval):
  19263. (Bindings::JSObject::getMember):
  19264. (Bindings::JSObject::setMember):
  19265. (Bindings::JSObject::removeMember):
  19266. (Bindings::JSObject::getSlot):
  19267. (Bindings::JSObject::setSlot):
  19268. (Bindings::JSObject::convertJObjectToValue):
  19269. 2003-12-15 Richard Williamson <rjw@apple.com>
  19270. Fixed a couple of snafus and removed some logging.
  19271. Reviewed by Maciej.
  19272. * bindings/jni_jsobject.cpp:
  19273. (Bindings::performJavaScriptAccess):
  19274. (Bindings::completedJavaScriptAccess):
  19275. (Bindings::dispatchToJavaScriptThread):
  19276. Removed some annoying JS_LOG clutter.
  19277. (Bindings::RootObject::removeAllJavaReferencesForRoot):
  19278. Fixed allocation of key buffer that was called after it was needed.
  19279. (Bindings::JSObject::invoke):
  19280. (Bindings::JSObject::JSObject):
  19281. (Bindings::JSObject::getMember):
  19282. (Bindings::JSObject::getSlot):
  19283. Added additional interpreter locks around getMember and getSlot.
  19284. These functions may cause allocation of JS impls.
  19285. 2003-12-15 Richard Williamson <rjw@apple.com>
  19286. args weren't passed to 'call' invocation. d'oh.
  19287. lock interpreter when we create instances of JS impls.
  19288. Reviewed by Maciej.
  19289. * bindings/jni_jsobject.cpp:
  19290. (Bindings::JSObject::call):
  19291. (Bindings::JSObject::eval):
  19292. (Bindings::JSObject::getMember):
  19293. (Bindings::JSObject::setMember):
  19294. (Bindings::JSObject::getSlot):
  19295. (Bindings::JSObject::convertValueToJObject):
  19296. (Bindings::JSObject::convertJObjectToValue):
  19297. (Bindings::JSObject::listFromJArray):
  19298. * bindings/jni_jsobject.h:
  19299. 2003-12-15 Richard Williamson <rjw@apple.com>
  19300. Last piece of LiveConnect! This checkin adds implementation
  19301. of the Java to JavaScript object conversion functions.
  19302. Reviewed by John.
  19303. * bindings/jni/jni_instance.cpp:
  19304. (JavaInstance::invokeMethod):
  19305. * bindings/jni/jni_utility.cpp:
  19306. * bindings/jni/jni_utility.h:
  19307. * bindings/jni_jsobject.cpp:
  19308. (Bindings::JSObject::invoke):
  19309. (Bindings::JSObject::call):
  19310. (Bindings::JSObject::eval):
  19311. (Bindings::JSObject::getMember):
  19312. (Bindings::JSObject::setMember):
  19313. (Bindings::JSObject::getSlot):
  19314. (Bindings::JSObject::setSlot):
  19315. (Bindings::JSObject::createNative):
  19316. (Bindings::JSObject::convertValueToJObject):
  19317. (Bindings::JSObject::convertJObjectToValue):
  19318. (Bindings::JSObject::listFromJArray):
  19319. * bindings/jni_jsobject.h:
  19320. (Bindings::):
  19321. * bindings/runtime_method.cpp:
  19322. (RuntimeMethodImp::get):
  19323. (RuntimeMethodImp::codeType):
  19324. (RuntimeMethodImp::execute):
  19325. 2003-12-12 Richard Williamson <rjw@apple.com>
  19326. Added implementation of stubs in JSObject. All that
  19327. remains is a couple of simple conversion functions stubs and
  19328. we're done with LiveConnect. Also, changed string passing to
  19329. JS to use uchars instead of chars.
  19330. Reviewed by Maciej.
  19331. * bindings/jni/jni_runtime.h:
  19332. (Bindings::JavaString::JavaString):
  19333. (Bindings::JavaString::_commonInit):
  19334. (Bindings::JavaString::_commonCopy):
  19335. (Bindings::JavaString::_commonDelete):
  19336. (Bindings::JavaString::~JavaString):
  19337. (Bindings::JavaString::operator=):
  19338. (Bindings::JavaString::uchars):
  19339. (Bindings::JavaString::length):
  19340. (Bindings::JavaString::ustring):
  19341. * bindings/jni/jni_utility.cpp:
  19342. (getUCharactersFromJStringInEnv):
  19343. (releaseUCharactersForJStringInEnv):
  19344. (convertValueToJObject):
  19345. (convertJObjectToValue):
  19346. * bindings/jni/jni_utility.h:
  19347. * bindings/jni_jsobject.cpp:
  19348. (Bindings::JSObject::invoke):
  19349. (Bindings::JSObject::call):
  19350. (Bindings::JSObject::eval):
  19351. (Bindings::JSObject::getMember):
  19352. (Bindings::JSObject::setMember):
  19353. (Bindings::JSObject::removeMember):
  19354. (Bindings::JSObject::getSlot):
  19355. (Bindings::JSObject::setSlot):
  19356. * bindings/jni_jsobject.h:
  19357. 2003-12-12 Richard Williamson <rjw@apple.com>
  19358. Ensure that all calls from Java into JavaScript are
  19359. performed on a designated thread (the main thread).
  19360. Reviewed by Ken.
  19361. * bindings/jni_jsobject.cpp:
  19362. (isJavaScriptThread):
  19363. (rootForImp):
  19364. (Bindings::performJavaScriptAccess):
  19365. (Bindings::completedJavaScriptAccess):
  19366. (Bindings::initializeJavaScriptAccessLock):
  19367. (Bindings::lockJavaScriptAccess):
  19368. (Bindings::unlockJavaScriptAccess):
  19369. (Bindings::dispatchToJavaScriptThread):
  19370. (Bindings::RootObject::setFindRootObjectForNativeHandleFunction):
  19371. (Bindings::RootObject::removeAllJavaReferencesForRoot):
  19372. (Bindings::JSObject::invoke):
  19373. (Bindings::JSObject::JSObject):
  19374. (Bindings::JSObject::call):
  19375. (Bindings::JSObject::eval):
  19376. (Bindings::JSObject::getMember):
  19377. (Bindings::JSObject::setMember):
  19378. (Bindings::JSObject::removeMember):
  19379. (Bindings::JSObject::getSlot):
  19380. (Bindings::JSObject::setSlot):
  19381. (Bindings::JSObject::toString):
  19382. (Bindings::JSObject::finalize):
  19383. (Bindings::JSObject::getWindow):
  19384. * bindings/jni_jsobject.h:
  19385. (Bindings::RootObject::~RootObject):
  19386. (Bindings::RootObject::findRootObjectForNativeHandleFunction):
  19387. (Bindings::RootObject::runLoop):
  19388. (Bindings::RootObject::performJavaScriptSource):
  19389. (Bindings::):
  19390. 2003-12-11 Richard Williamson <rjw@apple.com>
  19391. Added support for calling a JavaScript function from
  19392. Java. Right now this only works for void func(void)
  19393. functions, but the conversion of args and return values
  19394. will come shortly.
  19395. Cleaned up and verified reference counting scheme, and
  19396. dereferencing of vended JavaScript objects when applet is
  19397. destroyed (actually when part is destroyed).
  19398. Removed link hack for testkjs now that the Java folks think
  19399. they have a solution for the 1.4.2 JavaVM link problem. Although
  19400. Greg B. thinks his solution may cause problems for the 1.3.1
  19401. version of the VM!?!
  19402. Reviewed by Ken.
  19403. * Makefile.am:
  19404. * bindings/jni/jni_runtime.h:
  19405. (Bindings::JavaString::JavaString):
  19406. * bindings/jni/jni_utility.cpp:
  19407. (convertValueToJValue):
  19408. (convertValueToJObject):
  19409. (listFromJArray):
  19410. * bindings/jni/jni_utility.h:
  19411. * bindings/jni_jsobject.cpp:
  19412. (KJS_setFindRootObjectForNativeHandleFunction):
  19413. (KJS_findRootObjectForNativeHandleFunction):
  19414. (getReferencesByRootDictionary):
  19415. (getReferencesDictionary):
  19416. (findReferenceDictionary):
  19417. (rootForImp):
  19418. (addJavaReference):
  19419. (removeJavaReference):
  19420. * bindings/jni_jsobject.h:
  19421. (Bindings::RootObject::RootObject):
  19422. (Bindings::RootObject::~RootObject):
  19423. (Bindings::RootObject::setRootObjectImp):
  19424. (Bindings::RootObject::rootObjectImp):
  19425. (Bindings::RootObject::setInterpreter):
  19426. (Bindings::RootObject::interpreter):
  19427. === Safari-117 ===
  19428. 2003-12-10 Darin Adler <darin@apple.com>
  19429. Reviewed by Maciej.
  19430. - fixed regression in JavaScript tests reported by the KDE guys
  19431. - fixed 3506345: REGRESSION (115-116): VIP: chordfind.com no longer displays chords
  19432. * kjs/ustring.h: Add tolerateEmptyString parameter to toDouble and toULong.
  19433. * kjs/ustring.cpp:
  19434. (KJS::UString::toDouble): Separate the "tolerant" parameter into two separate ones:
  19435. tolerateTrailingJunk and tolerateEmptyString. Add new overloads; better for code size
  19436. and binary compatibility than default parameter values.
  19437. (KJS::UString::toULong): Pass tolerateEmptyString down to toDouble. Add new overload.
  19438. * kjs/string_object.cpp: (StringProtoFuncImp::call): Pass false for the new
  19439. "tolerate empty string" parameter.
  19440. 2003-12-10 Richard Williamson <rjw@apple.com>
  19441. Added code to manage reference counting of JavaScript
  19442. objects passed to Java. Also added implementation of
  19443. KJS_JSCreateNativeJSObject. This is the function that
  19444. provides the root object to Java (KJS::Window).
  19445. Reviewed by Hyatt.
  19446. * JavaScriptCore.pbproj/project.pbxproj:
  19447. * bindings/jni_jsobject.cpp:
  19448. (KJS_setFindObjectForNativeHandleFunction):
  19449. (KJS_findObjectForNativeHandleFunction):
  19450. (getReferencesByOwnerDictionary):
  19451. (getReferencesDictionary):
  19452. (findReferenceDictionary):
  19453. (addJavaReference):
  19454. (removeJavaReference):
  19455. (removeAllJavaReferencesForOwner):
  19456. * bindings/jni_jsobject.h:
  19457. 2003-12-09 Richard Williamson <rjw@apple.com>
  19458. LiveConnect stubs that correspond to the native methods
  19459. on JSObject. These will be called from the new Java plugin
  19460. when an instance of JSObject is instantiated and messaged.
  19461. When these are implemented the Java will be able to originate
  19462. calls into JavaScript.
  19463. Also a temporary work-around added to Makefile.am to solve
  19464. a link problem. The 1.4.2 JavaVM accidentally links against
  19465. libobjc. This call a failure linking testkjs. Mike Hay is
  19466. working with someone to fix the problem (3505587).
  19467. Reviewed by Chris.
  19468. * JavaScriptCore.pbproj/project.pbxproj:
  19469. * Makefile.am:
  19470. * bindings/jni_jsobject.cpp: Added.
  19471. (KJS_JSCreateNativeJSObject):
  19472. (KJS_JSObject_JSFinalize):
  19473. (KJS_JSObject_JSObjectCall):
  19474. (KJS_JSObject_JSObjectEval):
  19475. (KJS_JSObject_JSObjectGetMember):
  19476. (KJS_JSObject_JSObjectSetMember):
  19477. (KJS_JSObject_JSObjectRemoveMember):
  19478. (KJS_JSObject_JSObjectGetSlot):
  19479. (KJS_JSObject_JSObjectSetSlot):
  19480. (KJS_JSObject_JSObjectToString):
  19481. * bindings/jni_jsobject.h: Added.
  19482. 2003-12-09 Maciej Stachowiak <mjs@apple.com>
  19483. Reviewed by John.
  19484. <rdar://problem/3505183>: JavaScriptCore should assert that interpreter is locked in collector
  19485. * kjs/collector.cpp:
  19486. (KJS::Collector::allocate): Assert that interpreter lock count is not 0.
  19487. (KJS::Collector::collect): likewise
  19488. 2003-12-08 Richard Williamson <rjw@apple.com>
  19489. LiveConnect: The last piece of the JavaScript side of the
  19490. LiveConnect implementation. This change adds support for
  19491. setting/getting values from Java arrays in JavaScript.
  19492. Reviewed by John.
  19493. * bindings/jni/jni_instance.h:
  19494. * bindings/jni/jni_runtime.cpp:
  19495. (JavaField::JavaField):
  19496. (convertJObjectToArray):
  19497. (JavaArray::JavaArray):
  19498. (JavaArray::~JavaArray):
  19499. (JavaArray::setValueAt):
  19500. (JavaArray::valueAt):
  19501. (JavaArray::getLength):
  19502. * bindings/jni/jni_runtime.h:
  19503. (Bindings::JavaArray::operator=):
  19504. (Bindings::JavaArray::javaArray):
  19505. * bindings/jni/jni_utility.cpp:
  19506. (JNITypeFromPrimitiveType):
  19507. (convertValueToJValue):
  19508. * bindings/jni/jni_utility.h:
  19509. * bindings/runtime.h:
  19510. * bindings/runtime_array.cpp:
  19511. (RuntimeArrayImp::RuntimeArrayImp):
  19512. (RuntimeArrayImp::~RuntimeArrayImp):
  19513. (RuntimeArrayImp::get):
  19514. (RuntimeArrayImp::put):
  19515. (RuntimeArrayImp::hasProperty):
  19516. * bindings/runtime_array.h:
  19517. (KJS::RuntimeArrayImp::getLength):
  19518. (KJS::RuntimeArrayImp::getConcreteArray):
  19519. * bindings/runtime_object.cpp:
  19520. (RuntimeObjectImp::get):
  19521. (RuntimeObjectImp::canPut):
  19522. (RuntimeObjectImp::hasProperty):
  19523. 2003-12-05 Richard Williamson <rjw@apple.com>
  19524. LiveConnect: Part 1 of supporting JS bindings to
  19525. native language arrays.
  19526. Reviewed by Chris.
  19527. * JavaScriptCore.pbproj/project.pbxproj:
  19528. * bindings/jni/jni_runtime.cpp:
  19529. (JavaField::JavaField):
  19530. (convertJObjectToArray):
  19531. (JavaField::valueFromInstance):
  19532. (JavaField::setValueToInstance):
  19533. * bindings/jni/jni_runtime.h:
  19534. * bindings/runtime.cpp:
  19535. (Instance::setValueOfField):
  19536. * bindings/runtime.h:
  19537. (Bindings::Array::~Array):
  19538. 2003-12-04 Richard Williamson <rjw@apple.com>
  19539. LiveConnect: Moved defaultValue into concrete implementation because
  19540. more intelligent conversion can be perform with knowledge
  19541. of the class of the original instance.
  19542. Reviewed by Chris.
  19543. * bindings/jni/jni_class.cpp:
  19544. (JavaClass::isNumberClass):
  19545. (JavaClass::isBooleanClass):
  19546. (JavaClass::isStringClass):
  19547. * bindings/jni/jni_class.h:
  19548. * bindings/jni/jni_instance.cpp:
  19549. (JavaInstance::defaultValue):
  19550. (JavaInstance::valueOf):
  19551. * bindings/jni/jni_instance.h:
  19552. (Bindings::JavaInstance::javaInstance):
  19553. * bindings/runtime.h:
  19554. * bindings/runtime_object.cpp:
  19555. (RuntimeObjectImp::defaultValue):
  19556. 2003-12-04 Richard Williamson <rjw@apple.com>
  19557. LiveConnect: Added support for setting the value of Java
  19558. fields.
  19559. Reviewed by Chris.
  19560. * bindings/jni/jni_instance.cpp:
  19561. (JavaInstance::invokeMethod):
  19562. * bindings/jni/jni_runtime.cpp:
  19563. (JavaParameter::JavaParameter):
  19564. (JavaField::JavaField):
  19565. (JavaField::valueFromInstance):
  19566. (JavaField::setValueToInstance):
  19567. (JavaMethod::JavaMethod):
  19568. * bindings/jni/jni_runtime.h:
  19569. (Bindings::JavaField::getJNIType):
  19570. * bindings/jni/jni_utility.cpp:
  19571. (JNITypeFromClassName):
  19572. (convertValueToJValue):
  19573. * bindings/jni/jni_utility.h:
  19574. * bindings/runtime.cpp:
  19575. (Instance::setValueOfField):
  19576. * bindings/runtime.h:
  19577. * bindings/runtime_object.cpp:
  19578. (RuntimeObjectImp::get):
  19579. (RuntimeObjectImp::put):
  19580. (RuntimeObjectImp::defaultValue):
  19581. 2003-12-04 Richard Williamson <rjw@apple.com>
  19582. Added support for string conversions.
  19583. Changed various JavaString member variables to be inline.
  19584. Implemented defaultValue for context relevant type coercion.
  19585. Reviewed by Chris.
  19586. * bindings/jni/jni_class.cpp:
  19587. (JavaClass::JavaClass):
  19588. (JavaClass::setClassName):
  19589. (JavaClass::classForInstance):
  19590. * bindings/jni/jni_class.h:
  19591. * bindings/jni/jni_instance.cpp:
  19592. (JavaInstance::stringValue):
  19593. (JavaInstance::numberValue):
  19594. (JavaInstance::booleanValue):
  19595. (JavaInstance::invokeMethod):
  19596. * bindings/jni/jni_instance.h:
  19597. * bindings/jni/jni_runtime.cpp:
  19598. (JavaParameter::JavaParameter):
  19599. (JavaField::JavaField):
  19600. (JavaMethod::JavaMethod):
  19601. (appendClassName):
  19602. (JavaMethod::signature):
  19603. * bindings/jni/jni_runtime.h:
  19604. (Bindings::JavaString::JavaString):
  19605. (Bindings::JavaString::~JavaString):
  19606. (Bindings::JavaString::operator=):
  19607. (Bindings::JavaString::characters):
  19608. (Bindings::JavaParameter::JavaParameter):
  19609. (Bindings::JavaParameter::~JavaParameter):
  19610. (Bindings::JavaParameter::operator=):
  19611. (Bindings::JavaParameter::type):
  19612. (Bindings::JavaField::JavaField):
  19613. (Bindings::JavaField::~JavaField):
  19614. (Bindings::JavaField::operator=):
  19615. (Bindings::JavaField::name):
  19616. (Bindings::JavaField::type):
  19617. (Bindings::JavaMethod::JavaMethod):
  19618. (Bindings::JavaMethod::_commonDelete):
  19619. (Bindings::JavaMethod::name):
  19620. (Bindings::JavaMethod::returnType):
  19621. * bindings/jni/jni_utility.cpp:
  19622. (convertValueToJValue):
  19623. * bindings/runtime.h:
  19624. (Bindings::Instance::valueOf):
  19625. * bindings/runtime_method.cpp:
  19626. (RuntimeMethodImp::call):
  19627. * bindings/runtime_object.cpp:
  19628. (RuntimeObjectImp::RuntimeObjectImp):
  19629. (RuntimeObjectImp::get):
  19630. (RuntimeObjectImp::defaultValue):
  19631. * bindings/runtime_object.h:
  19632. (KJS::RuntimeObjectImp::classInfo):
  19633. === Safari-116 ===
  19634. 2003-12-03 Richard Williamson <rjw@apple.com>
  19635. LiveConnect: Added support for parameter passing to Java and conversion
  19636. of return values.
  19637. Reviewed by Chris.
  19638. * bindings/jni/jni_instance.cpp:
  19639. (JavaInstance::invokeMethod):
  19640. * bindings/jni/jni_instance.h:
  19641. * bindings/jni/jni_runtime.cpp:
  19642. (JavaParameter::JavaParameter):
  19643. (JavaMethod::JavaMethod):
  19644. (JavaMethod::signature):
  19645. * bindings/jni/jni_runtime.h:
  19646. (Bindings::JavaParameter::JavaParameter):
  19647. (Bindings::JavaParameter::operator=):
  19648. (Bindings::JavaParameter::getJNIType):
  19649. * bindings/jni/jni_utility.cpp:
  19650. (callJNIBooleanMethodA):
  19651. (convertValueToJValue):
  19652. * bindings/jni/jni_utility.h:
  19653. * bindings/runtime.h:
  19654. * bindings/runtime_method.cpp:
  19655. (RuntimeMethodImp::call):
  19656. * bindings/runtime_object.cpp:
  19657. (RuntimeObjectImp::get):
  19658. 2003-12-02 Richard Williamson <rjw@apple.com>
  19659. Added support for calling simple methods in Java from JavaScript.
  19660. (void return and no parameters). Yay, LiveConnect lives.
  19661. Still need write argument and return value conversion code.
  19662. Reviewed by Chris.
  19663. * JavaScriptCore.pbproj/project.pbxproj:
  19664. * bindings/jni/jni_instance.cpp:
  19665. (JavaInstance::getClass):
  19666. (JavaInstance::invokeMethod):
  19667. * bindings/jni/jni_instance.h:
  19668. * bindings/jni/jni_runtime.cpp:
  19669. (JavaMethod::JavaMethod):
  19670. (JavaMethod::signature):
  19671. (JavaMethod::JNIReturnType):
  19672. * bindings/jni/jni_runtime.h:
  19673. (Bindings::JavaMethod::_commonDelete):
  19674. (Bindings::JavaMethod::_commonCopy):
  19675. (Bindings::JavaMethod::name):
  19676. * bindings/jni/jni_utility.cpp:
  19677. (signatureFromPrimitiveType):
  19678. * bindings/jni/jni_utility.h:
  19679. * bindings/runtime.h:
  19680. * bindings/runtime_method.cpp: Added.
  19681. (RuntimeMethodImp::RuntimeMethodImp):
  19682. (RuntimeMethodImp::~RuntimeMethodImp):
  19683. (RuntimeMethodImp::get):
  19684. (RuntimeMethodImp::implementsCall):
  19685. (RuntimeMethodImp::call):
  19686. (RuntimeMethodImp::codeType):
  19687. (RuntimeMethodImp::execute):
  19688. * bindings/runtime_method.h: Added.
  19689. * bindings/runtime_object.cpp:
  19690. (RuntimeObjectImp::RuntimeObjectImp):
  19691. (RuntimeObjectImp::get):
  19692. * bindings/runtime_object.h:
  19693. * kjs/function.cpp:
  19694. (FunctionImp::FunctionImp):
  19695. * kjs/interpreter.h:
  19696. 2003-12-01 Darin Adler <darin@apple.com>
  19697. Reviewed by Maciej.
  19698. - fixed 3493799: JavaScript string.replace expands $ if it's the last character in replacement string
  19699. * kjs/ustring.cpp: (KJS::UString::toDouble): Fix backwards handling of the "tolerant" boolean.
  19700. This indirectly caused the string.replace bug.
  19701. 2003-12-02 Maciej Stachowiak <mjs@apple.com>
  19702. Merged patches from Harri Porten and David Faure to fix:
  19703. <rdar://problem/3497643>: reproducible crash printing self-referential array
  19704. * kjs/array_object.cpp:
  19705. (ArrayProtoFuncImp::call): Break out of the loop if an exception was thrown.
  19706. * kjs/nodes.cpp:
  19707. (FunctionCallNode::evaluate): Move function call depth check from here...
  19708. * kjs/object.cpp:
  19709. (KJS::Object::call): ...to here.
  19710. * kjs/object.h: Un-inline Object::call now that it does more.
  19711. 2003-12-01 Richard Williamson <rjw@apple.com>
  19712. Fixed mistake in method signatures used to get boolean and integer fields.
  19713. Reviewed by Chris.
  19714. * bindings/jni/jni_runtime.cpp:
  19715. (JavaField::valueFromInstance):
  19716. 2003-12-01 Richard Williamson <rjw@apple.com>
  19717. Fixed parameter passing to applet. Child elements are NOT valid in setStyle(). So we now create the widget before needed with createWidgetIfNecessary. This either happens when doing the first layout, or when JavaScript first references the applet element.
  19718. Fixed early delete of the the main applet instance. When the JS collector cleaned up the last JS object referring to the applet instance we were deleting the java instance. This caused the applet instance cached on the applet element to be invalid. The applet instance is the only Java object not to be cleaned up by the JS collector.
  19719. Added support for getting at Java object fields.
  19720. Reviewed by Chris.
  19721. * JavaScriptCore.pbproj/project.pbxproj:
  19722. * Makefile.am:
  19723. * bindings/jni/jni_instance.cpp:
  19724. (JObjectWrapper::JObjectWrapper):
  19725. * bindings/jni/jni_instance.h:
  19726. (Bindings::JObjectWrapper::~JObjectWrapper):
  19727. * bindings/jni/jni_runtime.cpp:
  19728. (JavaField::valueFromInstance):
  19729. * bindings/runtime_object.cpp:
  19730. (RuntimeObjectImp::~RuntimeObjectImp):
  19731. (RuntimeObjectImp::RuntimeObjectImp):
  19732. (RuntimeObjectImp::get):
  19733. (RuntimeObjectImp::deleteProperty):
  19734. * bindings/runtime_object.h:
  19735. === Safari-115 ===
  19736. 2003-11-21 Maciej Stachowiak <mjs@apple.com>
  19737. Patch from Harri Porten, reviewed by me.
  19738. - fixed 3491712 - String slice with negative arguments does not offset from end of string
  19739. * kjs/string_object.cpp:
  19740. (StringProtoFuncImp::call): Handle negative arguments as offsets from end by
  19741. adding length and clamping to [0,length-1].
  19742. 2003-11-21 Maciej Stachowiak <mjs@apple.com>
  19743. Patch from Harri Porten, reviewed by me.
  19744. - fixed 3491709 - using Function.apply with a primitive type as the arg list causes crash
  19745. * kjs/function_object.cpp:
  19746. (FunctionProtoFuncImp::call): Nest parentheses properly.
  19747. 2003-11-20 Richard Williamson <rjw@apple.com>
  19748. More LiveConnect stuff. Primitive Java fields are now
  19749. accessible from JavaScript! Yay!
  19750. Reviewed by Maciej.
  19751. * bindings/jni/jni_class.cpp:
  19752. (JavaClass::methodNamed):
  19753. (JavaClass::fieldNamed):
  19754. * bindings/jni/jni_class.h:
  19755. (Bindings::JavaClass::_commonDelete):
  19756. * bindings/jni/jni_instance.cpp:
  19757. (JavaInstance::JavaInstance):
  19758. (JavaInstance::~JavaInstance):
  19759. (JavaInstance::getClass):
  19760. * bindings/jni/jni_instance.h:
  19761. (Bindings::JavaInstance::javaInstance):
  19762. * bindings/jni/jni_runtime.cpp:
  19763. (JavaField::JavaField):
  19764. (JavaField::valueFromInstance):
  19765. * bindings/jni/jni_runtime.h:
  19766. (Bindings::JavaField::JavaField):
  19767. (Bindings::JavaField::~JavaField):
  19768. (Bindings::JavaField::operator=):
  19769. * bindings/jni/jni_utility.cpp:
  19770. (callJNIMethod):
  19771. (callJNIMethodA):
  19772. (callJNIVoidMethod):
  19773. (callJNIObjectMethod):
  19774. (callJNIBooleanMethod):
  19775. (callJNIByteMethod):
  19776. (callJNICharMethod):
  19777. (callJNIShortMethod):
  19778. (callJNIIntMethod):
  19779. (callJNILongMethod):
  19780. (callJNIFloatMethod):
  19781. (callJNIDoubleMethod):
  19782. (callJNIVoidMethodA):
  19783. (callJNIObjectMethodA):
  19784. (callJNIByteMethodA):
  19785. (callJNICharMethodA):
  19786. (callJNIShortMethodA):
  19787. (callJNIIntMethodA):
  19788. (callJNILongMethodA):
  19789. (callJNIFloatMethodA):
  19790. (callJNIDoubleMethodA):
  19791. (releaseCharactersForJStringInEnv):
  19792. (primitiveTypeFromClassName):
  19793. (getJNIField):
  19794. * bindings/jni/jni_utility.h:
  19795. * bindings/runtime.cpp:
  19796. (Instance::createBindingForLanguageInstance):
  19797. (Instance::getValueOfField):
  19798. * bindings/runtime.h:
  19799. * bindings/runtime_object.cpp:
  19800. (RuntimeObjectImp::get):
  19801. 2003-11-20 Richard Williamson <rjw@apple.com>
  19802. More LiveConnect stuff.
  19803. Reviewed by Chris.
  19804. * bindings/jni/jni_class.cpp:
  19805. (JavaClass::classForName):
  19806. (JavaClass::classForInstance):
  19807. * bindings/jni/jni_instance.cpp:
  19808. (JavaInstance::getValueOfField):
  19809. * bindings/jni/jni_instance.h:
  19810. (Bindings::JObjectWrapper::JObjectWrapper):
  19811. * bindings/jni/jni_runtime.h:
  19812. (Bindings::JavaConstructor::~JavaConstructor):
  19813. (Bindings::JavaConstructor::operator=):
  19814. (Bindings::JavaMethod::JavaMethod):
  19815. (Bindings::JavaMethod::_commonDelete):
  19816. (Bindings::JavaMethod::signature):
  19817. * bindings/jni/jni_utility.cpp:
  19818. (getJNIEnv):
  19819. (attachToJavaVM):
  19820. * bindings/jni/jni_utility.h:
  19821. * bindings/runtime.h:
  19822. * bindings/runtime_object.cpp:
  19823. (RuntimeObjectImp::~RuntimeObjectImp):
  19824. (RuntimeObjectImp::get):
  19825. * bindings/runtime_object.h:
  19826. 2003-11-19 Richard Williamson <rjw@apple.com>
  19827. More LiveConnect stuff.
  19828. Reviewed by Ken.
  19829. * JavaScriptCore.pbproj/project.pbxproj:
  19830. * bindings/jni/jni_class.cpp: Added.
  19831. (JavaClass::_commonInit):
  19832. (JavaClass::JavaClass):
  19833. (_createClassesByNameIfNecessary):
  19834. (JavaClass::classForName):
  19835. (JavaClass::classForInstance):
  19836. (JavaClass::methodNamed):
  19837. (JavaClass::fieldNamed):
  19838. * bindings/jni/jni_class.h: Added.
  19839. (Bindings::JavaClass::_commonDelete):
  19840. (Bindings::JavaClass::~JavaClass):
  19841. (Bindings::JavaClass::_commonCopy):
  19842. (Bindings::JavaClass::JavaClass):
  19843. (Bindings::JavaClass::operator=):
  19844. (Bindings::JavaClass::name):
  19845. (Bindings::JavaClass::constructorAt):
  19846. (Bindings::JavaClass::numConstructors):
  19847. * bindings/jni/jni_instance.cpp: Added.
  19848. (JavaInstance::JavaInstance):
  19849. (JavaInstance::~JavaInstance):
  19850. * bindings/jni/jni_instance.h: Added.
  19851. (Bindings::JObjectWrapper::JObjectWrapper):
  19852. (Bindings::JObjectWrapper::~JObjectWrapper):
  19853. (Bindings::JObjectWrapper::ref):
  19854. (Bindings::JObjectWrapper::deref):
  19855. (Bindings::JavaInstance::getClass):
  19856. (Bindings::JavaInstance::operator=):
  19857. * bindings/jni/jni_runtime.cpp:
  19858. (JavaMethod::JavaMethod):
  19859. * bindings/jni/jni_runtime.h:
  19860. (Bindings::JavaString::JavaString):
  19861. (Bindings::JavaString::~JavaString):
  19862. (Bindings::JavaString::operator=):
  19863. * bindings/jni/jni_utility.cpp:
  19864. (getJavaVM):
  19865. (getJNIEnv):
  19866. (getCharactersFromJString):
  19867. (releaseCharactersForJString):
  19868. (getCharactersFromJStringInEnv):
  19869. (releaseCharactersForJStringInEnv):
  19870. * bindings/jni/jni_utility.h:
  19871. * bindings/runtime.cpp:
  19872. (Instance::createBindingForLanguageInstance):
  19873. * bindings/runtime.h:
  19874. (Bindings::Instance::):
  19875. 2003-11-18 Richard Williamson <rjw@apple.com>
  19876. More live connect stubs. We're getting close.
  19877. Reviewed by Chris.
  19878. * JavaScriptCore.pbproj/project.pbxproj:
  19879. * bindings/jni/jni_runtime.cpp:
  19880. (JavaClass::JavaClass):
  19881. (JavaInstance::JavaInstance):
  19882. (JavaInstance::~JavaInstance):
  19883. * bindings/jni/jni_runtime.h:
  19884. (Bindings::JavaConstructor::value):
  19885. (Bindings::JavaField::value):
  19886. (Bindings::JavaMethod::value):
  19887. (Bindings::JavaClass::_commonDelete):
  19888. (Bindings::JavaClass::_commonCopy):
  19889. (Bindings::JavaClass::methodNamed):
  19890. (Bindings::JavaClass::fieldNamed):
  19891. (Bindings::JavaInstance::getClass):
  19892. * bindings/runtime.cpp: Added.
  19893. * bindings/runtime.h:
  19894. (Bindings::Instance::~Instance):
  19895. * bindings/runtime_object.cpp: Added.
  19896. (RuntimeObjectImp::classInfo):
  19897. (RuntimeObjectImp::RuntimeObjectImp):
  19898. (RuntimeObjectImp::get):
  19899. (RuntimeObjectImp::put):
  19900. (RuntimeObjectImp::canPut):
  19901. (RuntimeObjectImp::hasProperty):
  19902. (RuntimeObjectImp::deleteProperty):
  19903. (RuntimeObjectImp::defaultValue):
  19904. (RuntimeObjectImp::_initializeClassInfoFromInstance):
  19905. * bindings/runtime_object.h: Added.
  19906. (KJS::RuntimeObjectImp::setInternalInstance):
  19907. (KJS::RuntimeObjectImp::getInternalInstance):
  19908. * kjs/object.cpp:
  19909. (KJS::ObjectImp::get):
  19910. (KJS::ObjectImp::hasProperty):
  19911. * kjs/value.h:
  19912. (KJS::):
  19913. 2003-11-17 Maciej Stachowiak <mjs@apple.com>
  19914. Patch from Harri, reviewed by me.
  19915. - fixed 3487375 - backwards array slice causes infinite loop
  19916. * kjs/array_object.cpp:
  19917. (ArrayProtoFuncImp::call):
  19918. 2003-11-17 Maciej Stachowiak <mjs@apple.com>
  19919. Patch from Harri Porten reviewed by me.
  19920. - fixed 3487371 - operator precedence for bitwise or, xor and and is wrong
  19921. * kjs/grammar.y: Correct the precedence.
  19922. 2003-11-16 Maciej Stachowiak <mjs@apple.com>
  19923. Reviewed by John.
  19924. - fixed 3483829 - JavaScriptCore needs workaround to compile on Merlot
  19925. * JavaScriptCore.pbproj/project.pbxproj: Add -Wno-long-double to
  19926. warning flags.
  19927. === Safari-114 ===
  19928. 2003-11-13 Richard Williamson <rjw@apple.com>
  19929. Factored common code between copy constructor and assignment operator.
  19930. Reviewed by Chris.
  19931. * ChangeLog:
  19932. * bindings/jni/jni_runtime.h:
  19933. (Bindings::JavaConstructor::_commonCopy):
  19934. (Bindings::JavaConstructor::JavaConstructor):
  19935. (Bindings::JavaConstructor::operator=):
  19936. (Bindings::JavaField::type):
  19937. * bindings/runtime.h:
  19938. 2003-11-13 Richard Williamson <rjw@apple.com>
  19939. More LiveConnect stuff. This checkin adds abstract classes to model
  19940. language runtimes and a JNI based set of concrete implementations for
  19941. Java.
  19942. Reviewed by Chris.
  19943. * JavaScriptCore.pbproj/project.pbxproj:
  19944. * Makefile.am:
  19945. * bindings/Makefile.am: Removed.
  19946. * bindings/jni/Makefile.am: Removed.
  19947. * bindings/jni/jni_runtime.cpp: Added.
  19948. (JavaField::JavaField):
  19949. (JavaConstructor::JavaConstructor):
  19950. (JavaMethod::JavaMethod):
  19951. (JavaClass::JavaClass):
  19952. * bindings/jni/jni_runtime.h: Added.
  19953. (Bindings::JavaString::JavaString):
  19954. (Bindings::JavaString::~JavaString):
  19955. (Bindings::JavaString::operator=):
  19956. (Bindings::JavaString::characters):
  19957. (Bindings::JavaParameter::JavaParameter):
  19958. (Bindings::JavaParameter::~JavaParameter):
  19959. (Bindings::JavaParameter::operator=):
  19960. (Bindings::JavaParameter::type):
  19961. (Bindings::JavaConstructor::JavaConstructor):
  19962. (Bindings::JavaConstructor::~JavaConstructor):
  19963. (Bindings::JavaConstructor::operator=):
  19964. (Bindings::JavaConstructor::parameterAt):
  19965. (Bindings::JavaConstructor::numParameters):
  19966. (Bindings::JavaField::JavaField):
  19967. (Bindings::JavaField::~JavaField):
  19968. (Bindings::JavaField::operator=):
  19969. (Bindings::JavaField::name):
  19970. (Bindings::JavaField::type):
  19971. (Bindings::JavaMethod::JavaMethod):
  19972. (Bindings::JavaMethod::_commonDelete):
  19973. (Bindings::JavaMethod::~JavaMethod):
  19974. (Bindings::JavaMethod::_commonCopy):
  19975. (Bindings::JavaMethod::operator=):
  19976. (Bindings::JavaMethod::name):
  19977. (Bindings::JavaMethod::returnType):
  19978. (Bindings::JavaMethod::parameterAt):
  19979. (Bindings::JavaMethod::numParameters):
  19980. (Bindings::JavaClass::_commonDelete):
  19981. (Bindings::JavaClass::~JavaClass):
  19982. (Bindings::JavaClass::_commonCopy):
  19983. (Bindings::JavaClass::JavaClass):
  19984. (Bindings::JavaClass::operator=):
  19985. (Bindings::JavaClass::name):
  19986. (Bindings::JavaClass::methodAt):
  19987. (Bindings::JavaClass::numMethods):
  19988. (Bindings::JavaClass::constructorAt):
  19989. (Bindings::JavaClass::numConstructors):
  19990. (Bindings::JavaClass::fieldAt):
  19991. (Bindings::JavaClass::numFields):
  19992. * bindings/jni/jni_utility.cpp:
  19993. (callJNIMethod):
  19994. (callJNIMethodA):
  19995. (callJNIObjectMethod):
  19996. (callJNIByteMethod):
  19997. (callJNICharMethod):
  19998. (callJNIShortMethod):
  19999. (callJNIIntMethod):
  20000. (callJNILongMethod):
  20001. (callJNIFloatMethod):
  20002. (callJNIDoubleMethod):
  20003. (callJNIVoidMethodA):
  20004. (callJNIObjectMethodA):
  20005. (callJNIByteMethodA):
  20006. (callJNICharMethodA):
  20007. (callJNIShortMethodA):
  20008. (callJNIIntMethodA):
  20009. (callJNILongMethodA):
  20010. (callJNIFloatMethodA):
  20011. (callJNIDoubleMethodA):
  20012. (getCharactersFromJString):
  20013. (releaseCharactersForJString):
  20014. * bindings/jni/jni_utility.h:
  20015. * bindings/objc/Makefile.am: Removed.
  20016. * bindings/runtime.h: Added.
  20017. (Bindings::Parameter::~Parameter):
  20018. (Bindings::Constructor::~Constructor):
  20019. (Bindings::Field::~Field):
  20020. (Bindings::Method::~Method):
  20021. (Bindings::Class::~Class):
  20022. 2003-11-13 Maciej Stachowiak <mjs@apple.com>
  20023. Reviewed by John.
  20024. - fixed 3472562 - Null or Undefined variables passed to IN operator cause javascript exceptions
  20025. * kjs/nodes.cpp:
  20026. (ForInNode::execute): If the in value is null or undefined, bail
  20027. out early, since attempting to iterate its properties will throw
  20028. an exception.
  20029. 2003-11-12 Darin Adler <darin@apple.com>
  20030. - fixed the build
  20031. * Makefile.am: Fix the build by removing the bindings directory from SUBDIRS.
  20032. Later, we can either add this back and add the Makefile.am files to the top
  20033. level configure.in or leave it out and remove the Makefile.am files.
  20034. 2003-11-12 Richard Williamson <rjw@apple.com>
  20035. Added utility functions for calling JNI methods.
  20036. Reviewed by Chris.
  20037. * JavaScriptCore.pbproj/project.pbxproj:
  20038. * Makefile.am:
  20039. * bindings/Makefile.am: Added.
  20040. * bindings/jni/Makefile.am: Added.
  20041. * bindings/jni/jni_utility.cpp: Added.
  20042. (attachToJavaVM):
  20043. (callJNIMethod):
  20044. (callJNIVoidMethod):
  20045. (callJNIObjectMethod):
  20046. (callJNIByteMethod):
  20047. (callJNICharMethod):
  20048. (callJNIShortMethod):
  20049. (callJNIIntMethod):
  20050. (callJNILongMethod):
  20051. (callJNIFloatMethod):
  20052. (callJNIDoubleMethod):
  20053. * bindings/jni/jni_utility.h: Added.
  20054. * bindings/objc/Makefile.am: Added.
  20055. 2003-11-08 Darin Adler <darin@apple.com>
  20056. Reviewed by John.
  20057. - fixed 3477528 -- array.sort(function) fails if the function returns a non-zero value that rounds to zero
  20058. * kjs/array_object.cpp:
  20059. (compareByStringForQSort): Added checks for undefined values to match what the specification calls for.
  20060. (compareWithCompareFunctionForQSort): Added checks for undefined values as above, and also changed the
  20061. code that looks at the compare function result to look at the number returned without rounding to an integer.
  20062. (ArrayProtoFuncImp::call): Changed the code that looks at the compare function result to look at the number
  20063. returned without rounding to an integer.
  20064. === Safari-113 ===
  20065. 2003-11-03 Vicki Murley <vicki@apple.com>
  20066. Reviewed by kocienda.
  20067. - fixed <rdar://problem/3471096>: non-B&I builds should not use order files, because they cause false "regressions" in perf.
  20068. * JavaScriptCore.pbproj/project.pbxproj: added empty SECTORDER_FLAGS variables to the Development and Deployment build styles
  20069. 2003-11-02 Darin Adler <darin@apple.com>
  20070. Reviewed by Maciej.
  20071. - changed list manipulation to use Harri Porten's idea of a circular
  20072. linked list that is built from head to tail rather than building the
  20073. list backwards and reversing the list when done
  20074. * kjs/grammar.y: Handle CatchNode and FinallyNode in a type-safe way.
  20075. Change many places that passed 0L to pass nothing at all, or to pass 0.
  20076. * kjs/nodes.h:
  20077. (KJS::ElementNode::ElementNode): Build a circular list instead of a 0-terminated
  20078. backwards list.
  20079. (KJS::ArrayNode::ArrayNode): Break the circular list instead of reversing the list.
  20080. (KJS::PropertyValueNode::PropertyValueNode): Moved before ObjectLiteralNode so the
  20081. inline code in ObjectLiteralNode works. Build a circular list instead of a 0-terminated
  20082. backwards list. Made the case for the first node separate so we don't need a nil check.
  20083. (KJS::ObjectLiteralNode::ObjectLiteralNode): Break the circular list instead of
  20084. reversing the list.
  20085. (KJS::ArgumentListNode::ArgumentListNode): Build a circular list instead of a 0-terminated
  20086. backwards list. Also, made the constructors inline (moved here from .cpp file).
  20087. (KJS::ArgumentsNode::ArgumentsNode): Break the circular list instead of
  20088. reversing the list.
  20089. (KJS::NewExprNode::NewExprNode): Changed a 0L to 0.
  20090. (KJS::StatListNode::StatListNode): Make this constructor no longer inline (moved into
  20091. .cpp file). The one in the .cpp file builds a circular list instead of a 0-terminated
  20092. backwards list.
  20093. (KJS::VarDeclListNode::VarDeclListNode): Build a circular list instead of a 0-terminated
  20094. backwards list.
  20095. (KJS::VarStatementNode::VarStatementNode): Break the circular list instead of reversing
  20096. the list.
  20097. (KJS::BlockNode::BlockNode): Make this constructor no longer inline (moved into .cpp file).
  20098. The one in the .cpp file breaks the list instead of reversing it.
  20099. (KJS::ForNode::ForNode): Break the circular list instead of reversing the list.
  20100. (KJS::CaseClauseNode::CaseClauseNode): Break the circular list instead of reversing the
  20101. list.
  20102. (KJS::ClauseListNode::ClauseListNode): Build a circular list instead of a 0-terminated
  20103. backwards list.
  20104. (KJS::CaseBlockNode::CaseBlockNode): Make this constructor no longer inline (moved into
  20105. .cpp file). The one in the .cpp file breaks the list instead of reversing it.
  20106. (KJS::TryNode::TryNode): Changed constructor to take typed parameters for the catch and
  20107. finally nodes rather than just Node.
  20108. (KJS::ParameterNode::ParameterNode): Build a circular list instead of a 0-terminated
  20109. backwards list.
  20110. (KJS::FuncDeclNode::FuncDeclNode): Break the circular list instead of reversing the
  20111. list.
  20112. (KJS::FuncExprNode::FuncExprNode): Break the circular list instead of reversing the
  20113. list.
  20114. * kjs/nodes.cpp:
  20115. (StatListNode::StatListNode): Moved this constructor here, no longer inline.
  20116. Did the "break circular list" thing instead of the "reverse list" thing.
  20117. Added setLoc calls to match KJS in the KDE tree; since we don't currently
  20118. use the JavaScript debugging support, it's unclear whether there's any benefit, but
  20119. later we might be using it and it's good to be as close as possible.
  20120. (BlockNode::BlockNode): Moved this constructor here, no longer inline.
  20121. Did the "break circular list" thing instead of the "reverse list" thing.
  20122. Added setLoc calls.
  20123. (CaseBlockNode::CaseBlockNode): Moved this constructor here, no longer inline.
  20124. Did the "break circular list" thing instead of the "reverse list" thing.
  20125. (SourceElementsNode::SourceElementsNode): Moved this constructor here, no longer inline.
  20126. Did the "break circular list" thing instead of the "reverse list" thing.
  20127. Added setLoc calls.
  20128. * kjs/grammar.cpp: Regenerated.
  20129. * kjs/grammar.cpp.h: Regenerated.
  20130. * kjs/grammar.h: Regenerated.
  20131. === Safari-112 ===
  20132. 2003-10-30 Maciej Stachowiak <mjs@apple.com>
  20133. Reviewed by Ken.
  20134. - fixed 3427069 - browsing mp3.com causes leaks (KJS)
  20135. * kjs/string_object.cpp:
  20136. (StringProtoFuncImp::call): Don't do an early return, since that
  20137. could leak a temporary regexp.
  20138. 2003-10-29 Maciej Stachowiak <mjs@apple.com>
  20139. Reviewed by Darin.
  20140. - fixed 3426076 - Leak of JS lexer data visiting http://www.ebay.com
  20141. * kjs/grammar.cpp:
  20142. (yyerror): Updated the commented code.
  20143. * kjs/grammar.y: Don't delete string and identifier tokens when done
  20144. with them any more, they'll get cleaned up by the lexer now.
  20145. * kjs/internal.cpp:
  20146. (Parser::parse): Tell lexer when done parsing.
  20147. * kjs/lexer.cpp:
  20148. (Lexer::Lexer): Initialize new data members.
  20149. (Lexer::lex): Use new methods to make strings and identifiers, and
  20150. save them.
  20151. (Lexer::makeIdentifier): Make a new Identifier and save it in an
  20152. auto-growing array.
  20153. (Lexer::makeUString): Likewise for UStrings.
  20154. (Lexer::doneParsing): Clean up arrays of Ifentifiers and UStrings.
  20155. * kjs/lexer.h:
  20156. 2003-10-28 Maciej Stachowiak <mjs@apple.com>
  20157. Reviewed by Ken.
  20158. - fixed 3413962 - malicious web pages can kill all future JavaScript execution by breaking recursion limit check
  20159. * kjs/nodes.cpp:
  20160. (FunctionCallNode::evaluate): If we're going to return early due
  20161. to breaking the recursion limit, make sure to lower it again, or
  20162. it will creep up by one each time it's exceeded.
  20163. 2003-10-26 Darin Adler <darin@apple.com>
  20164. * JavaScriptCorePrefix.h: Added a C case to the NULL definition since we use C as well
  20165. as C++ in this project.
  20166. 2003-10-26 Darin Adler <darin@apple.com>
  20167. - rolled in some CString changes Harri Porten did on the KDE side
  20168. * kjs/ustring.cpp:
  20169. (KJS::CString::CString): Use memcpy instead of strcpy for speed. Fix an off by one error
  20170. in the copy constructor.
  20171. (KJS::CString::operator=): Use memcpy instead of strcpy for speed.
  20172. * JavaScriptCorePrefix.h: Add a definition of NULL here that takes advantage of the GNU
  20173. __null feature even if the system C library doesn't.
  20174. == Rolled over to ChangeLog-2003-10-25 ==