Chromium Code Reviews

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, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | 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 7933 matching lines...)
7944 WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc); 7944 WriteBarrierMode mode = array->GetWriteBarrierMode(no_gc);
7945 for (int i = 0; i < length; i++) { 7945 for (int i = 0; i < length; i++) {
7946 array->set(i, *--parameters, mode); 7946 array->set(i, *--parameters, mode);
7947 } 7947 }
7948 JSObject::cast(result)->set_elements(FixedArray::cast(obj)); 7948 JSObject::cast(result)->set_elements(FixedArray::cast(obj));
7949 } 7949 }
7950 return result; 7950 return result;
7951 } 7951 }
7952 7952
7953 7953
7954 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewClosureBailout) {
7955 HandleScope scope(isolate);
7956 ASSERT(args.length() == 1);
7957 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 0);
7958 Handle<Context> context(isolate->context());
7959
7960 // The caller ensures that we pretenure closures that are assigned
7961 // directly to properties.
Michael Starzinger 2013/08/27 08:12:51 nit: Comment does not apply, lets just drop it.
mvstanton 2013/08/27 09:23:04 Done.
7962 PretenureFlag pretenure_flag = NOT_TENURED;
7963 Handle<JSFunction> result =
7964 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared,
7965 context,
7966 pretenure_flag);
7967 return *result;
7968 }
7969
7970
7954 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewClosure) { 7971 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewClosure) {
7955 HandleScope scope(isolate); 7972 HandleScope scope(isolate);
7956 ASSERT(args.length() == 3); 7973 ASSERT(args.length() == 3);
7957 CONVERT_ARG_HANDLE_CHECKED(Context, context, 0); 7974 CONVERT_ARG_HANDLE_CHECKED(Context, context, 0);
7958 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 1); 7975 CONVERT_ARG_HANDLE_CHECKED(SharedFunctionInfo, shared, 1);
7959 CONVERT_BOOLEAN_ARG_CHECKED(pretenure, 2); 7976 CONVERT_BOOLEAN_ARG_CHECKED(pretenure, 2);
7960 7977
7961 // The caller ensures that we pretenure closures that are assigned 7978 // The caller ensures that we pretenure closures that are assigned
7962 // directly to properties. 7979 // directly to properties.
7963 PretenureFlag pretenure_flag = pretenure ? TENURED : NOT_TENURED; 7980 PretenureFlag pretenure_flag = pretenure ? TENURED : NOT_TENURED;
(...skipping 6709 matching lines...)
14673 // Handle last resort GC and make sure to allow future allocations 14690 // Handle last resort GC and make sure to allow future allocations
14674 // to grow the heap without causing GCs (if possible). 14691 // to grow the heap without causing GCs (if possible).
14675 isolate->counters()->gc_last_resort_from_js()->Increment(); 14692 isolate->counters()->gc_last_resort_from_js()->Increment();
14676 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14693 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14677 "Runtime::PerformGC"); 14694 "Runtime::PerformGC");
14678 } 14695 }
14679 } 14696 }
14680 14697
14681 14698
14682 } } // namespace v8::internal 14699 } } // namespace v8::internal
OLDNEW
« src/runtime.h ('K') | « src/runtime.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine