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

Side by Side Diff: src/api.cc

Issue 206163004: Ship promises and weak collections (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | src/bootstrapper.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 5804 matching lines...) Expand 10 before | Expand all | Expand 10 after
5815 ENTER_V8(isolate); 5815 ENTER_V8(isolate);
5816 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle); 5816 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle);
5817 has_pending_exception = result.is_null(); 5817 has_pending_exception = result.is_null();
5818 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); 5818 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>());
5819 return Utils::ToLocal(result); 5819 return Utils::ToLocal(result);
5820 } 5820 }
5821 5821
5822 5822
5823 bool Value::IsPromise() const { 5823 bool Value::IsPromise() const {
5824 i::Handle<i::Object> val = Utils::OpenHandle(this); 5824 i::Handle<i::Object> val = Utils::OpenHandle(this);
5825 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false; 5825 if (!val->IsJSObject()) return false;
5826 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); 5826 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val);
5827 i::Isolate* isolate = obj->GetIsolate(); 5827 i::Isolate* isolate = obj->GetIsolate();
5828 LOG_API(isolate, "IsPromise"); 5828 LOG_API(isolate, "IsPromise");
5829 ENTER_V8(isolate); 5829 ENTER_V8(isolate);
5830 EXCEPTION_PREAMBLE(isolate); 5830 EXCEPTION_PREAMBLE(isolate);
5831 i::Handle<i::Object> argv[] = { obj }; 5831 i::Handle<i::Object> argv[] = { obj };
5832 i::Handle<i::Object> b = i::Execution::Call( 5832 i::Handle<i::Object> b = i::Execution::Call(
5833 isolate, 5833 isolate,
5834 handle( 5834 handle(
5835 isolate->context()->global_object()->native_context()->is_promise()), 5835 isolate->context()->global_object()->native_context()->is_promise()),
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after
7576 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7576 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7577 Address callback_address = 7577 Address callback_address =
7578 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7578 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7579 VMState<EXTERNAL> state(isolate); 7579 VMState<EXTERNAL> state(isolate);
7580 ExternalCallbackScope call_scope(isolate, callback_address); 7580 ExternalCallbackScope call_scope(isolate, callback_address);
7581 callback(info); 7581 callback(info);
7582 } 7582 }
7583 7583
7584 7584
7585 } } // namespace v8::internal 7585 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698