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

Side by Side Diff: src/runtime.cc

Issue 7085034: Reapply change to Pass undefined to JS builtins when called with (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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 4099 matching lines...) Expand 10 before | Expand all | Expand 10 after
4110 4110
4111 return Runtime::SetObjectProperty(isolate, 4111 return Runtime::SetObjectProperty(isolate,
4112 object, 4112 object,
4113 key, 4113 key,
4114 value, 4114 value,
4115 attributes, 4115 attributes,
4116 strict_mode); 4116 strict_mode);
4117 } 4117 }
4118 4118
4119 4119
4120 // Set the ES5 native flag on the function. 4120 // Set the native flag on the function.
4121 // This is used to decide if we should transform null and undefined 4121 // This is used to decide if we should transform null and undefined
4122 // into the global object when doing call and apply. 4122 // into the global object when doing call and apply.
4123 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetES5Flag) { 4123 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetNativeFlag) {
4124 NoHandleAllocation ha; 4124 NoHandleAllocation ha;
4125 RUNTIME_ASSERT(args.length() == 1); 4125 RUNTIME_ASSERT(args.length() == 1);
4126 4126
4127 Handle<Object> object = args.at<Object>(0); 4127 Handle<Object> object = args.at<Object>(0);
4128 4128
4129 if (object->IsJSFunction()) { 4129 if (object->IsJSFunction()) {
4130 JSFunction* func = JSFunction::cast(*object); 4130 JSFunction* func = JSFunction::cast(*object);
4131 func->shared()->set_es5_native(true); 4131 func->shared()->set_native(true);
4132 } 4132 }
4133 return isolate->heap()->undefined_value(); 4133 return isolate->heap()->undefined_value();
4134 } 4134 }
4135 4135
4136 4136
4137 // Set a local property, even if it is READ_ONLY. If the property does not 4137 // Set a local property, even if it is READ_ONLY. If the property does not
4138 // exist, it will be added with attributes NONE. 4138 // exist, it will be added with attributes NONE.
4139 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { 4139 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) {
4140 NoHandleAllocation ha; 4140 NoHandleAllocation ha;
4141 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); 4141 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
(...skipping 8183 matching lines...) Expand 10 before | Expand all | Expand 10 after
12325 } else { 12325 } else {
12326 // Handle last resort GC and make sure to allow future allocations 12326 // Handle last resort GC and make sure to allow future allocations
12327 // to grow the heap without causing GCs (if possible). 12327 // to grow the heap without causing GCs (if possible).
12328 isolate->counters()->gc_last_resort_from_js()->Increment(); 12328 isolate->counters()->gc_last_resort_from_js()->Increment();
12329 isolate->heap()->CollectAllGarbage(false); 12329 isolate->heap()->CollectAllGarbage(false);
12330 } 12330 }
12331 } 12331 }
12332 12332
12333 12333
12334 } } // namespace v8::internal 12334 } } // 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