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

Side by Side Diff: src/runtime.cc

Issue 268063008: Replace NewFunctionWithPrototype(name, prototype) by NewFunction(name) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/factory.cc ('k') | test/cctest/test-alloc.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "accessors.h" 10 #include "accessors.h"
(...skipping 2780 matching lines...) Expand 10 before | Expand all | Expand 10 after
2791 return Smi::FromInt(0); 2791 return Smi::FromInt(0);
2792 } 2792 }
2793 2793
2794 2794
2795 static Handle<JSFunction> InstallBuiltin(Isolate* isolate, 2795 static Handle<JSFunction> InstallBuiltin(Isolate* isolate,
2796 Handle<JSObject> holder, 2796 Handle<JSObject> holder,
2797 const char* name, 2797 const char* name,
2798 Builtins::Name builtin_name) { 2798 Builtins::Name builtin_name) {
2799 Handle<String> key = isolate->factory()->InternalizeUtf8String(name); 2799 Handle<String> key = isolate->factory()->InternalizeUtf8String(name);
2800 Handle<Code> code(isolate->builtins()->builtin(builtin_name)); 2800 Handle<Code> code(isolate->builtins()->builtin(builtin_name));
2801 Handle<JSFunction> optimized = 2801 Handle<JSFunction> optimized = isolate->factory()->NewFunction(
2802 isolate->factory()->NewFunction(MaybeHandle<Object>(), 2802 key, MaybeHandle<Object>(), code);
2803 key,
2804 JS_OBJECT_TYPE,
2805 JSObject::kHeaderSize,
2806 code,
2807 false);
2808 optimized->shared()->DontAdaptArguments(); 2803 optimized->shared()->DontAdaptArguments();
2809 JSReceiver::SetProperty(holder, key, optimized, NONE, STRICT).Assert(); 2804 JSReceiver::SetProperty(holder, key, optimized, NONE, STRICT).Assert();
2810 return optimized; 2805 return optimized;
2811 } 2806 }
2812 2807
2813 2808
2814 RUNTIME_FUNCTION(Runtime_SpecialArrayFunctions) { 2809 RUNTIME_FUNCTION(Runtime_SpecialArrayFunctions) {
2815 HandleScope scope(isolate); 2810 HandleScope scope(isolate);
2816 ASSERT(args.length() == 1); 2811 ASSERT(args.length() == 1);
2817 CONVERT_ARG_HANDLE_CHECKED(JSObject, holder, 0); 2812 CONVERT_ARG_HANDLE_CHECKED(JSObject, holder, 0);
(...skipping 12422 matching lines...) Expand 10 before | Expand all | Expand 10 after
15240 } 15235 }
15241 return NULL; 15236 return NULL;
15242 } 15237 }
15243 15238
15244 15239
15245 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15240 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15246 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15241 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15247 } 15242 }
15248 15243
15249 } } // namespace v8::internal 15244 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | test/cctest/test-alloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698