Changeset 60117 in webkit for trunk/JavaScriptCore/interpreter
- Timestamp:
- May 24, 2010, 8:04:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r60105 r60117 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) = 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); 3931 3971 NEXT_INSTRUCTION(); 3932 3972 } … … 4001 4041 int argCount = vPC[2].u.operand; 4002 4042 int registerOffset = vPC[3].u.operand; 4003 int proto = vPC[4].u.operand;4004 int thisRegister = vPC[5].u.operand;4005 4043 4006 4044 JSValue v = callFrame->r(func).jsValue(); … … 4012 4050 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; 4013 4051 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 else4020 structure = callDataScopeChain->globalObject->emptyObjectStructure();4021 JSObject* newObject = new (globalData) JSObject(structure);4022 4023 callFrame->r(thisRegister) = JSValue(newObject); // "this" value4024 4052 4025 4053 CallFrame* previousCallFrame = callFrame; … … 4044 4072 4045 4073 if (constructType == ConstructTypeHost) { 4046 ArgList args(callFrame->registers() + thisRegister + 1, argCount - 1);4047 4048 4074 ScopeChainNode* scopeChain = callFrame->scopeChain(); 4049 4075 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset); 4050 4076 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); 4051 4080 4052 4081 JSValue returnValue;
Note:
See TracChangeset
for help on using the changeset viewer.