Changeset 35203 in webkit for trunk/JavaScriptCore/kjs/JSValue.h


Ignore:
Timestamp:
Jul 16, 2008, 3:47:32 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-07-16 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.


First step toward putting doubles in registers: Turned Register into a
proper abstraction layer. It is no longer possible to cast a Register
to a JSValue*, or a Register& to a JSValue*&, or to access the union
inside a Register directly.


SunSpider reports no change.


In support of this change, I had to make the following mechanical changes
in a lot of places:


  1. Clients now use explicit accessors to read data out of Registers, and implicit copy constructors to write data into registers.


So, assignment that used to look like


x.u.jsValue = y;


now looks like


x = y;


And access that used to look like


x = y.u.jsValue;


now looks like


x = y.jsValue();

  1. I made generic flow control specific in opcodes that made their flow control generic by treating a Register& as a JSValue*&. This had the added benefit of removing some exception checking branches from immediate number code.
  1. I beefed up PropertySlot to support storing a Register* in a property slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut use this functionality, but I expect more clients to use it in the future.


  1. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I changed ArgList iterator clients to iterate Registers, not JSValue*'s.

WebCore:

2008-07-16 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.

Support for JavaScriptCore's first step toward putting doubles in
registers: Treat ArgList iterators as Register*'s, not JSValue*'s.

  • bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::ScheduledAction):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSValue.h

    r35027 r35203  
    2626#include "CallData.h"
    2727#include "ConstructData.h"
    28 #include "ExecState.h"
    2928#include "JSImmediate.h"
    3029#include "ustring.h"
     
    112111        // These are identical logic to above, and faster than jsNumber(number)->toInt32(exec)
    113112        static int32_t toInt32(double);
    114         static int32_t toUInt32(double);
     113        static uint32_t toUInt32(double);
    115114
    116115        // Floating point conversions.
     
    219218    }
    220219
    221     inline int32_t JSValue::toUInt32(double val)
     220    inline uint32_t JSValue::toUInt32(double val)
    222221    {
    223222        if (!(val >= 0.0 && val < 4294967296.0)) {
Note: See TracChangeset for help on using the changeset viewer.