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