OLD | NEW |
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 14311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14322 | 14322 |
14323 | 14323 |
14324 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyContextDisposed) { | 14324 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyContextDisposed) { |
14325 HandleScope scope(isolate); | 14325 HandleScope scope(isolate); |
14326 ASSERT(args.length() == 0); | 14326 ASSERT(args.length() == 0); |
14327 isolate->heap()->NotifyContextDisposed(); | 14327 isolate->heap()->NotifyContextDisposed(); |
14328 return isolate->heap()->undefined_value(); | 14328 return isolate->heap()->undefined_value(); |
14329 } | 14329 } |
14330 | 14330 |
14331 | 14331 |
14332 RUNTIME_FUNCTION(MaybeObject*, Runtime_MigrateInstance) { | 14332 RUNTIME_FUNCTION(MaybeObject*, Runtime_TryMigrateInstance) { |
14333 HandleScope scope(isolate); | 14333 HandleScope scope(isolate); |
14334 ASSERT(args.length() == 1); | 14334 ASSERT(args.length() == 1); |
14335 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); | 14335 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); |
14336 if (!object->IsJSObject()) return Smi::FromInt(0); | 14336 if (!object->IsJSObject()) return Smi::FromInt(0); |
14337 Handle<JSObject> js_object = Handle<JSObject>::cast(object); | 14337 Handle<JSObject> js_object = Handle<JSObject>::cast(object); |
14338 if (!js_object->map()->is_deprecated()) return Smi::FromInt(0); | 14338 if (!js_object->map()->is_deprecated()) return Smi::FromInt(0); |
14339 JSObject::MigrateInstance(js_object); | 14339 // This call must not cause lazy deopts, because it's called from deferred |
| 14340 // code where we can't handle lazy deopts for lack of a suitable bailout |
| 14341 // ID. So we just try migration and signal failure if necessary, |
| 14342 // which will also trigger a deopt. |
| 14343 Handle<Object> result = JSObject::TryMigrateInstance(js_object); |
| 14344 if (result.is_null()) return Smi::FromInt(0); |
14340 return *object; | 14345 return *object; |
14341 } | 14346 } |
14342 | 14347 |
14343 | 14348 |
14344 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFromCache) { | 14349 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFromCache) { |
14345 SealHandleScope shs(isolate); | 14350 SealHandleScope shs(isolate); |
14346 // This is only called from codegen, so checks might be more lax. | 14351 // This is only called from codegen, so checks might be more lax. |
14347 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); | 14352 CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0); |
14348 Object* key = args[1]; | 14353 Object* key = args[1]; |
14349 | 14354 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14884 // Handle last resort GC and make sure to allow future allocations | 14889 // Handle last resort GC and make sure to allow future allocations |
14885 // to grow the heap without causing GCs (if possible). | 14890 // to grow the heap without causing GCs (if possible). |
14886 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14891 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14887 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14892 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14888 "Runtime::PerformGC"); | 14893 "Runtime::PerformGC"); |
14889 } | 14894 } |
14890 } | 14895 } |
14891 | 14896 |
14892 | 14897 |
14893 } } // namespace v8::internal | 14898 } } // namespace v8::internal |
OLD | NEW |