| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 CALL_HEAP_FUNCTION(isolate, | 529 CALL_HEAP_FUNCTION(isolate, |
| 530 isolate->heap()->CopyJSObject(*obj), JSObject); | 530 isolate->heap()->CopyJSObject(*obj), JSObject); |
| 531 } | 531 } |
| 532 | 532 |
| 533 | 533 |
| 534 Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info) { | 534 Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info) { |
| 535 CALL_HEAP_FUNCTION(obj->GetIsolate(), obj->DefineAccessor(*info), Object); | 535 CALL_HEAP_FUNCTION(obj->GetIsolate(), obj->DefineAccessor(*info), Object); |
| 536 } | 536 } |
| 537 | 537 |
| 538 | 538 |
| 539 Handle<Object> SetAccessor(Handle<JSObject> obj, |
| 540 Handle<String> key, |
| 541 bool is_getter, |
| 542 Handle<Object> fun, |
| 543 PropertyAttributes attributes) { |
| 544 CALL_HEAP_FUNCTION(obj->GetIsolate(), |
| 545 obj->DefineAccessor(*key, is_getter, *fun, attributes), |
| 546 Object); |
| 547 } |
| 548 |
| 549 |
| 550 Handle<Object> GetAccessor(Handle<JSObject> obj, |
| 551 Handle<String> key, |
| 552 bool is_getter) { |
| 553 CALL_HEAP_FUNCTION(obj->GetIsolate(), |
| 554 obj->LookupAccessor(*key, is_getter), |
| 555 Object); |
| 556 } |
| 557 |
| 558 |
| 539 // Wrappers for scripts are kept alive and cached in weak global | 559 // Wrappers for scripts are kept alive and cached in weak global |
| 540 // handles referred from foreign objects held by the scripts as long as | 560 // handles referred from foreign objects held by the scripts as long as |
| 541 // they are used. When they are not used anymore, the garbage | 561 // they are used. When they are not used anymore, the garbage |
| 542 // collector will call the weak callback on the global handle | 562 // collector will call the weak callback on the global handle |
| 543 // associated with the wrapper and get rid of both the wrapper and the | 563 // associated with the wrapper and get rid of both the wrapper and the |
| 544 // handle. | 564 // handle. |
| 545 static void ClearWrapperCache(Persistent<v8::Value> handle, void*) { | 565 static void ClearWrapperCache(Persistent<v8::Value> handle, void*) { |
| 546 #ifdef ENABLE_HEAP_PROTECTION | 566 #ifdef ENABLE_HEAP_PROTECTION |
| 547 // Weak reference callbacks are called as if from outside V8. We | 567 // Weak reference callbacks are called as if from outside V8. We |
| 548 // need to reeenter to unprotect the heap. | 568 // need to reeenter to unprotect the heap. |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 | 991 |
| 972 bool CompileOptimized(Handle<JSFunction> function, | 992 bool CompileOptimized(Handle<JSFunction> function, |
| 973 int osr_ast_id, | 993 int osr_ast_id, |
| 974 ClearExceptionFlag flag) { | 994 ClearExceptionFlag flag) { |
| 975 CompilationInfo info(function); | 995 CompilationInfo info(function); |
| 976 info.SetOptimizing(osr_ast_id); | 996 info.SetOptimizing(osr_ast_id); |
| 977 return CompileLazyHelper(&info, flag); | 997 return CompileLazyHelper(&info, flag); |
| 978 } | 998 } |
| 979 | 999 |
| 980 } } // namespace v8::internal | 1000 } } // namespace v8::internal |
| OLD | NEW |