Changeset 60105 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- May 24, 2010, 5:44:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r60084 r60105 3884 3884 vPC = callFrame->returnPC(); 3885 3885 callFrame = callFrame->callerFrame(); 3886 3886 3887 3887 if (callFrame->hasHostCallFrameFlag()) 3888 3888 return returnValue; … … 3929 3929 3930 3930 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) = 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 code3950 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_DISABLED3958 ConstructData constructData;3959 ASSERT(constructor->getConstructData(constructData) == ConstructTypeJS);3960 #endif3961 3962 Structure* structure;3963 JSValue proto = callFrame->r(protoRegister).jsValue();3964 if (proto.isObject())3965 structure = asObject(proto)->inheritorID();3966 else3967 structure = constructor->scope().node()->globalObject->emptyObjectStructure();3968 callFrame->r(thisRegister) = new (&callFrame->globalData()) JSObject(structure);3969 3970 vPC += OPCODE_LENGTH(op_create_this);3971 3931 NEXT_INSTRUCTION(); 3972 3932 } … … 4041 4001 int argCount = vPC[2].u.operand; 4042 4002 int registerOffset = vPC[3].u.operand; 4003 int proto = vPC[4].u.operand; 4004 int thisRegister = vPC[5].u.operand; 4043 4005 4044 4006 JSValue v = callFrame->r(func).jsValue(); … … 4050 4012 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; 4051 4013 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 4052 4024 4053 4025 CallFrame* previousCallFrame = callFrame; … … 4072 4044 4073 4045 if (constructType == ConstructTypeHost) { 4046 ArgList args(callFrame->registers() + thisRegister + 1, argCount - 1); 4047 4074 4048 ScopeChainNode* scopeChain = callFrame->scopeChain(); 4075 4049 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset); 4076 4050 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);4080 4051 4081 4052 JSValue returnValue;
Note:
See TracChangeset
for help on using the changeset viewer.