Closed
Bug 645409
Opened 14 years ago
Closed 14 years ago
ANI: nativegen should emit synthetic C++ classes AS3 interfaces, if possible
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tamarin Graveyard
Virtual Machine
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: stejohns, Assigned: stejohns)
References
Details
Attachments
(1 file, 1 obsolete file)
75.53 KB,
patch
|
rulohani
:
review+
|
Details | Diff | Splinter Review |
the one hole in synthetic classes are AS3 Interfaces, which reduce to ScriptObject. We should try to emit wrappers for these, too, if possible.
Assignee | ||
Comment 1•14 years ago
|
||
Generate synthetic C++ classes for interfaces; these will be named with the suffix "Interface" (so AS3 "IFoo" -> C++ "IFooInterface").
Note that you can't construct interfaces (duh)... you can, however, obtain them in a couple of ways:
(1) every C++ instance class that implements an interfaces gets cheap methods to cast to the interfaces it implements, e.g.,
interface IBar { ... }
class Foo implements IBar { ... }
the C++ will have wrappers like
GCRef<IBarInterface> FooObject::as_IBarInterface(); // never returns NULL
(2) the ClassManifest provides "Class" objects for each interface; these are really just convenient placeholders to put isType/asType/coerceToType methods. e.g., for the above,
GCRef<IBarInterface> i = builtinClasses()->get_IBarClass()->coerceToType(someObj);
Attachment #548319 -
Flags: superreview?(edwsmith)
Attachment #548319 -
Flags: review?(rulohani)
Assignee | ||
Comment 2•14 years ago
|
||
This doesn't make a big difference in the avmshell codebase, but in Flash, it adds desired typesafety (where we currently have to declare things "ScriptObject", and it also paves the way for bug 634638 to be implemented more robustly (since we can implement callin wrappers for interface methods while we're here).
Assignee | ||
Comment 3•14 years ago
|
||
Minor modifications to pacify GCC 4.4+
Attachment #548319 -
Attachment is obsolete: true
Attachment #548319 -
Flags: superreview?(edwsmith)
Attachment #548319 -
Flags: review?(rulohani)
Attachment #548336 -
Flags: superreview?(edwsmith)
Attachment #548336 -
Flags: review?(rulohani)
Will this help make it possible to version interfaces? I'd dearly love to add a method to IEventDispatcher without breaking the world.
Assignee | ||
Comment 5•14 years ago
|
||
Hmm... offhand, no, I don't think it would make that easier. The best approach would probably to make an IEventDispatcher2 that extends IEventDispatcher.
Assignee | ||
Comment 6•14 years ago
|
||
pushed to TR in advance of review: 6489:8b8081a5bf83
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Attachment #548336 -
Flags: review?(rulohani) → review+
Updated•13 years ago
|
Attachment #548336 -
Flags: superreview?(edwsmith)
You need to log in
before you can comment on or make changes to this bug.
Description
•