Bug 117312 - Encode CallFrame::Location flags in the low bits when USE(JSVALUE32_64).
Summary: Encode CallFrame::Location flags in the low bits when USE(JSVALUE32_64).
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks: 117262
  Show dependency treegraph
 
Reported: 2013-06-06 11:17 PDT by Michael Saboff
Modified: 2013-06-06 14:35 PDT (History)
1 user (show)

See Also:


Attachments
the patch. (3.71 KB, patch)
2013-06-06 14:18 PDT, Mark Lam
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2013-06-06 11:17:51 PDT
ASSERT(hasLocationAsBytecodeOffset()) is called in CallFrame::locationAsBytecodeOffset() and CallFrame::setLocationAsBytecodeOffset() for JSVALUE32_64 builds. The 32 bit value stored in ArgumentCount tag for the JSVALUE32_64 builds is a pointer which may have the high bit set.  This high bit is used to determine whether hasLocationAsBytecodeOffset() or hasLocationAsCodeOriginIndex() is true.  Therefore these checks are meaningless to 32 bit builds.

I believe that some of the work in https://bugs.webkit.org/show_bug.cgi?id=117262 needs to be changed for 32 bit builds.
Comment 1 Mark Lam 2013-06-06 12:19:03 PDT
(In reply to comment #0)
> ASSERT(hasLocationAsBytecodeOffset()) is called in CallFrame::locationAsBytecodeOffset() and CallFrame::setLocationAsBytecodeOffset() for JSVALUE32_64 builds. The 32 bit value stored in ArgumentCount tag for the JSVALUE32_64 builds is a pointer which may have the high bit set.  This high bit is used to determine whether hasLocationAsBytecodeOffset() or hasLocationAsCodeOriginIndex() is true.  Therefore these checks are meaningless to 32 bit builds.
> 
> I believe that some of the work in https://bugs.webkit.org/show_bug.cgi?id=117262 needs to be changed for 32 bit builds.

Yes, ideally, we should fix the 64 bit port so that its offset is in units of bytes instead of int64_t's.  That will allow us to use the low 2 bits for flags.
Comment 2 Mark Lam 2013-06-06 13:05:37 PDT
Actually, I can implement a quick fix for this using the patch I'll land for https://bugs.webkit.org/show_bug.cgi?id=117209.
Comment 3 Mark Lam 2013-06-06 14:18:32 PDT
Created attachment 203966 [details]
the patch.
Comment 4 Michael Saboff 2013-06-06 14:26:26 PDT
Comment on attachment 203966 [details]
the patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=203966&action=review

r=me

> Source/JavaScriptCore/ChangeLog:7
> +

Add some text saying that we are using the low 2 bits and the reason is that the upper bits are needed for addresses.
Comment 5 Mark Lam 2013-06-06 14:35:50 PDT
Thanks for the review.  Landed in r151291: <http://trac.webkit.org/changeset/151291>.