Changeset 127938 in webkit


Ignore:
Timestamp:
Sep 7, 2012 4:58:47 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Source/JavaScriptCore: Fix a llint C++ interpreter bugs.
https://bugs.webkit.org/show_bug.cgi?id=96127.

Patch by Mark Lam <mark.lam@apple.com> on 2012-09-07
Reviewed by Filip Pizlo.

  • llint/LowLevelInterpreter.cpp:

(JSC):
(JSC::CLoop::execute):

  • offlineasm/cloop.rb:

Source/WTF: Fixed ASSERT() and ASSERT_AT() macros so that they can be used in
comma expressions.
https://bugs.webkit.org/show_bug.cgi?id=96127.

Patch by Mark Lam <mark.lam@apple.com> on 2012-09-07
Reviewed by Filip Pizlo.

  • wtf/Assertions.h:

(wtfAssert):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r127930 r127938  
     12012-09-07  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix a llint C++ interpreter bugs.
     4        https://bugs.webkit.org/show_bug.cgi?id=96127.
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * llint/LowLevelInterpreter.cpp:
     9        (JSC):
     10        (JSC::CLoop::execute):
     11        * offlineasm/cloop.rb:
     12
    1132012-09-07  Gavin Barraclough  <barraclough@apple.com>
    214
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp

    r127374 r127938  
    3737#include "LLintSlowPaths.h"
    3838#include "VMInspector.h"
     39#include <wtf/Assertions.h>
    3940#include <wtf/MathExtras.h>
    4041
     
    9899#define OFFLINE_ASM_LOCAL_LABEL(label)   label:
    99100
     101
     102//============================================================================
     103// Some utilities:
     104//
    100105
    101106namespace JSC {
     
    117122
    118123
     124//============================================================================
     125// The llint C++ interpreter loop:
     126//
     127
    119128JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId,
    120129                       bool isInitializationPass)
    121130{
    122131    #define CAST reinterpret_cast
    123     #define SIGN_BIT32(x) (x & 0x80000000)
     132    #define SIGN_BIT32(x) ((x) & 0x80000000)
    124133
    125134    // One-time initialization of our address tables. We have to put this code
  • trunk/Source/JavaScriptCore/offlineasm/cloop.rb

    r127374 r127938  
    173173        if base.is_a? RegisterID and base.name == "sp"
    174174            offsetValue = "#{offset.value}"
    175             "(assert(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
     175            "(ASSERT(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
    176176        elsif offset.value == 0
    177177            "#{base.clValue(:int8Ptr)}"
     
    237237        if base.is_a? RegisterID and base.name == "sp"
    238238            offsetValue = "(#{index.clValue(:int32)} << #{scaleShift}) + #{offset.clValue})"
    239             "(assert(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
     239            "(ASSERT(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
    240240        else
    241241            "#{base.clValue(:int8Ptr)} + (#{index.clValue(:int32)} << #{scaleShift}) + #{offset.clValue}"
  • trunk/Source/WTF/ChangeLog

    r127928 r127938  
     12012-09-07  Mark Lam  <mark.lam@apple.com>
     2
     3        Fixed ASSERT() and ASSERT_AT() macros so that they can be used in
     4        comma expressions.
     5        https://bugs.webkit.org/show_bug.cgi?id=96127.
     6
     7        Reviewed by Filip Pizlo.
     8
     9        * wtf/Assertions.h:
     10        (wtfAssert):
     11
    1122012-09-07  Michael Saboff  <msaboff@apple.com>
    213
  • trunk/Source/WTF/wtf/Assertions.h

    r124215 r127938  
    245245#else
    246246
    247 #define ASSERT(assertion) do \
    248     if (!(assertion)) { \
    249         WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion); \
    250         CRASH(); \
    251     } \
    252 while (0)
    253 
    254 #define ASSERT_AT(assertion, file, line, function) do  \
    255     if (!(assertion)) { \
    256         WTFReportAssertionFailure(file, line, function, #assertion); \
    257         CRASH(); \
    258     } \
    259 while (0)
     247static inline void wtfAssert(bool assertion, const char* file, int line,
     248    const char* function, const char* assertionString)
     249{
     250    if (!assertion) {
     251        WTFReportAssertionFailure(file, line, function, assertionString);
     252        CRASH();
     253    }
     254}
     255
     256#define ASSERT(assertion) \
     257    wtfAssert(!!(assertion), __FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion)
     258
     259#define ASSERT_AT(assertion, file, line, function) \
     260    wtfAssert(!!(assertion), file, line, function, #assertion)
    260261
    261262#define ASSERT_NOT_REACHED() do { \
Note: See TracChangeset for help on using the changeset viewer.