Ignore:
Timestamp:
Sep 23, 2010, 5:52:52 PM (15 years ago)
Author:
[email protected]
Message:

2010-09-23 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Delay construction of functions that aren't captured
https://bugs.webkit.org/show_bug.cgi?id=46433

If a function isn't captured by an activation there's no
way it can be accessed indirectly, so we can delay the
construction until it's used (similar to what we do with
arguments). We rename the existing op_init_arguments to
op_init_lazy_reg and removed its implicit handling of
the anonymous argument register, and make op_new_function
take a parameter to indicate whether it should null check
the target slot before creating the function object.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump):
  • bytecode/Opcode.h:
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): (JSC::BytecodeGenerator::emitInitLazyRegister): (JSC::BytecodeGenerator::registerFor): (JSC::BytecodeGenerator::createLazyRegisterIfNecessary): (JSC::BytecodeGenerator::constRegisterFor): (JSC::BytecodeGenerator::emitNewFunction): (JSC::BytecodeGenerator::emitLazyNewFunction): (JSC::BytecodeGenerator::emitNewFunctionInternal):
  • bytecompiler/BytecodeGenerator.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
  • jit/JIT.h:
  • jit/JITOpcodes.cpp: (JSC::JIT::emit_op_init_lazy_reg): (JSC::JIT::emit_op_new_func):
  • jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_init_lazy_reg):
  • parser/Nodes.h: (JSC::ScopeNode::needsActivationForMoreThanVariables):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/Opcode.h

    r64790 r68223  
    4141        macro(op_enter, 1) \
    4242        macro(op_enter_with_activation, 2) \
    43         macro(op_init_arguments, 2) \
     43        macro(op_init_lazy_reg, 2) \
    4444        macro(op_create_arguments, 2) \
    4545        macro(op_create_this, 3) \
     
    154154        macro(op_switch_string, 4) \
    155155        \
    156         macro(op_new_func, 3) \
     156        macro(op_new_func, 4) \
    157157        macro(op_new_func_exp, 3) \
    158158        macro(op_call, 4) \
Note: See TracChangeset for help on using the changeset viewer.