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

Side by Side Diff: src/runtime.cc

Issue 7068009: Pass undefined to JS builtins when called with implicit receiver. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update sputnik test expectations. 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 4102 matching lines...) Expand 10 before | Expand all | Expand 10 after
4113 4113
4114 return Runtime::SetObjectProperty(isolate, 4114 return Runtime::SetObjectProperty(isolate,
4115 object, 4115 object,
4116 key, 4116 key,
4117 value, 4117 value,
4118 attributes, 4118 attributes,
4119 strict_mode); 4119 strict_mode);
4120 } 4120 }
4121 4121
4122 4122
4123 // Set the ES5 native flag on the function. 4123 // Set the native flag on the function.
4124 // This is used to decide if we should transform null and undefined 4124 // This is used to decide if we should transform null and undefined
4125 // into the global object when doing call and apply. 4125 // into the global object when doing call and apply.
4126 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetES5Flag) { 4126 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetNativeFlag) {
4127 NoHandleAllocation ha; 4127 NoHandleAllocation ha;
4128 RUNTIME_ASSERT(args.length() == 1); 4128 RUNTIME_ASSERT(args.length() == 1);
4129 4129
4130 Handle<Object> object = args.at<Object>(0); 4130 Handle<Object> object = args.at<Object>(0);
4131 4131
4132 if (object->IsJSFunction()) { 4132 if (object->IsJSFunction()) {
4133 JSFunction* func = JSFunction::cast(*object); 4133 JSFunction* func = JSFunction::cast(*object);
4134 func->shared()->set_es5_native(true); 4134 func->shared()->set_native(true);
4135 } 4135 }
4136 return isolate->heap()->undefined_value(); 4136 return isolate->heap()->undefined_value();
4137 } 4137 }
4138 4138
4139 4139
4140 // Set a local property, even if it is READ_ONLY. If the property does not 4140 // Set a local property, even if it is READ_ONLY. If the property does not
4141 // exist, it will be added with attributes NONE. 4141 // exist, it will be added with attributes NONE.
4142 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) { 4142 RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) {
4143 NoHandleAllocation ha; 4143 NoHandleAllocation ha;
4144 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); 4144 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
(...skipping 8073 matching lines...) Expand 10 before | Expand all | Expand 10 after
12218 } else { 12218 } else {
12219 // Handle last resort GC and make sure to allow future allocations 12219 // Handle last resort GC and make sure to allow future allocations
12220 // to grow the heap without causing GCs (if possible). 12220 // to grow the heap without causing GCs (if possible).
12221 isolate->counters()->gc_last_resort_from_js()->Increment(); 12221 isolate->counters()->gc_last_resort_from_js()->Increment();
12222 isolate->heap()->CollectAllGarbage(false); 12222 isolate->heap()->CollectAllGarbage(false);
12223 } 12223 }
12224 } 12224 }
12225 12225
12226 12226
12227 } } // namespace v8::internal 12227 } } // 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