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

Side by Side Diff: src/factory.cc

Issue 1714753003: Don't internalize names that are array indexes since they aren't used for lookup (the index is) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/lookup.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/factory.h" 5 #include "src/factory.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 int num = Handle<Smi>::cast(number)->value(); 2222 int num = Handle<Smi>::cast(number)->value();
2223 str = IntToCString(num, buffer); 2223 str = IntToCString(num, buffer);
2224 } else { 2224 } else {
2225 double num = Handle<HeapNumber>::cast(number)->value(); 2225 double num = Handle<HeapNumber>::cast(number)->value();
2226 str = DoubleToCString(num, buffer); 2226 str = DoubleToCString(num, buffer);
2227 } 2227 }
2228 2228
2229 // We tenure the allocated string since it is referenced from the 2229 // We tenure the allocated string since it is referenced from the
2230 // number-string cache which lives in the old space. 2230 // number-string cache which lives in the old space.
2231 Handle<String> js_string = NewStringFromAsciiChecked(str, TENURED); 2231 Handle<String> js_string = NewStringFromAsciiChecked(str, TENURED);
2232 // Make sure the string cached in the number cache is also the internalized
2233 // version of the same string.
2234 js_string = InternalizeString(js_string);
2235 SetNumberStringCache(number, js_string); 2232 SetNumberStringCache(number, js_string);
2236 return js_string; 2233 return js_string;
2237 } 2234 }
2238 2235
2239 2236
2240 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) { 2237 Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
2241 // Allocate initial fixed array for active break points before allocating the 2238 // Allocate initial fixed array for active break points before allocating the
2242 // debug info object to avoid allocation while setting up the debug info 2239 // debug info object to avoid allocation while setting up the debug info
2243 // object. 2240 // object.
2244 Handle<FixedArray> break_points( 2241 Handle<FixedArray> break_points(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 } 2388 }
2392 2389
2393 2390
2394 Handle<Object> Factory::ToBoolean(bool value) { 2391 Handle<Object> Factory::ToBoolean(bool value) {
2395 return value ? true_value() : false_value(); 2392 return value ? true_value() : false_value();
2396 } 2393 }
2397 2394
2398 2395
2399 } // namespace internal 2396 } // namespace internal
2400 } // namespace v8 2397 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/lookup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698