Bug 33580 - [BREWMP] Port currentThreadStackBase
Summary: [BREWMP] Port currentThreadStackBase
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 33564
  Show dependency treegraph
 
Reported: 2010-01-13 00:31 PST by Kwang Yul Seo
Modified: 2012-07-26 05:19 PDT (History)
3 users (show)

See Also:


Attachments
Port currentThreadStackBase to BREW (2.66 KB, patch)
2010-01-13 00:34 PST, Kwang Yul Seo
eric: review-
Details | Formatted Diff | Diff
Patch (5.51 KB, patch)
2010-06-24 00:06 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Patch (5.50 KB, patch)
2010-06-24 00:09 PDT, Kwang Yul Seo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kwang Yul Seo 2010-01-13 00:31:22 PST
IDEBUGGER_GetStackRange returns the initial address of the stack array. Because the stack grows downward, we can retrieve the stack base address by adding the stack size retrieved from IDEBUGGER_GetStackSize to the result of IDEBUGGER_GetStackRange. For BREW simulator, use WIN_OS currentThreadStackBase implementation as BREW simulator is essentially a Win32 program.
Comment 1 Kwang Yul Seo 2010-01-13 00:34:05 PST
Created attachment 46431 [details]
Port currentThreadStackBase to BREW
Comment 2 WebKit Review Bot 2010-01-13 00:38:45 PST
Attachment 46431 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
JavaScriptCore/runtime/Collector.cpp:551:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 1
Comment 3 Eric Seidel (no email) 2010-01-26 14:49:46 PST
Comment on attachment 46431 [details]
Port currentThreadStackBase to BREW

Wow, I would think creating/releasing some debugger object could be expensive.  This function is called every time with garbage collect in JavaScriptCore.

+#undef COMPILE_ASSERT
problem, as mentioned in other bugs.
Comment 4 Kwang Yul Seo 2010-02-02 06:52:34 PST
This is the place where the behavior differs between BREW and BREW MP. There is no IDebugger interface in BREW MP, so we can't use it to retrieve the stack base address. I am looking for a way to get it.
Comment 5 Kwang Yul Seo 2010-06-24 00:06:06 PDT
Created attachment 59617 [details]
Patch

There is no way to get the stack base address in Brew MP. Make it possible to set it externally.
Comment 6 Kwang Yul Seo 2010-06-24 00:09:14 PDT
Created attachment 59618 [details]
Patch

Better naming.
Comment 7 Gabor Loki 2010-06-24 02:45:36 PDT
> +static void* s_stackBaseAddress;

Avoid static data. JSC should be thread-safe.
Comment 8 Kwang Yul Seo 2010-06-24 09:40:00 PDT
(In reply to comment #7)
> > +static void* s_stackBaseAddress;
> 
> Avoid static data. JSC should be thread-safe.

Yes, I know. However, Brew MP does support preemptive multi-threading. It does not have threads, mutexs and thread-specific variables. I turned on ENABLE(SINGLE_THREADED) for Brew MP.
Comment 9 Kwang Yul Seo 2010-10-01 10:02:41 PDT
It seems we have a better way to find the stack base in Brew MP 1.1.0. For example, we can set the stack size and base in IThread2Util_CreateThread. Unfortunately, Brew MP 1.1.0 is not yet publicly available.
Comment 10 Kwang Yul Seo 2012-07-26 05:19:28 PDT
Brew MP port is no longer maintained.