I spent a few hours last night experimenting with the arguments object in v8, and trying to come up with some modifications in the IR code generation to emulate v8's behavior, but it seems not to be the right approach to this problem. I've discovered that the association between the arguments object and the formal parameter names is somewhat tricky to implement. Namely, you can pass the arguments object to sub-functions, and modifications to it will be reflected in the formal parameters, but you can also modify formal parameter values in closures, and this will modify the arguments object.
It seems like the proper way to implement this would be through a code transformation. The arguments object should be assigned to a fresh temporary, and references to formal parameters should be transformed into references to indices in that object, even in nested functions. As an example:
Original code: -------------------------
function foo(a0, a1, a2) { function bar() { a0 = 5; }
function bif() { delete a0; }
bar();
print(arguments[0]);
bif();
print(arguments[0]); print(a0); }
foo();
Output: -------------------------
5 undefined undefined
Transformed code: -------------------------
function foo(a0, a1, a2) { var argsObj = arguments;
function bar() { argsObj[0] = 5; }
function bif() { delete argsObj[0] }
bar();
print(arguments[0]);
bif();
print(arguments[0]); print(argsObj[0]); }
foo();
Seeing Marc is busy, I will try to implement this myself. I need to be able to generate a "fresh" name that can't be accessed by the user (even through eval) for the arguments object alias. For this, I was thinking of prefixing the name with an illegal JS token, such as # or @.
- Maxime
On 10-08-07 11:24 AM, chevalma@iro.umontreal.ca wrote:
This would involve giving an oral presentation at a workshop? Out of curiosity, does that count as a peer-reviewed publication?
I think this is probably a good venue to present our project at. It's also conveniently close.
- Maxime
This would be a good workshop to present the Tachyon project. Let's talk about it at the next meeting (August 16).
Marc
Begin forwarded message:
From: clark verbruggeclump@cs.mcgill.ca Date: August 6, 2010 3:06:48 PM PDT To: undisclosed-recipients:; Subject: 9th Compiler-Driven Performance Workshop - CASCON 2010
9th Compiler-Driven Performance Workshop November 4, 2010 (Thursday) Hilton Suites Toronto/Markham Conference Centre Associated with CASCON 2010 (http://www.cas.ibm.com/cascon) (Nov 1-4 2010)
Dear Colleague:
We would like to invite you to participate in the 9th Compiler-Driven Performance Workshop (CDP10) which will be held during the IBM Center for Advanced Studies Conference (CASCON) 2010 in Markham, Ontario, Canada.
In the past seven years we had very successful one-day events in which faculty members, students and practitioners presented their recent work and research plans.
Topics to be discussed in the workshop include, but are not limited to:
innovative analysis, transformation, and optimization techniques
languages, compilers, and optimization techniques for multicore
processors and other parallel architectures
compiling for streaming or heterogeneous hardware
dynamic compilation for high-performance and real-time environments
compilation and optimization for scripting languages
compilation techniques for reducing power
tools and infrastructure for compiler research
SUBMISSION:
NO LATER THAN WEDNESDAY AUGUST 24, we would like to hear from you if you ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ would like to give a talk about your research or to volunteer a student to do so. Please send, by email to clump@cs.mcgill.ca, your talk title, the author list, the name of the speaker, and a brief abstract.
Please note that the number of presentation slots is quite limited. Once we have a list of title/speakers, we will let you know if your presentation has been selected.
CDP does not publish proceedings. Presenters are required to provide an electronic copy of their slides. The slides will be available on a website soon after the workshop.
CASCON has a very well organized exhibit section that is an excellent forum to display students' current work and allow for discussions. We would like to suggest that you encourage some of your students to participate in the exhibit section.
We also would like to encourage all participants to gather during the lunch and coffee breaks for more informal interactions. The workshop does not have funds to defray the travel/lodging costs for participants/speakers. However registration for CASCON is free, and lunch is provided to all attendees.
We look forward to your participation in CDP10!
Steering Committee: Kit Barton - IBM Toronto Lab David Grove - IBM Watson Ondrej Lhotak - University of Waterloo J. Gregory Steffan - University of Toronto Mark Stoodley - IBM Toronto Lab Clark Verbrugge - McGill University
-- ttfn, clark clump@cs.mcgill.ca
Tachyon-list mailing list Tachyon-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/tachyon-list
Tachyon-list mailing list Tachyon-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/tachyon-list