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

Side by Side Diff: src/runtime.cc

Issue 64223010: Harmony promises (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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
« src/runtime.h ('K') | « src/runtime.h ('k') | src/v8.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14599 matching lines...) Expand 10 before | Expand all | Expand 10 after
14610 return isolate->heap()->undefined_value(); 14610 return isolate->heap()->undefined_value();
14611 14611
14612 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() && 14612 ASSERT(!(obj->map()->is_observed() && obj->IsJSObject() &&
14613 Handle<JSObject>::cast(obj)->HasFastElements())); 14613 Handle<JSObject>::cast(obj)->HasFastElements()));
14614 ASSERT(obj->IsJSObject()); 14614 ASSERT(obj->IsJSObject());
14615 JSObject::SetObserved(Handle<JSObject>::cast(obj)); 14615 JSObject::SetObserved(Handle<JSObject>::cast(obj));
14616 return isolate->heap()->undefined_value(); 14616 return isolate->heap()->undefined_value();
14617 } 14617 }
14618 14618
14619 14619
14620 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) { 14620 // For testing only.
14621 RUNTIME_FUNCTION(MaybeObject*, Runtime_FailHard) {
Michael Starzinger 2013/11/15 09:37:20 This is similar to the existing Runtime_Abort, can
rossberg 2013/11/15 10:00:58 Done.
14622 HandleScope scope(isolate);
14623 ASSERT(args.length() == 1);
14624 CONVERT_ARG_HANDLE_CHECKED(String, message, 0);
14625 PrintF("%s\n", *message->ToCString());
14626 CHECK(!"FailHard");
14627 return isolate->heap()->undefined_value();
14628 }
14629
14630
14631 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetMicrotasksPending) {
14621 SealHandleScope shs(isolate); 14632 SealHandleScope shs(isolate);
14622 ASSERT(args.length() == 0); 14633 ASSERT(args.length() == 1);
14623 isolate->set_observer_delivery_pending(true); 14634 CONVERT_BOOLEAN_ARG_CHECKED(new_state, 0);
14624 return isolate->heap()->undefined_value(); 14635 bool old_state = isolate->microtasks_pending();
14636 isolate->set_microtasks_pending(new_state);
14637 return isolate->heap()->ToBoolean(old_state);
14625 } 14638 }
14626 14639
14627 14640
14628 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObservationState) { 14641 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObservationState) {
14629 SealHandleScope shs(isolate); 14642 SealHandleScope shs(isolate);
14630 ASSERT(args.length() == 0); 14643 ASSERT(args.length() == 0);
14631 return isolate->heap()->observation_state(); 14644 return isolate->heap()->observation_state();
14632 } 14645 }
14633 14646
14634 14647
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
14878 // Handle last resort GC and make sure to allow future allocations 14891 // Handle last resort GC and make sure to allow future allocations
14879 // to grow the heap without causing GCs (if possible). 14892 // to grow the heap without causing GCs (if possible).
14880 isolate->counters()->gc_last_resort_from_js()->Increment(); 14893 isolate->counters()->gc_last_resort_from_js()->Increment();
14881 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14894 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14882 "Runtime::PerformGC"); 14895 "Runtime::PerformGC");
14883 } 14896 }
14884 } 14897 }
14885 14898
14886 14899
14887 } } // namespace v8::internal 14900 } } // namespace v8::internal
OLDNEW
« src/runtime.h ('K') | « src/runtime.h ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698