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

Side by Side Diff: src/runtime.cc

Issue 2843049: Simplify the transitions in the Binary Op ICs. Now a single call... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 5 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
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 5559 matching lines...) Expand 10 before | Expand all | Expand 10 after
5570 return Heap::nan_value(); 5570 return Heap::nan_value();
5571 } 5571 }
5572 5572
5573 5573
5574 static Object* Runtime_NumberAdd(Arguments args) { 5574 static Object* Runtime_NumberAdd(Arguments args) {
5575 NoHandleAllocation ha; 5575 NoHandleAllocation ha;
5576 ASSERT(args.length() == 2); 5576 ASSERT(args.length() == 2);
5577 5577
5578 CONVERT_DOUBLE_CHECKED(x, args[0]); 5578 CONVERT_DOUBLE_CHECKED(x, args[0]);
5579 CONVERT_DOUBLE_CHECKED(y, args[1]); 5579 CONVERT_DOUBLE_CHECKED(y, args[1]);
5580 return Heap::AllocateHeapNumber(x + y); 5580 return Heap::NumberFromDouble(x + y);
Kasper Lund 2010/07/06 11:56:35 No more AllocateHeapNumber left in runtime.cc?
Erik Corry 2010/07/06 12:53:21 I removed one for integer Math.pow, but the rest w
5581 } 5581 }
5582 5582
5583 5583
5584 static Object* Runtime_NumberSub(Arguments args) { 5584 static Object* Runtime_NumberSub(Arguments args) {
5585 NoHandleAllocation ha; 5585 NoHandleAllocation ha;
5586 ASSERT(args.length() == 2); 5586 ASSERT(args.length() == 2);
5587 5587
5588 CONVERT_DOUBLE_CHECKED(x, args[0]); 5588 CONVERT_DOUBLE_CHECKED(x, args[0]);
5589 CONVERT_DOUBLE_CHECKED(y, args[1]); 5589 CONVERT_DOUBLE_CHECKED(y, args[1]);
5590 return Heap::AllocateHeapNumber(x - y); 5590 return Heap::NumberFromDouble(x - y);
5591 } 5591 }
5592 5592
5593 5593
5594 static Object* Runtime_NumberMul(Arguments args) { 5594 static Object* Runtime_NumberMul(Arguments args) {
5595 NoHandleAllocation ha; 5595 NoHandleAllocation ha;
5596 ASSERT(args.length() == 2); 5596 ASSERT(args.length() == 2);
5597 5597
5598 CONVERT_DOUBLE_CHECKED(x, args[0]); 5598 CONVERT_DOUBLE_CHECKED(x, args[0]);
5599 CONVERT_DOUBLE_CHECKED(y, args[1]); 5599 CONVERT_DOUBLE_CHECKED(y, args[1]);
5600 return Heap::AllocateHeapNumber(x * y); 5600 return Heap::NumberFromDouble(x * y);
5601 } 5601 }
5602 5602
5603 5603
5604 static Object* Runtime_NumberUnaryMinus(Arguments args) { 5604 static Object* Runtime_NumberUnaryMinus(Arguments args) {
5605 NoHandleAllocation ha; 5605 NoHandleAllocation ha;
5606 ASSERT(args.length() == 1); 5606 ASSERT(args.length() == 1);
5607 5607
5608 CONVERT_DOUBLE_CHECKED(x, args[0]); 5608 CONVERT_DOUBLE_CHECKED(x, args[0]);
5609 return Heap::AllocateHeapNumber(-x); 5609 return Heap::NumberFromDouble(-x);
5610 } 5610 }
5611 5611
5612 5612
5613 static Object* Runtime_NumberDiv(Arguments args) { 5613 static Object* Runtime_NumberDiv(Arguments args) {
5614 NoHandleAllocation ha; 5614 NoHandleAllocation ha;
5615 ASSERT(args.length() == 2); 5615 ASSERT(args.length() == 2);
5616 5616
5617 CONVERT_DOUBLE_CHECKED(x, args[0]); 5617 CONVERT_DOUBLE_CHECKED(x, args[0]);
5618 CONVERT_DOUBLE_CHECKED(y, args[1]); 5618 CONVERT_DOUBLE_CHECKED(y, args[1]);
5619 return Heap::NumberFromDouble(x / y); 5619 return Heap::NumberFromDouble(x / y);
(...skipping 4918 matching lines...) Expand 10 before | Expand all | Expand 10 after
10538 } else { 10538 } else {
10539 // Handle last resort GC and make sure to allow future allocations 10539 // Handle last resort GC and make sure to allow future allocations
10540 // to grow the heap without causing GCs (if possible). 10540 // to grow the heap without causing GCs (if possible).
10541 Counters::gc_last_resort_from_js.Increment(); 10541 Counters::gc_last_resort_from_js.Increment();
10542 Heap::CollectAllGarbage(false); 10542 Heap::CollectAllGarbage(false);
10543 } 10543 }
10544 } 10544 }
10545 10545
10546 10546
10547 } } // namespace v8::internal 10547 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698