mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
1. remove Increment, Decrement opcode
2. implement fast String buffer access 3. remove hash from AtomicStringMap 4. implement simple dtoa cache Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
2825008995
commit
109be415d1
22 changed files with 268 additions and 234 deletions
|
|
@ -108,12 +108,28 @@ int main(int argc, char* argv[])
|
|||
runShell = false;
|
||||
std::string str;
|
||||
char buf[512];
|
||||
bool hasNonASCIIContent = false;
|
||||
while (fgets(buf, sizeof buf, fp) != NULL) {
|
||||
str += buf;
|
||||
if (!hasNonASCIIContent) {
|
||||
char* check = buf;
|
||||
while (*check) {
|
||||
if (*check < 0) {
|
||||
hasNonASCIIContent = true;
|
||||
break;
|
||||
}
|
||||
check++;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
Escargot::String* src = new Escargot::UTF16String(std::move(Escargot::utf8StringToUTF16String(str.data(), str.length())));
|
||||
Escargot::String* src;
|
||||
if (hasNonASCIIContent)
|
||||
src = new Escargot::UTF16String(std::move(Escargot::utf8StringToUTF16String(str.data(), str.length())));
|
||||
else
|
||||
src = new Escargot::ASCIIString(str.data(), str.length());
|
||||
|
||||
if (!eval(context, src, Escargot::String::fromUTF8(argv[i], strlen(argv[i])), false))
|
||||
return 3;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue