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

Side by Side Diff: src/handles.cc

Issue 2123012: Allow to define accessors on objects. (Closed)
Patch Set: Last round of comments Created 10 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
« no previous file with comments | « src/handles.h ('k') | src/objects.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 } 392 }
393 CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object); 393 CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object);
394 } 394 }
395 395
396 396
397 Handle<JSObject> Copy(Handle<JSObject> obj) { 397 Handle<JSObject> Copy(Handle<JSObject> obj) {
398 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject); 398 CALL_HEAP_FUNCTION(Heap::CopyJSObject(*obj), JSObject);
399 } 399 }
400 400
401 401
402 Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info) {
403 CALL_HEAP_FUNCTION(obj->DefineAccessor(*info), Object);
404 }
405
406
402 // Wrappers for scripts are kept alive and cached in weak global 407 // Wrappers for scripts are kept alive and cached in weak global
403 // handles referred from proxy objects held by the scripts as long as 408 // handles referred from proxy objects held by the scripts as long as
404 // they are used. When they are not used anymore, the garbage 409 // they are used. When they are not used anymore, the garbage
405 // collector will call the weak callback on the global handle 410 // collector will call the weak callback on the global handle
406 // associated with the wrapper and get rid of both the wrapper and the 411 // associated with the wrapper and get rid of both the wrapper and the
407 // handle. 412 // handle.
408 static void ClearWrapperCache(Persistent<v8::Value> handle, void*) { 413 static void ClearWrapperCache(Persistent<v8::Value> handle, void*) {
409 #ifdef ENABLE_HEAP_PROTECTION 414 #ifdef ENABLE_HEAP_PROTECTION
410 // Weak reference callbacks are called as if from outside V8. We 415 // Weak reference callbacks are called as if from outside V8. We
411 // need to reeenter to unprotect the heap. 416 // need to reeenter to unprotect the heap.
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 802
798 OptimizedObjectForAddingMultipleProperties:: 803 OptimizedObjectForAddingMultipleProperties::
799 ~OptimizedObjectForAddingMultipleProperties() { 804 ~OptimizedObjectForAddingMultipleProperties() {
800 // Reoptimize the object to allow fast property access. 805 // Reoptimize the object to allow fast property access.
801 if (has_been_transformed_) { 806 if (has_been_transformed_) {
802 TransformToFastProperties(object_, unused_property_fields_); 807 TransformToFastProperties(object_, unused_property_fields_);
803 } 808 }
804 } 809 }
805 810
806 } } // namespace v8::internal 811 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/handles.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698