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

Side by Side Diff: src/api.cc

Issue 22934006: Handlify JSObject::DeepCopy method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Toon Verwaest. Created 7 years, 3 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/handles.h » ('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 3950 matching lines...) Expand 10 before | Expand all | Expand 10 after
3961 return Utils::OpenHandle(this)->IsDirty(); 3961 return Utils::OpenHandle(this)->IsDirty();
3962 } 3962 }
3963 3963
3964 3964
3965 Local<v8::Object> v8::Object::Clone() { 3965 Local<v8::Object> v8::Object::Clone() {
3966 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3966 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3967 ON_BAILOUT(isolate, "v8::Object::Clone()", return Local<Object>()); 3967 ON_BAILOUT(isolate, "v8::Object::Clone()", return Local<Object>());
3968 ENTER_V8(isolate); 3968 ENTER_V8(isolate);
3969 i::Handle<i::JSObject> self = Utils::OpenHandle(this); 3969 i::Handle<i::JSObject> self = Utils::OpenHandle(this);
3970 EXCEPTION_PREAMBLE(isolate); 3970 EXCEPTION_PREAMBLE(isolate);
3971 i::Handle<i::JSObject> result = i::Copy(self); 3971 i::Handle<i::JSObject> result = i::JSObject::Copy(self);
3972 has_pending_exception = result.is_null(); 3972 has_pending_exception = result.is_null();
3973 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); 3973 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>());
3974 return Utils::ToLocal(result); 3974 return Utils::ToLocal(result);
3975 } 3975 }
3976 3976
3977 3977
3978 static i::Context* GetCreationContext(i::JSObject* object) { 3978 static i::Context* GetCreationContext(i::JSObject* object) {
3979 i::Object* constructor = object->map()->constructor(); 3979 i::Object* constructor = object->map()->constructor();
3980 i::JSFunction* function; 3980 i::JSFunction* function;
3981 if (!constructor->IsJSFunction()) { 3981 if (!constructor->IsJSFunction()) {
(...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after
6380 return Local<Object>(); 6380 return Local<Object>();
6381 } 6381 }
6382 i::FixedArray* elms = i::FixedArray::cast(self->elements()); 6382 i::FixedArray* elms = i::FixedArray::cast(self->elements());
6383 i::Object* paragon = elms->get(index); 6383 i::Object* paragon = elms->get(index);
6384 if (!paragon->IsJSObject()) { 6384 if (!paragon->IsJSObject()) {
6385 return Local<Object>(); 6385 return Local<Object>();
6386 } 6386 }
6387 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon)); 6387 i::Handle<i::JSObject> paragon_handle(i::JSObject::cast(paragon));
6388 EXCEPTION_PREAMBLE(isolate); 6388 EXCEPTION_PREAMBLE(isolate);
6389 ENTER_V8(isolate); 6389 ENTER_V8(isolate);
6390 i::Handle<i::JSObject> result = i::Copy(paragon_handle); 6390 i::Handle<i::JSObject> result = i::JSObject::Copy(paragon_handle);
6391 has_pending_exception = result.is_null(); 6391 has_pending_exception = result.is_null();
6392 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>()); 6392 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>());
6393 return Utils::ToLocal(result); 6393 return Utils::ToLocal(result);
6394 } 6394 }
6395 6395
6396 6396
6397 bool v8::ArrayBuffer::IsExternal() const { 6397 bool v8::ArrayBuffer::IsExternal() const {
6398 return Utils::OpenHandle(this)->is_external(); 6398 return Utils::OpenHandle(this)->is_external();
6399 } 6399 }
6400 6400
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
8173 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8173 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8174 Address callback_address = 8174 Address callback_address =
8175 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8175 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8176 VMState<EXTERNAL> state(isolate); 8176 VMState<EXTERNAL> state(isolate);
8177 ExternalCallbackScope call_scope(isolate, callback_address); 8177 ExternalCallbackScope call_scope(isolate, callback_address);
8178 return callback(info); 8178 return callback(info);
8179 } 8179 }
8180 8180
8181 8181
8182 } } // namespace v8::internal 8182 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698