Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: src/runtime.cc

Issue 14296009: Inline String.fromCharCode in hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | test/mjsunit/string-fromcharcode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 7e7d6d5d585759f01f74b5f9cfef0b5f979669d8..3fd5f6dc043ba141edf3a2092ac91e27637a334b 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -2417,11 +2417,9 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSGeneratorObject) {
MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate,
Object* char_code) {
- uint32_t code;
- if (char_code->ToArrayIndex(&code)) {
- if (code <= 0xffff) {
- return isolate->heap()->LookupSingleCharacterStringFromCode(code);
- }
+ if (char_code->IsNumber()) {
+ return isolate->heap()->LookupSingleCharacterStringFromCode(
+ NumberToUint32(char_code) & 0xffff);
}
return isolate->heap()->empty_string();
}
« no previous file with comments | « src/hydrogen.cc ('k') | test/mjsunit/string-fromcharcode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698