Changeset 60117 in webkit for trunk/JavaScriptCore/interpreter


Ignore:
Timestamp:
May 24, 2010, 8:04:43 PM (15 years ago)
Author:
[email protected]
Message:

Relanding r60075.

Reviewed by Sam Weinig.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dump):
(JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):

  • bytecode/CodeBlock.h:
  • bytecode/Opcode.h:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitConstruct):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::emitGetByIdExceptionInfo):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):
(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emit_op_convert_this):
(JSC::JIT::emit_op_get_callee):
(JSC::JIT::emit_op_create_this):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):
(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::emit_op_get_callee):
(JSC::JIT::emit_op_create_this):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):
(JSC::JITThunks::hostFunctionStub):

  • jit/JITStubs.h:

(JSC::JITThunks::ctiNativeConstruct):
(JSC::):

  • runtime/ExceptionHelpers.cpp:

(JSC::createNotAnObjectError):

  • runtime/Executable.h:

(JSC::NativeExecutable::create):
(JSC::NativeExecutable::NativeExecutable):

  • runtime/JSFunction.cpp:

(JSC::callHostFunctionAsConstructor):

  • runtime/JSFunction.h:
  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/interpreter/Interpreter.cpp

    r60105 r60117  
    38843884        vPC = callFrame->returnPC();
    38853885        callFrame = callFrame->callerFrame();
    3886        
     3886
    38873887        if (callFrame->hasHostCallFrameFlag())
    38883888            return returnValue;
     
    39293929
    39303930        vPC += OPCODE_LENGTH(op_enter_with_activation);
     3931        NEXT_INSTRUCTION();
     3932    }
     3933    DEFINE_OPCODE(op_get_callee) {
     3934        /* op_get_callee callee(r)
     3935
     3936           Move callee into a register.
     3937        */
     3938
     3939        callFrame->r(vPC[1].u.operand) = JSValue(callFrame->callee());
     3940
     3941        vPC += OPCODE_LENGTH(op_get_callee);
     3942        NEXT_INSTRUCTION();
     3943    }
     3944    DEFINE_OPCODE(op_create_this) {
     3945        /* op_create_this this(r) proto(r)
     3946
     3947           Allocate an object as 'this', fr use in construction.
     3948
     3949           This opcode should only be used at the beginning of a code
     3950           block.
     3951        */
     3952
     3953        int thisRegister = vPC[1].u.operand;
     3954        int protoRegister = vPC[2].u.operand;
     3955
     3956        JSFunction* constructor = asFunction(callFrame->callee());
     3957#if !ASSERT_DISABLED
     3958        ConstructData constructData;
     3959        ASSERT(constructor->getConstructData(constructData) == ConstructTypeJS);
     3960#endif
     3961
     3962        Structure* structure;
     3963        JSValue proto = callFrame->r(protoRegister).jsValue();
     3964        if (proto.isObject())
     3965            structure = asObject(proto)->inheritorID();
     3966        else
     3967            structure = constructor->scope().node()->globalObject->emptyObjectStructure();
     3968        callFrame->r(thisRegister) = new (&callFrame->globalData()) JSObject(structure);
     3969
     3970        vPC += OPCODE_LENGTH(op_create_this);
    39313971        NEXT_INSTRUCTION();
    39323972    }
     
    40014041        int argCount = vPC[2].u.operand;
    40024042        int registerOffset = vPC[3].u.operand;
    4003         int proto = vPC[4].u.operand;
    4004         int thisRegister = vPC[5].u.operand;
    40054043
    40064044        JSValue v = callFrame->r(func).jsValue();
     
    40124050            ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
    40134051            CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecodeForConstruct(callFrame, callDataScopeChain);
    4014 
    4015             Structure* structure;
    4016             JSValue prototype = callFrame->r(proto).jsValue();
    4017             if (prototype.isObject())
    4018                 structure = asObject(prototype)->inheritorID();
    4019             else
    4020                 structure = callDataScopeChain->globalObject->emptyObjectStructure();
    4021             JSObject* newObject = new (globalData) JSObject(structure);
    4022 
    4023             callFrame->r(thisRegister) = JSValue(newObject); // "this" value
    40244052
    40254053            CallFrame* previousCallFrame = callFrame;
     
    40444072
    40454073        if (constructType == ConstructTypeHost) {
    4046             ArgList args(callFrame->registers() + thisRegister + 1, argCount - 1);
    4047 
    40484074            ScopeChainNode* scopeChain = callFrame->scopeChain();
    40494075            CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
    40504076            newCallFrame->init(0, vPC + OPCODE_LENGTH(op_construct), scopeChain, callFrame, 0, argCount, 0);
     4077
     4078            Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount;
     4079            ArgList args(thisRegister + 1, argCount - 1);
    40514080
    40524081            JSValue returnValue;
Note: See TracChangeset for help on using the changeset viewer.