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

Side by Side Diff: src/runtime.cc

Issue 6450003: Make sure that we do not call is_extensible on the global proxy.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 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 | « no previous file | test/mjsunit/regress/regress-1120.js » ('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 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 { MaybeObject* maybe_value = obj->GetProperty(*obj, &result, *name, &attrs); 871 { MaybeObject* maybe_value = obj->GetProperty(*obj, &result, *name, &attrs);
872 if (!maybe_value->ToObject(&value)) return maybe_value; 872 if (!maybe_value->ToObject(&value)) return maybe_value;
873 } 873 }
874 elms->set(VALUE_INDEX, value); 874 elms->set(VALUE_INDEX, value);
875 } 875 }
876 876
877 return *desc; 877 return *desc;
878 } 878 }
879 879
880 880
881 static MaybeObject* Runtime_PreventExtensions(Arguments args) { 881 static MaybeObject* Runtime_PreventExtensions(Arguments args) {
Mads Ager (chromium) 2011/02/08 13:04:22 Do you need it here too?
Rico 2011/02/08 13:08:58 No, we do this in PreventExtensions in objects.cc
882 ASSERT(args.length() == 1); 882 ASSERT(args.length() == 1);
883 CONVERT_CHECKED(JSObject, obj, args[0]); 883 CONVERT_CHECKED(JSObject, obj, args[0]);
884 return obj->PreventExtensions(); 884 return obj->PreventExtensions();
885 } 885 }
886 886
887 static MaybeObject* Runtime_IsExtensible(Arguments args) { 887 static MaybeObject* Runtime_IsExtensible(Arguments args) {
888 ASSERT(args.length() == 1); 888 ASSERT(args.length() == 1);
889 CONVERT_CHECKED(JSObject, obj, args[0]); 889 CONVERT_CHECKED(JSObject, obj, args[0]);
890 if (obj->IsJSGlobalProxy()) {
891 Object* proto = obj->GetPrototype();
892 if (proto->IsNull()) return obj;
Mads Ager (chromium) 2011/02/08 13:04:22 Return false? Otherwise this will be interpreted a
Rico 2011/02/08 13:08:58 Done.
893 ASSERT(proto->IsJSGlobalObject());
894 obj = JSObject::cast(proto);
895 }
890 return obj->map()->is_extensible() ? Heap::true_value() 896 return obj->map()->is_extensible() ? Heap::true_value()
Mads Ager (chromium) 2011/02/08 13:04:22 Remove extra space.
Rico 2011/02/08 13:08:58 Done.
891 : Heap::false_value(); 897 : Heap::false_value();
892 } 898 }
893 899
894 900
895 static MaybeObject* Runtime_RegExpCompile(Arguments args) { 901 static MaybeObject* Runtime_RegExpCompile(Arguments args) {
896 HandleScope scope; 902 HandleScope scope;
897 ASSERT(args.length() == 3); 903 ASSERT(args.length() == 3);
898 CONVERT_ARG_CHECKED(JSRegExp, re, 0); 904 CONVERT_ARG_CHECKED(JSRegExp, re, 0);
899 CONVERT_ARG_CHECKED(String, pattern, 1); 905 CONVERT_ARG_CHECKED(String, pattern, 1);
900 CONVERT_ARG_CHECKED(String, flags, 2); 906 CONVERT_ARG_CHECKED(String, flags, 2);
(...skipping 10166 matching lines...) Expand 10 before | Expand all | Expand 10 after
11067 } else { 11073 } else {
11068 // Handle last resort GC and make sure to allow future allocations 11074 // Handle last resort GC and make sure to allow future allocations
11069 // to grow the heap without causing GCs (if possible). 11075 // to grow the heap without causing GCs (if possible).
11070 Counters::gc_last_resort_from_js.Increment(); 11076 Counters::gc_last_resort_from_js.Increment();
11071 Heap::CollectAllGarbage(false); 11077 Heap::CollectAllGarbage(false);
11072 } 11078 }
11073 } 11079 }
11074 11080
11075 11081
11076 } } // namespace v8::internal 11082 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1120.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698