Bug 117262 - Disambiguate between CallFrame bytecodeOffset and codeOriginIndex
Summary: Disambiguate between CallFrame bytecodeOffset and codeOriginIndex
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on: 117312
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-05 10:12 PDT by Mark Lam
Modified: 2013-06-06 11:18 PDT (History)
5 users (show)

See Also:


Attachments
the patch. (9.59 KB, patch)
2013-06-05 18:27 PDT, Mark Lam
no flags Details | Formatted Diff | Diff
corrected patch. (25.61 KB, patch)
2013-06-05 18:43 PDT, Mark Lam
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2013-06-05 10:12:26 PDT
We should be able to discern whether a CallFrame (once fully reified) ArgumentCount tag is a bytecodeOffset or a codeOriginIndex.  This change will flag the codeOriginIndex by encoding it as a handle which always has the high bit set.  If the ArgumentCount tag word has its high bit set, then we have a codeOriginIndex, else we have a bytecodeOffset.
Comment 1 Mark Lam 2013-06-05 18:27:14 PDT
Created attachment 203896 [details]
the patch.
Comment 2 Mark Lam 2013-06-05 18:27:54 PDT
Comment on attachment 203896 [details]
the patch.

Forgot the ChangeLogs.  Will re-upload with ChangeLogs.
Comment 3 Mark Lam 2013-06-05 18:43:42 PDT
Created attachment 203897 [details]
corrected patch.
Comment 4 Geoffrey Garen 2013-06-05 18:56:00 PDT
Comment on attachment 203897 [details]
corrected patch. 

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

r=me

> Source/JavaScriptCore/interpreter/CallFrame.cpp:45
> +unsigned CallFrame::locationAsBytecodeOffset() const

This should ASSERT hasLocationAsBytecodeOffset().

> Source/JavaScriptCore/interpreter/CallFrame.cpp:51
> +void CallFrame::setLocationAsBytecodeOffset(unsigned offset)

This should ASSERT hasLocationAsBytecodeOffset() after the set -- or ASSERT that offset is not a CodeOrigin handle.

> Source/JavaScriptCore/interpreter/CallFrameInlines.h:62
> +inline void CallFrame::setLocationAsBytecodeOffset(unsigned offset)

This should ASSERT hasLocationAsBytecodeOffset() after the set -- or ASSERT that offset is not a CodeOrigin handle.
Comment 5 Mark Lam 2013-06-05 19:14:03 PDT
Landed in r151250: <http://trac.webkit.org/changeset/151250>.