| OLD | NEW |
| 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 8051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8062 } | 8062 } |
| 8063 | 8063 |
| 8064 | 8064 |
| 8065 static void TrySettingInlineConstructStub(Isolate* isolate, | 8065 static void TrySettingInlineConstructStub(Isolate* isolate, |
| 8066 Handle<JSFunction> function) { | 8066 Handle<JSFunction> function) { |
| 8067 Handle<Object> prototype = isolate->factory()->null_value(); | 8067 Handle<Object> prototype = isolate->factory()->null_value(); |
| 8068 if (function->has_instance_prototype()) { | 8068 if (function->has_instance_prototype()) { |
| 8069 prototype = Handle<Object>(function->instance_prototype(), isolate); | 8069 prototype = Handle<Object>(function->instance_prototype(), isolate); |
| 8070 } | 8070 } |
| 8071 if (function->shared()->CanGenerateInlineConstructor(*prototype)) { | 8071 if (function->shared()->CanGenerateInlineConstructor(*prototype)) { |
| 8072 ConstructStubCompiler compiler; | 8072 HandleScope scope(isolate); |
| 8073 ConstructStubCompiler compiler(isolate); |
| 8073 MaybeObject* code = compiler.CompileConstructStub(*function); | 8074 MaybeObject* code = compiler.CompileConstructStub(*function); |
| 8074 if (!code->IsFailure()) { | 8075 if (!code->IsFailure()) { |
| 8075 function->shared()->set_construct_stub( | 8076 function->shared()->set_construct_stub( |
| 8076 Code::cast(code->ToObjectUnchecked())); | 8077 Code::cast(code->ToObjectUnchecked())); |
| 8077 } | 8078 } |
| 8078 } | 8079 } |
| 8079 } | 8080 } |
| 8080 | 8081 |
| 8081 | 8082 |
| 8082 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) { | 8083 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) { |
| (...skipping 5328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13411 } else { | 13412 } else { |
| 13412 // Handle last resort GC and make sure to allow future allocations | 13413 // Handle last resort GC and make sure to allow future allocations |
| 13413 // to grow the heap without causing GCs (if possible). | 13414 // to grow the heap without causing GCs (if possible). |
| 13414 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13415 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13415 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13416 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
| 13416 } | 13417 } |
| 13417 } | 13418 } |
| 13418 | 13419 |
| 13419 | 13420 |
| 13420 } } // namespace v8::internal | 13421 } } // namespace v8::internal |
| OLD | NEW |