<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>100364</bug_id>
          
          <creation_ts>2012-10-25 04:10:47 -0700</creation_ts>
          <short_desc>LLInt C_Loop build is broken</short_desc>
          <delta_ts>2012-10-25 07:51:36 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>100345</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>97648</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Hausmann">hausmann</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mark.lam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>750652</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2012-10-25 04:10:47 -0700</bug_when>
    <thetext>The build with the C_LOOP back-end is broken in two ways:

The error is:

generated/LLIntAssembly.h: In static member function &apos;static JSC::JSValue JSC::LLInt::CLoop::execute(JSC::CallFrame*, JSC::OpcodeID, bool)&apos;:
generated/LLIntAssembly.h:3731:14: error: label &apos;llint_op_resolve&apos; used but not defined
generated/LLIntAssembly.h:3917:10: error: label &apos;llint_op_resolve_base&apos; used but not defined

These errors come from the following two snippets in LowLevelInterpreter.asm:


_llint_op_resolve_base_to_global_dynamic:
    jmp _llint_op_resolve_base

and as part of _llint_op_resolve_global_property:

    bpneq JSCell::m_structure[t1], t2, _llint_op_resolve

In both cases the destination label is referred to in the same way as it is defined. When creating the destination
labels, offlineasm/asm.rb uses OFFLINE_ASM_OPCODE_LABEL for both because their name contains with llint_op_. However
labels passed to _OPCODE_LABEL() have the _llint_ prefix stripped, so the resulting label in LLIntAssembly.h is actually
op_resolve_base and op_resolve. Therefore the &quot;jmp _llint_op_resolve_base&quot; and the bpneq cannot find their targets.

The second error is that even if LowLevelInterpreter.asm used _op_resolve_base as target if C_LOOP, turning the jmp into
a &quot;goto op_resolve_base;&quot;, the build breaks when computed gotos are not available, because the OFFLINE_ASM_OPCODE_LABEL
only defines a &quot;case Foo:&quot; target instead of a combined target that can also be used with goto, like GLUE_LABEL does it:

    case label: label:


A possible workaround for both issues seems to be to use an extra local label:


--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
@@ -662,7 +662,7 @@ _llint_op_resolve_global_property:
     loadp CodeBlock[cfr], t1
     loadp CodeBlock::m_globalObject[t1], t1
     loadp ResolveOperation::m_structure[t0], t2
-    bpneq JSCell::m_structure[t1], t2, _llint_op_resolve
+    bpneq JSCell::m_structure[t1], t2, ._llint_op_resolve
     loadis ResolveOperation::m_offset[t0], t0
     if JSVALUE64
         loadPropertyAtVariableOffsetKnownNotInline(t0, t1, t2)
@@ -746,6 +746,7 @@ _llint_op_resolve_scoped_var_with_top_scope_check:
     moveJSValue(t1, t2, cfr, t3, 4, t0)
     dispatch(5)
 
+._llint_op_resolve:
 _llint_op_resolve:
     traceExecution()
     getResolveOperation(3, t0, t1)
@@ -780,7 +781,7 @@ _llint_op_resolve_base_to_global:
     dispatch(7)
 
 _llint_op_resolve_base_to_global_dynamic:
-    jmp _llint_op_resolve_base
+    jmp ._llint_resolve_base
 
 _llint_op_resolve_base_to_scope:
     traceExecution()
@@ -827,6 +828,7 @@ _llint_op_resolve_base_to_scope_with_top_scope_check:
     end
     dispatch(7)
 
+._llint_resolve_base:
 _llint_op_resolve_base:
     traceExecution()
     callSlowPath(_llint_slow_path_resolve_base)


But I&apos;m not familiar enough with LLInt to be sure that this is the right solution.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>750676</commentid>
    <comment_count>1</comment_count>
      <attachid>170617</attachid>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2012-10-25 04:40:58 -0700</bug_when>
    <thetext>Created attachment 170617
Workaround as attachment</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>750827</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2012-10-25 07:51:36 -0700</bug_when>
    <thetext>The proper fix is awaiting review at &lt;https://bugs.webkit.org/show_bug.cgi?id=100345&gt;.

*** This bug has been marked as a duplicate of bug 100345 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>170617</attachid>
            <date>2012-10-25 04:40:58 -0700</date>
            <delta_ts>2012-10-25 04:40:58 -0700</delta_ts>
            <desc>Workaround as attachment</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1377</size>
            <attacher name="Simon Hausmann">hausmann</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9sbGludC9Mb3dMZXZlbEludGVycHJl
dGVyLmFzbSBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9sbGludC9Mb3dMZXZlbEludGVycHJldGVy
LmFzbQppbmRleCAwMjI2MzdkLi40MDllYzQxIDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvbGxpbnQvTG93TGV2ZWxJbnRlcnByZXRlci5hc20KKysrIGIvU291cmNlL0phdmFTY3Jp
cHRDb3JlL2xsaW50L0xvd0xldmVsSW50ZXJwcmV0ZXIu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