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

Side by Side Diff: src/runtime.cc

Issue 7391001: Implement sealing, freezing, and related functions for proxies. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing Mads' comments, plus bug fix. Created 9 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 } 608 }
609 609
610 610
611 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHandler) { 611 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHandler) {
612 ASSERT(args.length() == 1); 612 ASSERT(args.length() == 1);
613 CONVERT_CHECKED(JSProxy, proxy, args[0]); 613 CONVERT_CHECKED(JSProxy, proxy, args[0]);
614 return proxy->handler(); 614 return proxy->handler();
615 } 615 }
616 616
617 617
618 RUNTIME_FUNCTION(MaybeObject*, Runtime_Fix) {
619 ASSERT(args.length() == 1);
620 CONVERT_CHECKED(JSProxy, proxy, args[0]);
621 proxy->Fix();
622 return proxy;
Vyacheslav Egorov (Chromium) 2011/07/19 04:07:57 You are potentially returning invalid pointer here
rossberg 2011/07/20 09:11:09 Done.
623 }
624
625
618 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClassOf) { 626 RUNTIME_FUNCTION(MaybeObject*, Runtime_ClassOf) {
619 NoHandleAllocation ha; 627 NoHandleAllocation ha;
620 ASSERT(args.length() == 1); 628 ASSERT(args.length() == 1);
621 Object* obj = args[0]; 629 Object* obj = args[0];
622 if (!obj->IsJSObject()) return isolate->heap()->null_value(); 630 if (!obj->IsJSObject()) return isolate->heap()->null_value();
623 return JSObject::cast(obj)->class_name(); 631 return JSObject::cast(obj)->class_name();
624 } 632 }
625 633
626 634
627 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPrototype) { 635 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPrototype) {
(...skipping 12042 matching lines...) Expand 10 before | Expand all | Expand 10 after
12670 } else { 12678 } else {
12671 // Handle last resort GC and make sure to allow future allocations 12679 // Handle last resort GC and make sure to allow future allocations
12672 // to grow the heap without causing GCs (if possible). 12680 // to grow the heap without causing GCs (if possible).
12673 isolate->counters()->gc_last_resort_from_js()->Increment(); 12681 isolate->counters()->gc_last_resort_from_js()->Increment();
12674 isolate->heap()->CollectAllGarbage(false); 12682 isolate->heap()->CollectAllGarbage(false);
12675 } 12683 }
12676 } 12684 }
12677 12685
12678 12686
12679 } } // namespace v8::internal 12687 } } // namespace v8::internal
OLDNEW
« src/objects.cc ('K') | « src/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698