OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
661 boilerplate = | 661 boilerplate = |
662 Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements); | 662 Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements); |
663 if (boilerplate.is_null()) return Failure::Exception(); | 663 if (boilerplate.is_null()) return Failure::Exception(); |
664 // Update the functions literal and return the boilerplate. | 664 // Update the functions literal and return the boilerplate. |
665 literals->set(literals_index, *boilerplate); | 665 literals->set(literals_index, *boilerplate); |
666 } | 666 } |
667 if (JSObject::cast(*boilerplate)->elements()->map() == | 667 if (JSObject::cast(*boilerplate)->elements()->map() == |
668 isolate->heap()->fixed_cow_array_map()) { | 668 isolate->heap()->fixed_cow_array_map()) { |
669 isolate->counters()->cow_arrays_created_runtime()->Increment(); | 669 isolate->counters()->cow_arrays_created_runtime()->Increment(); |
670 } | 670 } |
671 return isolate->heap()->CopyJSObject(JSObject::cast(*boilerplate)); | 671 AllocationSiteInfoMode mode = FLAG_track_allocation_sites ? |
672 TRACK_ALLOCATION_SITE_INFO | |
danno
2013/01/10 22:58:59
nit: ? goes on following line. i.e.
AllocationSite
mvstanton
2013/01/11 13:43:01
Done.
| |
673 : DONT_TRACK_ALLOCATION_SITE_INFO; | |
674 return isolate->heap()->CopyJSObject(JSObject::cast(*boilerplate), mode); | |
672 } | 675 } |
673 | 676 |
674 | 677 |
675 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) { | 678 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) { |
676 ASSERT(args.length() == 2); | 679 ASSERT(args.length() == 2); |
677 CONVERT_ARG_CHECKED(JSReceiver, handler, 0); | 680 CONVERT_ARG_CHECKED(JSReceiver, handler, 0); |
678 Object* prototype = args[1]; | 681 Object* prototype = args[1]; |
679 Object* used_prototype = | 682 Object* used_prototype = |
680 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value(); | 683 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value(); |
681 return isolate->heap()->AllocateJSProxy(handler, used_prototype); | 684 return isolate->heap()->AllocateJSProxy(handler, used_prototype); |
(...skipping 12947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13629 // Handle last resort GC and make sure to allow future allocations | 13632 // Handle last resort GC and make sure to allow future allocations |
13630 // to grow the heap without causing GCs (if possible). | 13633 // to grow the heap without causing GCs (if possible). |
13631 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13634 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13632 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13635 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
13633 "Runtime::PerformGC"); | 13636 "Runtime::PerformGC"); |
13634 } | 13637 } |
13635 } | 13638 } |
13636 | 13639 |
13637 | 13640 |
13638 } } // namespace v8::internal | 13641 } } // namespace v8::internal |
OLD | NEW |