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

Side by Side Diff: src/runtime.cc

Issue 8068026: Begin to handlify the stub cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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 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 7954 matching lines...) Expand 10 before | Expand all | Expand 10 after
7965 } 7965 }
7966 7966
7967 7967
7968 static void TrySettingInlineConstructStub(Isolate* isolate, 7968 static void TrySettingInlineConstructStub(Isolate* isolate,
7969 Handle<JSFunction> function) { 7969 Handle<JSFunction> function) {
7970 Handle<Object> prototype = isolate->factory()->null_value(); 7970 Handle<Object> prototype = isolate->factory()->null_value();
7971 if (function->has_instance_prototype()) { 7971 if (function->has_instance_prototype()) {
7972 prototype = Handle<Object>(function->instance_prototype(), isolate); 7972 prototype = Handle<Object>(function->instance_prototype(), isolate);
7973 } 7973 }
7974 if (function->shared()->CanGenerateInlineConstructor(*prototype)) { 7974 if (function->shared()->CanGenerateInlineConstructor(*prototype)) {
7975 ConstructStubCompiler compiler; 7975 HandleScope scope(isolate);
7976 ConstructStubCompiler compiler(isolate);
7976 MaybeObject* code = compiler.CompileConstructStub(*function); 7977 MaybeObject* code = compiler.CompileConstructStub(*function);
7977 if (!code->IsFailure()) { 7978 if (!code->IsFailure()) {
7978 function->shared()->set_construct_stub( 7979 function->shared()->set_construct_stub(
7979 Code::cast(code->ToObjectUnchecked())); 7980 Code::cast(code->ToObjectUnchecked()));
7980 } 7981 }
7981 } 7982 }
7982 } 7983 }
7983 7984
7984 7985
7985 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) { 7986 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) {
(...skipping 5231 matching lines...) Expand 10 before | Expand all | Expand 10 after
13217 } else { 13218 } else {
13218 // Handle last resort GC and make sure to allow future allocations 13219 // Handle last resort GC and make sure to allow future allocations
13219 // to grow the heap without causing GCs (if possible). 13220 // to grow the heap without causing GCs (if possible).
13220 isolate->counters()->gc_last_resort_from_js()->Increment(); 13221 isolate->counters()->gc_last_resort_from_js()->Increment();
13221 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); 13222 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags);
13222 } 13223 }
13223 } 13224 }
13224 13225
13225 13226
13226 } } // namespace v8::internal 13227 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698