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

Side by Side Diff: src/runtime.cc

Issue 1602010: Add number string cache lookup for heap numbers to generatred code (on top of... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.h ('k') | src/runtime.js » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5231 matching lines...) Expand 10 before | Expand all | Expand 10 after
5242 NoHandleAllocation ha; 5242 NoHandleAllocation ha;
5243 ASSERT(args.length() == 1); 5243 ASSERT(args.length() == 1);
5244 5244
5245 Object* number = args[0]; 5245 Object* number = args[0];
5246 RUNTIME_ASSERT(number->IsNumber()); 5246 RUNTIME_ASSERT(number->IsNumber());
5247 5247
5248 return Heap::NumberToString(number); 5248 return Heap::NumberToString(number);
5249 } 5249 }
5250 5250
5251 5251
5252 static Object* Runtime_NumberToStringSkipCache(Arguments args) {
5253 NoHandleAllocation ha;
5254 ASSERT(args.length() == 1);
5255
5256 Object* number = args[0];
5257 RUNTIME_ASSERT(number->IsNumber());
5258
5259 return Heap::NumberToString(number, false);
5260 }
5261
5262
5252 static Object* Runtime_NumberToInteger(Arguments args) { 5263 static Object* Runtime_NumberToInteger(Arguments args) {
5253 NoHandleAllocation ha; 5264 NoHandleAllocation ha;
5254 ASSERT(args.length() == 1); 5265 ASSERT(args.length() == 1);
5255 5266
5256 CONVERT_DOUBLE_CHECKED(number, args[0]); 5267 CONVERT_DOUBLE_CHECKED(number, args[0]);
5257 5268
5258 // We do not include 0 so that we don't have to treat +0 / -0 cases. 5269 // We do not include 0 so that we don't have to treat +0 / -0 cases.
5259 if (number > 0 && number <= Smi::kMaxValue) { 5270 if (number > 0 && number <= Smi::kMaxValue) {
5260 return Smi::FromInt(static_cast<int>(number)); 5271 return Smi::FromInt(static_cast<int>(number));
5261 } 5272 }
(...skipping 4777 matching lines...) Expand 10 before | Expand all | Expand 10 after
10039 } else { 10050 } else {
10040 // Handle last resort GC and make sure to allow future allocations 10051 // Handle last resort GC and make sure to allow future allocations
10041 // to grow the heap without causing GCs (if possible). 10052 // to grow the heap without causing GCs (if possible).
10042 Counters::gc_last_resort_from_js.Increment(); 10053 Counters::gc_last_resort_from_js.Increment();
10043 Heap::CollectAllGarbage(false); 10054 Heap::CollectAllGarbage(false);
10044 } 10055 }
10045 } 10056 }
10046 10057
10047 10058
10048 } } // namespace v8::internal 10059 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698