Changeset 60075 in webkit for trunk/JavaScriptCore/interpreter
- Timestamp:
- May 24, 2010, 11:46:49 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r59980 r60075 3840 3840 vPC = callFrame->returnPC(); 3841 3841 callFrame = callFrame->callerFrame(); 3842 codeBlock = callFrame->codeBlock(); 3842 3843 3843 3844 if (callFrame->hasHostCallFrameFlag()) … … 3884 3885 vPC = callFrame->returnPC(); 3885 3886 callFrame = callFrame->callerFrame(); 3887 codeBlock = callFrame->codeBlock(); 3886 3888 3887 3889 if (callFrame->hasHostCallFrameFlag()) … … 3929 3931 3930 3932 vPC += OPCODE_LENGTH(op_enter_with_activation); 3933 NEXT_INSTRUCTION(); 3934 } 3935 DEFINE_OPCODE(op_get_callee) { 3936 /* op_get_callee callee(r) 3937 3938 Move callee into a register. 3939 */ 3940 3941 callFrame->r(vPC[1].u.operand) = callFrame->callee(); 3942 3943 vPC += OPCODE_LENGTH(op_get_callee); 3944 NEXT_INSTRUCTION(); 3945 } 3946 DEFINE_OPCODE(op_create_this) { 3947 /* op_create_this this(r) proto(r) 3948 3949 Allocate an object as 'this', fr use in construction. 3950 3951 This opcode should only be used at the beginning of a code 3952 block. 3953 */ 3954 3955 int thisRegister = vPC[1].u.operand; 3956 int protoRegister = vPC[2].u.operand; 3957 3958 JSFunction* constructor = asFunction(callFrame->callee()); 3959 #if !ASSERT_DISABLED 3960 ConstructData constructData; 3961 ASSERT(constructor->getConstructData(constructData) == ConstructTypeJS); 3962 #endif 3963 3964 Structure* structure; 3965 JSValue proto = callFrame->r(protoRegister).jsValue(); 3966 if (proto.isObject()) 3967 structure = asObject(proto)->inheritorID(); 3968 else 3969 structure = constructor->scope().node()->globalObject->emptyObjectStructure(); 3970 callFrame->r(thisRegister) = new (&callFrame->globalData()) JSObject(structure); 3971 3972 vPC += OPCODE_LENGTH(op_create_this); 3931 3973 NEXT_INSTRUCTION(); 3932 3974 } … … 4001 4043 int argCount = vPC[2].u.operand; 4002 4044 int registerOffset = vPC[3].u.operand; 4003 int proto = vPC[4].u.operand;4004 int thisRegister = vPC[5].u.operand;4005 4045 4006 4046 JSValue v = callFrame->r(func).jsValue(); … … 4012 4052 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; 4013 4053 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 4054 4025 4055 CallFrame* previousCallFrame = callFrame; … … 4044 4074 4045 4075 if (constructType == ConstructTypeHost) { 4046 ArgList args(callFrame->registers() + thisRegister + 1, argCount - 1);4047 4048 4076 ScopeChainNode* scopeChain = callFrame->scopeChain(); 4049 4077 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset); 4050 4078 newCallFrame->init(0, vPC + OPCODE_LENGTH(op_construct), scopeChain, callFrame, 0, argCount, 0); 4079 4080 Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount; 4081 ArgList args(thisRegister + 1, argCount - 1); 4051 4082 4052 4083 JSValue returnValue;
Note:
See TracChangeset
for help on using the changeset viewer.