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

Side by Side Diff: src/runtime.cc

Issue 12296026: ES6 symbols: Implement Symbol intrinsic and basic functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 7 years, 9 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 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 isolate->counters()->cow_arrays_created_runtime()->Increment(); 672 isolate->counters()->cow_arrays_created_runtime()->Increment();
673 } 673 }
674 674
675 JSObject* boilerplate_object = JSObject::cast(*boilerplate); 675 JSObject* boilerplate_object = JSObject::cast(*boilerplate);
676 AllocationSiteMode mode = AllocationSiteInfo::GetMode( 676 AllocationSiteMode mode = AllocationSiteInfo::GetMode(
677 boilerplate_object->GetElementsKind()); 677 boilerplate_object->GetElementsKind());
678 return isolate->heap()->CopyJSObject(boilerplate_object, mode); 678 return isolate->heap()->CopyJSObject(boilerplate_object, mode);
679 } 679 }
680 680
681 681
682 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateSymbol) {
Michael Starzinger 2013/02/26 20:41:49 Let's play it safe and add "NoHandleAllocation ha;
rossberg 2013/02/27 13:12:23 Done.
683 ASSERT(args.length() == 0);
684 return isolate->heap()->AllocateSymbol();
685 }
686
687
682 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) { 688 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) {
683 ASSERT(args.length() == 2); 689 ASSERT(args.length() == 2);
684 CONVERT_ARG_CHECKED(JSReceiver, handler, 0); 690 CONVERT_ARG_CHECKED(JSReceiver, handler, 0);
685 Object* prototype = args[1]; 691 Object* prototype = args[1];
686 Object* used_prototype = 692 Object* used_prototype =
687 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value(); 693 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value();
688 return isolate->heap()->AllocateJSProxy(handler, used_prototype); 694 return isolate->heap()->AllocateJSProxy(handler, used_prototype);
689 } 695 }
690 696
691 697
(...skipping 12836 matching lines...) Expand 10 before | Expand all | Expand 10 after
13528 // Handle last resort GC and make sure to allow future allocations 13534 // Handle last resort GC and make sure to allow future allocations
13529 // to grow the heap without causing GCs (if possible). 13535 // to grow the heap without causing GCs (if possible).
13530 isolate->counters()->gc_last_resort_from_js()->Increment(); 13536 isolate->counters()->gc_last_resort_from_js()->Increment();
13531 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13537 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13532 "Runtime::PerformGC"); 13538 "Runtime::PerformGC");
13533 } 13539 }
13534 } 13540 }
13535 13541
13536 13542
13537 } } // namespace v8::internal 13543 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698