Changeset 36726 in webkit for trunk/JavaScriptCore/VM
- Timestamp:
- Sep 20, 2008, 7:29:12 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/VM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r36695 r36726 151 151 return n1 < n2; 152 152 153 Machine* machine = exec->machine(); 154 if (machine->isJSString(v1) && machine->isJSString(v2)) 155 return static_cast<const JSString*>(v1)->value() < static_cast<const JSString*>(v2)->value(); 156 153 157 JSValue* p1; 154 158 JSValue* p2; … … 171 175 if (fastIsNumber(v1, n1) && fastIsNumber(v2, n2)) 172 176 return n1 <= n2; 177 178 Machine* machine = exec->machine(); 179 if (machine->isJSString(v1) && machine->isJSString(v2)) 180 return !(static_cast<const JSString*>(v2)->value() < static_cast<const JSString*>(v1)->value()); 173 181 174 182 JSValue* p1; … … 1505 1513 int dst = (++vPC)->u.operand; 1506 1514 int regExp = (++vPC)->u.operand; 1507 r[dst] = new (exec) RegExpObject(scopeChain->globalObject()->regExp Prototype(), codeBlock->regexps[regExp]);1515 r[dst] = new (exec) RegExpObject(scopeChain->globalObject()->regExpStructure(), codeBlock->regexps[regExp]); 1508 1516 1509 1517 ++vPC; … … 3386 3394 (*enabledProfilerReference)->willExecute(exec, constructor); 3387 3395 3388 JSObject* prototype;3389 JSValue* p = r[constrProto].jsValue(exec);3390 if (p ->isObject())3391 prototype = static_cast<JSObject*>(p);3396 StructureID* structure; 3397 JSValue* prototype = r[constrProto].jsValue(exec); 3398 if (prototype->isObject()) 3399 structure = static_cast<JSObject*>(prototype)->inheritorID(); 3392 3400 else 3393 prototype = scopeChain->globalObject()->objectPrototype();3394 JSObject* newObject = new (exec) JSObject( prototype);3401 structure = scopeChain->globalObject()->emptyObjectStructure(); 3402 JSObject* newObject = new (exec) JSObject(structure); 3395 3403 3396 3404 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; … … 4540 4548 (*ARG_profilerReference)->willExecute(exec, constructor); 4541 4549 4542 JSObject* prototype; 4543 JSValue* p = constrProtoVal; 4544 if (p->isObject()) 4545 prototype = static_cast<JSObject*>(p); 4550 StructureID* structure; 4551 if (constrProtoVal->isObject()) 4552 structure = static_cast<JSObject*>(constrProtoVal)->inheritorID(); 4546 4553 else 4547 prototype = scopeChain->globalObject()->objectPrototype();4548 JSObject* newObject = new (exec) JSObject( prototype);4554 structure = scopeChain->globalObject()->emptyObjectStructure(); 4555 JSObject* newObject = new (exec) JSObject(structure); 4549 4556 4550 4557 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; … … 5145 5152 JSValue* Machine::cti_op_new_regexp(CTI_ARGS) 5146 5153 { 5147 return new (ARG_exec) RegExpObject(ARG_scopeChain->globalObject()->regExp Prototype(), ARG_regexp1);5154 return new (ARG_exec) RegExpObject(ARG_scopeChain->globalObject()->regExpStructure(), ARG_regexp1); 5148 5155 } 5149 5156 … … 5275 5282 JSValue* Machine::cti_op_is_string(CTI_ARGS) 5276 5283 { 5277 return jsBoolean(ARG_ src1->isString());5284 return jsBoolean(ARG_exec->machine()->isJSString(ARG_src1)); 5278 5285 } 5279 5286 -
trunk/JavaScriptCore/VM/Machine.h
r36604 r36726 233 233 static const int initialTickCountThreshold = 1024; 234 234 235 bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; } 236 bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; } 237 235 238 private: 236 239 enum ExecutionFlag { Normal, InitializeAndReturn }; … … 257 260 void resetTimeoutCheck(); 258 261 259 bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; }260 bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; }261 262 262 void tryCacheGetByID(ExecState*, CodeBlock*, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&); 263 263 void uncacheGetByID(CodeBlock*, Instruction* vPC);
Note:
See TracChangeset
for help on using the changeset viewer.