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

Side by Side Diff: src/runtime.cc

Issue 22562002: Convert FastNewClosureStub into hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 4 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 7899 matching lines...) Expand 10 before | Expand all | Expand 10 after
7910 WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc); 7910 WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc);
7911 for (int i = 0; i < length; i++) { 7911 for (int i = 0; i < length; i++) {
7912 array->set(i, *--parameters, mode); 7912 array->set(i, *--parameters, mode);
7913 } 7913 }
7914 JSObject::cast(result)->set_elements(FixedArray::cast(obj)); 7914 JSObject::cast(result)->set_elements(FixedArray::cast(obj));
7915 } 7915 }
7916 return result; 7916 return result;
7917 } 7917 }
7918 7918
7919 7919
7920 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewClosureBailout) {
7921 HandleScope scope(isolate);
7922 ASSERT(args.length() == 1);
7923 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0);
7924 Handle<Context> context(isolate->context());
7925
7926 // The caller ensures that we pretenure closures that are assigned
7927 // directly to properties.
7928 PretenureFlag pretenure_flag = NOT_TENURED;
7929 Handle<JSFunction> result =
7930 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared,
7931 context,
7932 pretenure_flag);
7933 return *result;
7934 }
7935
7936
7920 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewClosure) { 7937 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewClosure) {
7921 HandleScope scope(isolate); 7938 HandleScope scope(isolate);
7922 ASSERT(args.length() == 3); 7939 ASSERT(args.length() == 3);
7923 CONVERT_ARG_HANDLE_CHECKED(Context, context, 0); 7940 CONVERT_ARG_HANDLE_CHECKED(Context, context, 0);
7924 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 1); 7941 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 1);
7925 CONVERT_BOOLEAN_ARG_CHECKED(pretenure, 2); 7942 CONVERT_BOOLEAN_ARG_CHECKED(pretenure, 2);
7926 7943
7927 // The caller ensures that we pretenure closures that are assigned 7944 // The caller ensures that we pretenure closures that are assigned
7928 // directly to properties. 7945 // directly to properties.
7929 PretenureFlag pretenure_flag = pretenure ? TENURED : NOT_TENURED; 7946 PretenureFlag pretenure_flag = pretenure ? TENURED : NOT_TENURED;
(...skipping 6474 matching lines...) Expand 10 before | Expand all | Expand 10 after
14404 // Handle last resort GC and make sure to allow future allocations 14421 // Handle last resort GC and make sure to allow future allocations
14405 // to grow the heap without causing GCs (if possible). 14422 // to grow the heap without causing GCs (if possible).
14406 isolate->counters()->gc_last_resort_from_js()->Increment(); 14423 isolate->counters()->gc_last_resort_from_js()->Increment();
14407 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14424 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14408 "Runtime::PerformGC"); 14425 "Runtime::PerformGC");
14409 } 14426 }
14410 } 14427 }
14411 14428
14412 14429
14413 } } // namespace v8::internal 14430 } } // namespace v8::internal
OLDNEW
« src/code-stubs-hydrogen.cc ('K') | « src/runtime.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698