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

Side by Side Diff: src/runtime.cc

Issue 11817017: Additional work to get array literal allocation tracking working, even with --always-opt (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Quick adjustment to bit fields Created 7 years, 11 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/objects-inl.h ('k') | src/x64/code-stubs-x64.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 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
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
672 JSObject* boilerplate_object = JSObject::cast(*boilerplate);
673 AllocationSiteMode mode = AllocationSiteInfo::GetMode(
674 boilerplate_object->GetElementsKind());
675 return isolate->heap()->CopyJSObject(boilerplate_object, mode);
672 } 676 }
673 677
674 678
675 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) { 679 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) {
676 ASSERT(args.length() == 2); 680 ASSERT(args.length() == 2);
677 CONVERT_ARG_CHECKED(JSReceiver, handler, 0); 681 CONVERT_ARG_CHECKED(JSReceiver, handler, 0);
678 Object* prototype = args[1]; 682 Object* prototype = args[1];
679 Object* used_prototype = 683 Object* used_prototype =
680 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value(); 684 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value();
681 return isolate->heap()->AllocateJSProxy(handler, used_prototype); 685 return isolate->heap()->AllocateJSProxy(handler, used_prototype);
(...skipping 13034 matching lines...) Expand 10 before | Expand all | Expand 10 after
13716 // Handle last resort GC and make sure to allow future allocations 13720 // Handle last resort GC and make sure to allow future allocations
13717 // to grow the heap without causing GCs (if possible). 13721 // to grow the heap without causing GCs (if possible).
13718 isolate->counters()->gc_last_resort_from_js()->Increment(); 13722 isolate->counters()->gc_last_resort_from_js()->Increment();
13719 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13723 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13720 "Runtime::PerformGC"); 13724 "Runtime::PerformGC");
13721 } 13725 }
13722 } 13726 }
13723 13727
13724 13728
13725 } } // namespace v8::internal 13729 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698