Changeset 38330 in webkit for trunk/JavaScriptCore/bytecompiler/CodeGenerator.cpp
- Timestamp:
- Nov 12, 2008, 1:34:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/CodeGenerator.cpp
r38322 r38330 1220 1220 } 1221 1221 1222 RegisterID* CodeGenerator::emitCall(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)1223 { 1224 return emitCall(op_call, dst, func, thisRegister, argumentsNode, divot, startOffset, endOffset);1225 } 1226 1227 RegisterID* CodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)1228 { 1229 return emitCall(op_call_eval, dst, func, thisRegister, argumentsNode, divot, startOffset, endOffset);1230 } 1231 1232 RegisterID* CodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset)1222 RegisterID* CodeGenerator::emitCall(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset) 1223 { 1224 return emitCall(op_call, dst, func, base, argumentsNode, divot, startOffset, endOffset); 1225 } 1226 1227 RegisterID* CodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset) 1228 { 1229 return emitCall(op_call_eval, dst, func, base, argumentsNode, divot, startOffset, endOffset); 1230 } 1231 1232 RegisterID* CodeGenerator::emitCall(OpcodeID opcodeID, RegisterID* dst, RegisterID* func, RegisterID* base, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset) 1233 1233 { 1234 1234 ASSERT(opcodeID == op_call || opcodeID == op_call_eval); 1235 1235 ASSERT(func->refCount()); 1236 ASSERT(!base || base->refCount()); 1236 1237 1237 1238 // Generate code for arguments. 1238 1239 Vector<RefPtr<RegisterID>, 16> argv; 1239 argv.append( thisRegister);1240 argv.append(newTemporary()); // reserve space for "this" 1240 1241 for (ArgumentListNode* n = argumentsNode->m_listNode.get(); n; n = n->m_next.get()) { 1241 1242 argv.append(newTemporary()); … … 1255 1256 emitExpressionInfo(divot, startOffset, endOffset); 1256 1257 m_codeBlock->callLinkInfos.append(CallLinkInfo()); 1257 1258 // Emit call.1259 1258 emitOpcode(opcodeID); 1260 instructions().append(dst->index()); // dst 1261 instructions().append(func->index()); // func 1262 instructions().append(argv.size()); // argCount 1259 instructions().append(dst->index()); 1260 instructions().append(func->index()); 1261 instructions().append(base ? base->index() : missingThisObjectMarker()); // We encode the "this" value in the instruction stream, to avoid an explicit instruction for copying or loading it. 1262 instructions().append(argv[0]->index()); // argv 1263 instructions().append(argv.size()); // argc 1263 1264 instructions().append(argv[0]->index() + argv.size() + RegisterFile::CallFrameHeaderSize); // registerOffset 1264 1265 … … 1319 1320 emitExpressionInfo(divot, startOffset, endOffset); 1320 1321 m_codeBlock->callLinkInfos.append(CallLinkInfo()); 1321 1322 1322 emitOpcode(op_construct); 1323 instructions().append(dst->index()); // dst 1324 instructions().append(func->index()); // func 1325 instructions().append(argv.size()); // argCount 1323 instructions().append(dst->index()); 1324 instructions().append(func->index()); 1325 instructions().append(funcProto->index()); 1326 instructions().append(argv[0]->index()); // argv 1327 instructions().append(argv.size()); // argc 1326 1328 instructions().append(argv[0]->index() + argv.size() + RegisterFile::CallFrameHeaderSize); // registerOffset 1327 instructions().append(funcProto->index()); // proto1328 instructions().append(argv[0]->index()); // thisRegister1329 1329 1330 1330 emitOpcode(op_construct_verify);
Note:
See TracChangeset
for help on using the changeset viewer.