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

Side by Side Diff: src/runtime.cc

Issue 7015038: Merge revision 7879 to trunk. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 7 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/runtime.h ('k') | src/v8natives.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 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 4089 matching lines...) Expand 10 before | Expand all | Expand 10 after
4100 4100
4101 return Runtime::SetObjectProperty(isolate, 4101 return Runtime::SetObjectProperty(isolate,
4102 object, 4102 object,
4103 key, 4103 key,
4104 value, 4104 value,
4105 attributes, 4105 attributes,
4106 strict_mode); 4106 strict_mode);
4107 } 4107 }
4108 4108
4109 4109
4110 // Set the ES5 native flag on the function.
4111 // This is used to decide if we should transform null and undefined
4112 // into the global object when doing call and apply.
4113 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetES5Flag) {
4114 NoHandleAllocation ha;
4115 RUNTIME_ASSERT(args.length() == 1);
4116
4117 Handle<Object> object = args.at<Object>(0);
4118
4119 if (object->IsJSFunction()) {
4120 JSFunction* func = JSFunction::cast(*object);
4121 func->shared()->set_es5_native(true);
4122 }
4123 return isolate->heap()->undefined_value();
4124 }
4125
4126
4110 // Set a local property, even if it is READ_ONLY. If the property does not 4127 // Set a local property, even if it is READ_ONLY. If the property does not
4111 // exist, it will be added with attributes NONE. 4128 // exist, it will be added with attributes NONE.
4112 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { 4129 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) {
4113 NoHandleAllocation ha; 4130 NoHandleAllocation ha;
4114 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); 4131 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
4115 CONVERT_CHECKED(JSObject, object, args[0]); 4132 CONVERT_CHECKED(JSObject, object, args[0]);
4116 CONVERT_CHECKED(String, name, args[1]); 4133 CONVERT_CHECKED(String, name, args[1]);
4117 // Compute attributes. 4134 // Compute attributes.
4118 PropertyAttributes attributes = NONE; 4135 PropertyAttributes attributes = NONE;
4119 if (args.length() == 4) { 4136 if (args.length() == 4) {
(...skipping 8054 matching lines...) Expand 10 before | Expand all | Expand 10 after
12174 } else { 12191 } else {
12175 // Handle last resort GC and make sure to allow future allocations 12192 // Handle last resort GC and make sure to allow future allocations
12176 // to grow the heap without causing GCs (if possible). 12193 // to grow the heap without causing GCs (if possible).
12177 isolate->counters()->gc_last_resort_from_js()->Increment(); 12194 isolate->counters()->gc_last_resort_from_js()->Increment();
12178 isolate->heap()->CollectAllGarbage(false); 12195 isolate->heap()->CollectAllGarbage(false);
12179 } 12196 }
12180 } 12197 }
12181 12198
12182 12199
12183 } } // namespace v8::internal 12200 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698