Created
December 10, 2011 02:16
-
-
Save ewencp/1454309 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| v8::Object::Set(obj, key, value) | |
| v8::Object* => v8::internal::JSObject** (MAKE_OPEN_HANDLE api.h, this is the external -> internal mapping, that same file also seems to have a macro for internal -> external mapping) | |
| v8::internal::SetProperty(i::Object obj, i::Object key, i::Object val, flags) | |
| implemented handles.cc:268 | |
| CALL_HEAP_FUNCTION(isolate, i::Object::SetProperty()) | |
| => JSObject inherits from JSReceiver | |
| JSReceiver::SetProperty objects.cc:1964 -> objects.cc:2619 | |
| => JSObject::SetPropertyForResult | |
| => SetNormalizedProperty ( for normal, non-global, etc) | |
| => JSObject::properties_dictionary() => JSObject::properties() | |
| defined in objects_inl.h:1183 by macro ACCESSORS | |
| These are the macros that actually access the data: | |
| ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset) | |
| #define ACCESSORS(holder, name, type, offset) \ | |
| type* holder::name() { return type::cast(READ_FIELD(this, offset)); } \ | |
| void holder::set_##name(type* value, WriteBarrierMode mode) { \ | |
| WRITE_FIELD(this, offset, value); \ | |
| CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); \ | |
| } | |
| #define READ_FIELD(p, offset) \ | |
| (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset))) | |
| #define FIELD_ADDR(p, offset) \ | |
| (reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment