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

Side by Side Diff: src/runtime/runtime-numbers.cc

Issue 638423003: Split off remaining runtime functions in runtime.cc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/runtime-internal.cc ('k') | src/runtime/runtime-object.cc » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/bootstrapper.h"
8 #include "src/codegen.h" 9 #include "src/codegen.h"
9 #include "src/misc-intrinsics.h" 10 #include "src/misc-intrinsics.h"
10 #include "src/runtime/runtime.h" 11 #include "src/runtime/runtime.h"
11 #include "src/runtime/runtime-utils.h" 12 #include "src/runtime/runtime-utils.h"
12 13
13 14
14 #ifndef _STLP_VENDOR_CSTD 15 #ifndef _STLP_VENDOR_CSTD
15 // STLPort doesn't import fpclassify and isless into the std namespace. 16 // STLPort doesn't import fpclassify and isless into the std namespace.
16 using std::fpclassify; 17 using std::fpclassify;
17 using std::isless; 18 using std::isless;
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 x_scaled /= 10; 551 x_scaled /= 10;
551 tie = GREATER; 552 tie = GREATER;
552 } 553 }
553 554
554 if (x_scaled < y_scaled) return Smi::FromInt(LESS); 555 if (x_scaled < y_scaled) return Smi::FromInt(LESS);
555 if (x_scaled > y_scaled) return Smi::FromInt(GREATER); 556 if (x_scaled > y_scaled) return Smi::FromInt(GREATER);
556 return Smi::FromInt(tie); 557 return Smi::FromInt(tie);
557 } 558 }
558 559
559 560
561 RUNTIME_FUNCTION(Runtime_GetRootNaN) {
562 SealHandleScope shs(isolate);
563 DCHECK(args.length() == 0);
564 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
565 return isolate->heap()->nan_value();
566 }
567
568
569 RUNTIME_FUNCTION(Runtime_MaxSmi) {
570 SealHandleScope shs(isolate);
571 DCHECK(args.length() == 0);
572 return Smi::FromInt(Smi::kMaxValue);
573 }
574
575
560 RUNTIME_FUNCTION(RuntimeReference_NumberToString) { 576 RUNTIME_FUNCTION(RuntimeReference_NumberToString) {
561 SealHandleScope shs(isolate); 577 SealHandleScope shs(isolate);
562 return __RT_impl_Runtime_NumberToStringRT(args, isolate); 578 return __RT_impl_Runtime_NumberToStringRT(args, isolate);
563 } 579 }
564 580
565 581
566 RUNTIME_FUNCTION(RuntimeReference_IsSmi) { 582 RUNTIME_FUNCTION(RuntimeReference_IsSmi) {
567 SealHandleScope shs(isolate); 583 SealHandleScope shs(isolate);
568 DCHECK(args.length() == 1); 584 DCHECK(args.length() == 1);
569 CONVERT_ARG_CHECKED(Object, obj, 0); 585 CONVERT_ARG_CHECKED(Object, obj, 0);
570 return isolate->heap()->ToBoolean(obj->IsSmi()); 586 return isolate->heap()->ToBoolean(obj->IsSmi());
571 } 587 }
572 588
573 589
574 RUNTIME_FUNCTION(RuntimeReference_IsNonNegativeSmi) { 590 RUNTIME_FUNCTION(RuntimeReference_IsNonNegativeSmi) {
575 SealHandleScope shs(isolate); 591 SealHandleScope shs(isolate);
576 DCHECK(args.length() == 1); 592 DCHECK(args.length() == 1);
577 CONVERT_ARG_CHECKED(Object, obj, 0); 593 CONVERT_ARG_CHECKED(Object, obj, 0);
578 return isolate->heap()->ToBoolean(obj->IsSmi() && 594 return isolate->heap()->ToBoolean(obj->IsSmi() &&
579 Smi::cast(obj)->value() >= 0); 595 Smi::cast(obj)->value() >= 0);
580 } 596 }
581 } 597 }
582 } // namespace v8::internal 598 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698