Last Comment Bug 347065 - Can not compile without JS_HAS_GENERATORS
: Can not compile without JS_HAS_GENERATORS
Status: RESOLVED FIXED
: fixed1.8.1.1
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Igor Bukanov
:
:
Mentors:
Depends on:
Blocks: js1.7 js1.7src
  Show dependency treegraph
 
Reported: 2006-08-02 15:17 PDT by Igor Bukanov
Modified: 2006-11-27 00:37 PST (History)
3 users (show)
dveditz: blocking1.8.1.1+
bob: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Implementation v0 (5.79 KB, patch)
2006-09-19 15:48 PDT, Igor Bukanov
no flags Details | Diff | Splinter Review
Implementation v1 (3.95 KB, patch)
2006-09-19 15:57 PDT, Igor Bukanov
no flags Details | Diff | Splinter Review
Implementation v1b (4.01 KB, patch)
2006-09-19 16:00 PDT, Igor Bukanov
brendan: review+
Details | Diff | Splinter Review

Description Igor Bukanov 2006-08-02 15:17:23 PDT
Currently compiling SpiderMonkey with JS_HAS_GENERATORS defined as 0 leads to compilation errors in jsiter.c. This has to be fixed as this is a supported configuration.
Comment 1 Brendan Eich [:brendan] 2006-08-02 17:39:02 PDT
Igor, if you could take this one, my head would be less explode-y. Thanks,

/be
Comment 2 Igor Bukanov 2006-09-19 15:48:47 PDT
Created attachment 239259 [details] [diff] [review]
Implementation v0

Changes to allow to compile/run without JS_HAS_GENEARATORS:

1. JSOP_STARTITER and JSOP_ENDITER should be available even if !JS_HAS_GENEARATORS.

2. Almost all of iterator-related code must be available even if !JS_HAS_GENEARATORS. 

Clearly with extra efforts it would be possible to shrink !JS_HAS_GENEARATORS, but I do not think it worths it. 

Moreover, after the patch the only part of the iterator code that is inside  JS_HAS_GENEARATORS-only section is the definitions of Iterator constructor and self functions. Thus I suggest to always provide full Iterator code including constructor declaration even with !JS_HAS_GENEARATORS.

This would cleanup the meaning of JS_HAS_GENEARATORS to stand just for generator and array comprehension support.
Comment 3 Igor Bukanov 2006-09-19 15:57:29 PDT
Created attachment 239260 [details] [diff] [review]
Implementation v1

An alternative version that just makes full iterator support available even with !JS_HAS_GENERATORS. I like it much better then v0.
Comment 4 Igor Bukanov 2006-09-19 16:00:11 PDT
Created attachment 239262 [details] [diff] [review]
Implementation v1b

This is just v1 with fixed comments to reflect the reality after the patch.
Comment 5 Brendan Eich [:brendan] 2006-09-19 22:48:28 PDT
Comment on attachment 239262 [details] [diff] [review]
Implementation v1b

Thanks -- I have the jsinterp.c change in my tree already, hacked it the other day as I was passing by.

We should figure link these bugs to the js1.7 bug, so we don't miss anything that wasn't fixed1.8.1.

/be
Comment 6 Igor Bukanov 2006-09-20 07:51:50 PDT
I committed the patch from comment 4 to the trunk:

Checking in jsinterp.c;
/cvsroot/mozilla/js/src/jsinterp.c,v  <--  jsinterp.c
new revision: 3.292; previous revision: 3.291
done
Checking in jsiter.c;
/cvsroot/mozilla/js/src/jsiter.c,v  <--  jsiter.c
new revision: 3.42; previous revision: 3.41
done
Comment 7 Igor Bukanov 2006-09-20 07:53:52 PDT
Ability to compile without generator support is a feature which is desirable in JS 1.7.
Comment 8 Reed Loden [:reed] (use needinfo?) 2006-11-26 23:39:36 PST
As this is blocking1.8.1.1+, please either request approval1.8.1.1 on the
current patch or, if needed, attach a branch version of the patch and request
approval1.8.1.1 on it.
Comment 9 Igor Bukanov 2006-11-27 00:37:35 PST
The committed patch for 1.8.1 from bug 354982 already addressed this.  

Note You need to log in before you can comment on or make changes to this bug.