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

Side by Side Diff: src/api.cc

Issue 258953009: Refactor calls to CALL_HEAP_FUNCTION. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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/factory.h » ('j') | src/objects.cc » ('J')
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 3565 matching lines...) Expand 10 before | Expand all | Expand 10 after
3576 return Utils::OpenHandle(this)->IsDirty(); 3576 return Utils::OpenHandle(this)->IsDirty();
3577 } 3577 }
3578 3578
3579 3579
3580 Local<v8::Object> v8::Object::Clone() { 3580 Local<v8::Object> v8::Object::Clone() {
3581 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3581 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3582 ON_BAILOUT(isolate, "v8::Object::Clone()", return Local<Object>()); 3582 ON_BAILOUT(isolate, "v8::Object::Clone()", return Local<Object>());
3583 ENTER_V8(isolate); 3583 ENTER_V8(isolate);
3584 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3584 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3585 EXCEPTION_PREAMBLE(isolate); 3585 EXCEPTION_PREAMBLE(isolate);
3586 i::Handle<i::JSObject> result = i::JSObject::Copy(self); 3586 i::Handle<i::JSObject> result = isolate->factory()->CopyJSObject(self);
3587 has_pending_exception = result.is_null(); 3587 has_pending_exception = result.is_null();
3588 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); 3588 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>());
3589 return Utils::ToLocal(result); 3589 return Utils::ToLocal(result);
3590 } 3590 }
3591 3591
3592 3592
3593 static i::Context* GetCreationContext(i::JSObject* object) { 3593 static i::Context* GetCreationContext(i::JSObject* object) {
3594 i::Object* constructor = object->map()->constructor(); 3594 i::Object* constructor = object->map()->constructor();
3595 i::JSFunction* function; 3595 i::JSFunction* function;
3596 if (!constructor->IsJSFunction()) { 3596 if (!constructor->IsJSFunction()) {
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
5790 return Local<Object>(); 5790 return Local<Object>();
5791 } 5791 }
5792 i::FixedArray* elms = i::FixedArray::cast(self->elements()); 5792 i::FixedArray* elms = i::FixedArray::cast(self->elements());
5793 i::Object* paragon = elms->get(index); 5793 i::Object* paragon = elms->get(index);
5794 if (!paragon->IsJSObject()) { 5794 if (!paragon->IsJSObject()) {
5795 return Local<Object>(); 5795 return Local<Object>();
5796 } 5796 }
5797 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); 5797 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon));
5798 EXCEPTION_PREAMBLE(isolate); 5798 EXCEPTION_PREAMBLE(isolate);
5799 ENTER_V8(isolate); 5799 ENTER_V8(isolate);
5800 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle); 5800 i::Handle<i::JSObject> result =
5801 isolate->factory()->CopyJSObject(paragon_handle);
5801 has_pending_exception = result.is_null(); 5802 has_pending_exception = result.is_null();
5802 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); 5803 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>());
5803 return Utils::ToLocal(result); 5804 return Utils::ToLocal(result);
5804 } 5805 }
5805 5806
5806 5807
5807 bool Value::IsPromise() const { 5808 bool Value::IsPromise() const {
5808 i::Handle<i::Object> val = Utils::OpenHandle(this); 5809 i::Handle<i::Object> val = Utils::OpenHandle(this);
5809 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false; 5810 if (!i::FLAG_harmony_promises || !val->IsJSObject()) return false;
5810 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val); 5811 i::Handle<i::JSObject> obj = i::Handle<i::JSObject>::cast(val);
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
7604 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7605 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7605 Address callback_address = 7606 Address callback_address =
7606 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7607 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7607 VMState<EXTERNAL> state(isolate); 7608 VMState<EXTERNAL> state(isolate);
7608 ExternalCallbackScope call_scope(isolate, callback_address); 7609 ExternalCallbackScope call_scope(isolate, callback_address);
7609 callback(info); 7610 callback(info);
7610 } 7611 }
7611 7612
7612 7613
7613 } } // namespace v8::internal 7614 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/factory.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698