Changeset 36727 in webkit for trunk/JavaScriptCore/kjs/operations.cpp
- Timestamp:
- Sep 20, 2008, 10:54:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/operations.cpp
r36509 r36727 108 108 return false; 109 109 110 return strictEqualSlowCase (v1, v2);110 return strictEqualSlowCaseInline(v1, v2); 111 111 } 112 112 113 113 bool strictEqualSlowCase(JSValue* v1, JSValue* v2) 114 114 { 115 ASSERT(!JSImmediate::areBothImmediate(v1, v2)); 116 117 if (JSImmediate::isEitherImmediate(v1, v2)) { 118 // pointers can't be equal since one is immediate and one isn't 119 ASSERT(v1 != v2); 120 ASSERT(v1 == JSImmediate::zeroImmediate() || v2 == JSImmediate::zeroImmediate()); 121 122 // The reason we can't just return false here is that 0 === -0, 123 // and while the former is an immediate number, the latter is not. 124 if (v1 == JSImmediate::zeroImmediate()) 125 return static_cast<JSCell*>(v2)->isNumber() && static_cast<JSNumberCell*>(v2)->value() == 0; 126 return static_cast<JSCell*>(v1)->isNumber() && static_cast<JSNumberCell*>(v1)->value() == 0; 127 } 128 129 if (static_cast<JSCell*>(v1)->isNumber()) { 130 return static_cast<JSCell*>(v2)->isNumber() 131 && static_cast<JSNumberCell*>(v1)->value() == static_cast<JSNumberCell*>(v2)->value(); 132 } 133 134 if (static_cast<JSCell*>(v1)->isString()) { 135 return static_cast<JSCell*>(v2)->isString() 136 && static_cast<JSString*>(v1)->value() == static_cast<JSString*>(v2)->value(); 137 } 138 139 return v1 == v2; 115 return strictEqualSlowCaseInline(v1, v2); 140 116 } 141 117
Note:
See TracChangeset
for help on using the changeset viewer.