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

Side by Side Diff: src/runtime.cc

Issue 5767002: Merge math function ids and custom call generator ids. (Closed)
Patch Set: arm and x64 fixes. Created 10 years 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 new_proto_map->set_is_hidden_prototype(); 607 new_proto_map->set_is_hidden_prototype();
608 608
609 // Set the object's prototype to proto. 609 // Set the object's prototype to proto.
610 new_map->set_prototype(proto); 610 new_map->set_prototype(proto);
611 jsobject->set_map(new_map); 611 jsobject->set_map(new_map);
612 612
613 return Heap::undefined_value(); 613 return Heap::undefined_value();
614 } 614 }
615 615
616 616
617 // Sets the magic number that identifies a function as one of the special
618 // math functions that can be inlined.
619 static MaybeObject* Runtime_SetMathFunctionId(Arguments args) {
620 NoHandleAllocation ha;
621 ASSERT(args.length() == 2);
622 CONVERT_CHECKED(JSFunction, function, args[0]);
623 CONVERT_CHECKED(Smi, id, args[1]);
624 RUNTIME_ASSERT(id->value() >= 0);
625 RUNTIME_ASSERT(id->value() < SharedFunctionInfo::max_math_id_number());
626
627 function->shared()->set_math_function_id(id->value());
628
629 return Heap::undefined_value();
630 }
631
632
633 static MaybeObject* Runtime_IsConstructCall(Arguments args) { 617 static MaybeObject* Runtime_IsConstructCall(Arguments args) {
634 NoHandleAllocation ha; 618 NoHandleAllocation ha;
635 ASSERT(args.length() == 0); 619 ASSERT(args.length() == 0);
636 JavaScriptFrameIterator it; 620 JavaScriptFrameIterator it;
637 return Heap::ToBoolean(it.frame()->IsConstructor()); 621 return Heap::ToBoolean(it.frame()->IsConstructor());
638 } 622 }
639 623
640 624
641 // Recursively traverses hidden prototypes if property is not found 625 // Recursively traverses hidden prototypes if property is not found
642 static void GetOwnPropertyImplementation(JSObject* obj, 626 static void GetOwnPropertyImplementation(JSObject* obj,
(...skipping 10135 matching lines...) Expand 10 before | Expand all | Expand 10 after
10778 } else { 10762 } else {
10779 // Handle last resort GC and make sure to allow future allocations 10763 // Handle last resort GC and make sure to allow future allocations
10780 // to grow the heap without causing GCs (if possible). 10764 // to grow the heap without causing GCs (if possible).
10781 Counters::gc_last_resort_from_js.Increment(); 10765 Counters::gc_last_resort_from_js.Increment();
10782 Heap::CollectAllGarbage(false); 10766 Heap::CollectAllGarbage(false);
10783 } 10767 }
10784 } 10768 }
10785 10769
10786 10770
10787 } } // namespace v8::internal 10771 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698