OLD | NEW |
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 Handle<String> SubString(Handle<String> str, | 288 Handle<String> SubString(Handle<String> str, |
289 int start, | 289 int start, |
290 int end, | 290 int end, |
291 PretenureFlag pretenure) { | 291 PretenureFlag pretenure) { |
292 CALL_HEAP_FUNCTION(str->GetIsolate(), | 292 CALL_HEAP_FUNCTION(str->GetIsolate(), |
293 str->SubString(start, end, pretenure), String); | 293 str->SubString(start, end, pretenure), String); |
294 } | 294 } |
295 | 295 |
296 | 296 |
| 297 Handle<JSObject> Copy(Handle<JSObject> obj) { |
| 298 Isolate* isolate = obj->GetIsolate(); |
| 299 CALL_HEAP_FUNCTION(isolate, |
| 300 isolate->heap()->CopyJSObject(*obj), JSObject); |
| 301 } |
| 302 |
| 303 |
| 304 Handle<JSObject> DeepCopy(Handle<JSObject> obj) { |
| 305 Isolate* isolate = obj->GetIsolate(); |
| 306 CALL_HEAP_FUNCTION(isolate, |
| 307 obj->DeepCopy(isolate), |
| 308 JSObject); |
| 309 } |
| 310 |
| 311 |
297 // Wrappers for scripts are kept alive and cached in weak global | 312 // Wrappers for scripts are kept alive and cached in weak global |
298 // handles referred from foreign objects held by the scripts as long as | 313 // handles referred from foreign objects held by the scripts as long as |
299 // they are used. When they are not used anymore, the garbage | 314 // they are used. When they are not used anymore, the garbage |
300 // collector will call the weak callback on the global handle | 315 // collector will call the weak callback on the global handle |
301 // associated with the wrapper and get rid of both the wrapper and the | 316 // associated with the wrapper and get rid of both the wrapper and the |
302 // handle. | 317 // handle. |
303 static void ClearWrapperCache(v8::Isolate* v8_isolate, | 318 static void ClearWrapperCache(v8::Isolate* v8_isolate, |
304 Persistent<v8::Value>* handle, | 319 Persistent<v8::Value>* handle, |
305 void*) { | 320 void*) { |
306 Handle<Object> cache = Utils::OpenPersistent(handle); | 321 Handle<Object> cache = Utils::OpenPersistent(handle); |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 data->next = prev_next_; | 899 data->next = prev_next_; |
885 data->limit = prev_limit_; | 900 data->limit = prev_limit_; |
886 #ifdef DEBUG | 901 #ifdef DEBUG |
887 handles_detached_ = true; | 902 handles_detached_ = true; |
888 #endif | 903 #endif |
889 return deferred; | 904 return deferred; |
890 } | 905 } |
891 | 906 |
892 | 907 |
893 } } // namespace v8::internal | 908 } } // namespace v8::internal |
OLD | NEW |