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 14307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14318 ASSERT(args.length() == 2); | 14318 ASSERT(args.length() == 2); |
14319 OS::PrintError("abort: %s\n", | 14319 OS::PrintError("abort: %s\n", |
14320 reinterpret_cast<char*>(args[0]) + args.smi_at(1)); | 14320 reinterpret_cast<char*>(args[0]) + args.smi_at(1)); |
14321 isolate->PrintStack(stderr); | 14321 isolate->PrintStack(stderr); |
14322 OS::Abort(); | 14322 OS::Abort(); |
14323 UNREACHABLE(); | 14323 UNREACHABLE(); |
14324 return NULL; | 14324 return NULL; |
14325 } | 14325 } |
14326 | 14326 |
14327 | 14327 |
| 14328 RUNTIME_FUNCTION(MaybeObject*, Runtime_AbortJS) { |
| 14329 HandleScope scope(isolate); |
| 14330 ASSERT(args.length() == 1); |
| 14331 CONVERT_ARG_HANDLE_CHECKED(String, message, 0); |
| 14332 OS::PrintError("abort: %s\n", *message->ToCString()); |
| 14333 isolate->PrintStack(stderr); |
| 14334 OS::Abort(); |
| 14335 UNREACHABLE(); |
| 14336 return NULL; |
| 14337 } |
| 14338 |
| 14339 |
14328 RUNTIME_FUNCTION(MaybeObject*, Runtime_FlattenString) { | 14340 RUNTIME_FUNCTION(MaybeObject*, Runtime_FlattenString) { |
14329 HandleScope scope(isolate); | 14341 HandleScope scope(isolate); |
14330 ASSERT(args.length() == 1); | 14342 ASSERT(args.length() == 1); |
14331 CONVERT_ARG_HANDLE_CHECKED(String, str, 0); | 14343 CONVERT_ARG_HANDLE_CHECKED(String, str, 0); |
14332 FlattenString(str); | 14344 FlattenString(str); |
14333 return isolate->heap()->undefined_value(); | 14345 return isolate->heap()->undefined_value(); |
14334 } | 14346 } |
14335 | 14347 |
14336 | 14348 |
14337 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyContextDisposed) { | 14349 RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyContextDisposed) { |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14610 return isolate->heap()->undefined_value(); | 14622 return isolate->heap()->undefined_value(); |
14611 | 14623 |
14612 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() && | 14624 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() && |
14613 Handle<JSObject>::cast(obj)->HasFastElements())); | 14625 Handle<JSObject>::cast(obj)->HasFastElements())); |
14614 ASSERT(obj->IsJSObject()); | 14626 ASSERT(obj->IsJSObject()); |
14615 JSObject::SetObserved(Handle<JSObject>::cast(obj)); | 14627 JSObject::SetObserved(Handle<JSObject>::cast(obj)); |
14616 return isolate->heap()->undefined_value(); | 14628 return isolate->heap()->undefined_value(); |
14617 } | 14629 } |
14618 | 14630 |
14619 | 14631 |
14620 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) { | 14632 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetMicrotasksPending) { |
14621 SealHandleScope shs(isolate); | 14633 SealHandleScope shs(isolate); |
14622 ASSERT(args.length() == 0); | 14634 ASSERT(args.length() == 1); |
14623 isolate->set_observer_delivery_pending(true); | 14635 CONVERT_BOOLEAN_ARG_CHECKED(new_state, 0); |
14624 return isolate->heap()->undefined_value(); | 14636 bool old_state = isolate->microtasks_pending(); |
| 14637 isolate->set_microtasks_pending(new_state); |
| 14638 return isolate->heap()->ToBoolean(old_state); |
14625 } | 14639 } |
14626 | 14640 |
14627 | 14641 |
14628 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObservationState) { | 14642 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObservationState) { |
14629 SealHandleScope shs(isolate); | 14643 SealHandleScope shs(isolate); |
14630 ASSERT(args.length() == 0); | 14644 ASSERT(args.length() == 0); |
14631 return isolate->heap()->observation_state(); | 14645 return isolate->heap()->observation_state(); |
14632 } | 14646 } |
14633 | 14647 |
14634 | 14648 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14878 // Handle last resort GC and make sure to allow future allocations | 14892 // Handle last resort GC and make sure to allow future allocations |
14879 // to grow the heap without causing GCs (if possible). | 14893 // to grow the heap without causing GCs (if possible). |
14880 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14894 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14881 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14895 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14882 "Runtime::PerformGC"); | 14896 "Runtime::PerformGC"); |
14883 } | 14897 } |
14884 } | 14898 } |
14885 | 14899 |
14886 | 14900 |
14887 } } // namespace v8::internal | 14901 } } // namespace v8::internal |
OLD | NEW |