Ignore:
Timestamp:
Apr 27, 2010, 11:17:35 AM (15 years ago)
Author:
[email protected]
Message:

2010-04-26 Oliver Hunt <[email protected]>

Reviewed by Maciej Stachowiak.

Add specialized thunks for a char code related string functions
https://bugs.webkit.org/show_bug.cgi?id=38177

This is a simple extension to my prior patch. Basically hoist the
existing character loading logic from the charCodeAt thunk and into
a helper function, then add a helper to load strings from the small
string cache. This allows trivial implementations of fromCharCode
and charAt.

  • create_hash_table:
  • jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::returnJSCell): (JSC::SpecializedThunkJIT::tagReturnAsJSCell):
  • jit/ThunkGenerators.cpp: (JSC::stringCharLoad): (JSC::charToString): (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator):
  • jit/ThunkGenerators.h:
  • runtime/SmallStrings.h: (JSC::SmallStrings::singleCharacterStrings):
  • runtime/StringConstructor.cpp: (JSC::StringConstructor::StringConstructor):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/StringConstructor.cpp

    r53320 r58317  
    5555
    5656    // ECMA 15.5.3.2 fromCharCode()
     57#if ENABLE(JIT)
     58    putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, exec->globalData().getThunk(fromCharCodeThunkGenerator), stringFromCharCode), DontEnum);
     59#else
    5760    putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum);
    58 
     61#endif
    5962    // no. of arguments for constructor
    6063    putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
Note: See TracChangeset for help on using the changeset viewer.