Changeset 47089 in webkit for trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
- Timestamp:
- Aug 11, 2009, 10:22:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r47062 r47089 257 257 258 258 for (size_t i = 0; i < functionStack.size(); ++i) { 259 Func DeclNode* funcDecl= functionStack[i];260 globalObject->removeDirect(func Decl->m_ident); // Make sure our new function is not shadowed by an old property.261 emitNewFunction(addGlobalVar(func Decl->m_ident, false), funcDecl);259 FunctionBodyNode* function = functionStack[i]; 260 globalObject->removeDirect(function->ident()); // Make sure our new function is not shadowed by an old property. 261 emitNewFunction(addGlobalVar(function->ident(), false), function); 262 262 } 263 263 … … 273 273 } else { 274 274 for (size_t i = 0; i < functionStack.size(); ++i) { 275 Func DeclNode* funcDecl= functionStack[i];276 globalObject->putWithAttributes(exec, func Decl->m_ident, funcDecl->makeFunction(exec, scopeChain.node()), DontDelete);275 FunctionBodyNode* function = functionStack[i]; 276 globalObject->putWithAttributes(exec, function->ident(), function->make(exec, scopeChain.node()), DontDelete); 277 277 } 278 278 for (size_t i = 0; i < varStack.size(); ++i) { … … 340 340 const DeclarationStacks::FunctionStack& functionStack = functionBody->functionStack(); 341 341 for (size_t i = 0; i < functionStack.size(); ++i) { 342 Func DeclNode* funcDecl= functionStack[i];343 const Identifier& ident = func Decl->m_ident;342 FunctionBodyNode* function = functionStack[i]; 343 const Identifier& ident = function->ident(); 344 344 m_functions.add(ident.ustring().rep()); 345 emitNewFunction(addVar(ident, false), func Decl);345 emitNewFunction(addVar(ident, false), function); 346 346 } 347 347 … … 767 767 } 768 768 769 unsigned BytecodeGenerator::addConstant(Func DeclNode* n)769 unsigned BytecodeGenerator::addConstant(FunctionBodyNode* n) 770 770 { 771 771 // No need to explicitly unique function body nodes -- they're unique already. 772 772 return m_codeBlock->addFunction(n); 773 }774 775 unsigned BytecodeGenerator::addConstant(FuncExprNode* n)776 {777 // No need to explicitly unique function expression nodes -- they're unique already.778 return m_codeBlock->addFunctionExpression(n);779 773 } 780 774 … … 1315 1309 } 1316 1310 1317 RegisterID* BytecodeGenerator::emitNewFunction(RegisterID* dst, Func DeclNode* n)1311 RegisterID* BytecodeGenerator::emitNewFunction(RegisterID* dst, FunctionBodyNode* body) 1318 1312 { 1319 1313 emitOpcode(op_new_func); 1320 1314 instructions().append(dst->index()); 1321 instructions().append(addConstant( n));1315 instructions().append(addConstant(body)); 1322 1316 return dst; 1323 1317 } … … 1336 1330 emitOpcode(op_new_func_exp); 1337 1331 instructions().append(r0->index()); 1338 instructions().append(addConstant(n ));1332 instructions().append(addConstant(n->body())); 1339 1333 return r0; 1340 1334 }
Note:
See TracChangeset
for help on using the changeset viewer.