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

Side by Side Diff: src/runtime.cc

Issue 99573002: Promises: some adaptations to spec (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Throw on non-function resolver Created 6 years, 11 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 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 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after
2656 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); 2656 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift);
2657 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); 2657 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift);
2658 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); 2658 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice);
2659 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); 2659 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice);
2660 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat); 2660 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat);
2661 2661
2662 return *holder; 2662 return *holder;
2663 } 2663 }
2664 2664
2665 2665
2666 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsCallable) {
2667 SealHandleScope shs(isolate);
2668 ASSERT(args.length() == 1);
2669 CONVERT_ARG_CHECKED(Object, obj, 0);
2670 return isolate->heap()->ToBoolean(obj->IsCallable());
2671 }
2672
2673
2674 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsClassicModeFunction) { 2666 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsClassicModeFunction) {
2675 SealHandleScope shs(isolate); 2667 SealHandleScope shs(isolate);
2676 ASSERT(args.length() == 1); 2668 ASSERT(args.length() == 1);
2677 CONVERT_ARG_CHECKED(JSReceiver, callable, 0); 2669 CONVERT_ARG_CHECKED(JSReceiver, callable, 0);
2678 if (!callable->IsJSFunction()) { 2670 if (!callable->IsJSFunction()) {
2679 HandleScope scope(isolate); 2671 HandleScope scope(isolate);
2680 bool threw = false; 2672 bool threw = false;
2681 Handle<Object> delegate = Execution::TryGetFunctionDelegate( 2673 Handle<Object> delegate = Execution::TryGetFunctionDelegate(
2682 isolate, Handle<JSReceiver>(callable), &threw); 2674 isolate, Handle<JSReceiver>(callable), &threw);
2683 if (threw) return Failure::Exception(); 2675 if (threw) return Failure::Exception();
(...skipping 12231 matching lines...) Expand 10 before | Expand all | Expand 10 after
14915 // Handle last resort GC and make sure to allow future allocations 14907 // Handle last resort GC and make sure to allow future allocations
14916 // to grow the heap without causing GCs (if possible). 14908 // to grow the heap without causing GCs (if possible).
14917 isolate->counters()->gc_last_resort_from_js()->Increment(); 14909 isolate->counters()->gc_last_resort_from_js()->Increment();
14918 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14910 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14919 "Runtime::PerformGC"); 14911 "Runtime::PerformGC");
14920 } 14912 }
14921 } 14913 }
14922 14914
14923 14915
14924 } } // namespace v8::internal 14916 } } // namespace v8::internal
OLDNEW
« src/promise.js ('K') | « src/runtime.h ('k') | test/mjsunit/harmony/promises.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698