本文整理汇总了C++中CallFrame::vm方法的典型用法代码示例。如果您正苦于以下问题:C++ CallFrame::vm方法的具体用法?C++ CallFrame::vm怎么用?C++ CallFrame::vm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CallFrame
的用法示例。
在下文中一共展示了CallFrame::vm方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
Arguments* StackVisitor::Frame::createArguments()
{
ASSERT(m_callFrame);
CallFrame* physicalFrame = m_callFrame;
VM& vm = physicalFrame->vm();
Arguments* arguments;
ArgumentsMode mode;
if (Options::enableFunctionDotArguments())
mode = ClonedArgumentsCreationMode;
else
mode = FakeArgumentValuesCreationMode;
#if ENABLE(DFG_JIT)
if (isInlinedFrame()) {
ASSERT(m_inlineCallFrame);
arguments = Arguments::create(vm, physicalFrame, m_inlineCallFrame, mode);
arguments->tearOff(physicalFrame, m_inlineCallFrame);
jsCast<Arguments*>((JSCell*)arguments);
} else
#endif
{
JSLexicalEnvironment* lexicalEnvironment = nullptr;
arguments = Arguments::create(vm, physicalFrame, lexicalEnvironment, mode);
arguments->tearOff(physicalFrame);
}
return arguments;
}
示例2: evaluateNonBlocking
JSValue DebuggerCallFrame::evaluateNonBlocking(const String& script, NakedPtr<Exception>& exception)
{
ASSERT(isValid());
CallFrame* callFrame = m_callFrame;
if (!callFrame)
return jsNull();
if (!callFrame->codeBlock())
return JSValue();
DebuggerEvalEnabler evalEnabler(callFrame);
VM& vm = callFrame->vm();
auto& codeBlock = *callFrame->codeBlock();
ThisTDZMode thisTDZMode = codeBlock.unlinkedCodeBlock()->constructorKind() == ConstructorKind::Derived ? ThisTDZMode::AlwaysCheck : ThisTDZMode::CheckIfNeeded;
VariableEnvironment variablesUnderTDZ;
JSScope::collectVariablesUnderTDZ(scope()->jsScope(), variablesUnderTDZ);
EvalExecutable* eval = EvalExecutable::create(callFrame, makeSource(script), codeBlock.isStrictMode(), thisTDZMode, codeBlock.unlinkedCodeBlock()->isDerivedConstructorContext(), codeBlock.unlinkedCodeBlock()->isArrowFunction(), &variablesUnderTDZ);
if (vm.exception()) {
exception = vm.exception();
vm.clearException();
return jsUndefined();
}
JSValue thisValue = thisValueForCallFrame(callFrame);
JSValue result = vm.interpreter->execute(eval, callFrame, thisValue, scope()->jsScope());
if (vm.exception()) {
exception = vm.exception();
vm.clearException();
}
ASSERT(result);
return result;
}
示例3: evaluate
// Evaluate some JavaScript code in the scope of this frame.
JSValue DebuggerCallFrame::evaluate(const String& script, JSValue& exception)
{
ASSERT(isValid());
CallFrame* callFrame = m_callFrame;
if (!callFrame)
return jsNull();
JSLockHolder lock(callFrame);
if (!callFrame->codeBlock())
return JSValue();
VM& vm = callFrame->vm();
EvalExecutable* eval = EvalExecutable::create(callFrame, makeSource(script), callFrame->codeBlock()->isStrictMode());
if (vm.exception()) {
exception = vm.exception();
vm.clearException();
return jsUndefined();
}
JSValue thisValue = thisValueForCallFrame(callFrame);
JSValue result = vm.interpreter->execute(eval, callFrame, thisValue, scope());
if (vm.exception()) {
exception = vm.exception();
vm.clearException();
}
ASSERT(result);
return result;
}
示例4: evaluateWithScopeExtension
// Evaluate some JavaScript code in the scope of this frame.
JSValue DebuggerCallFrame::evaluateWithScopeExtension(const String& script, JSObject* scopeExtensionObject, NakedPtr<Exception>& exception)
{
ASSERT(isValid());
CallFrame* callFrame = m_validMachineFrame;
if (!callFrame)
return jsUndefined();
VM& vm = callFrame->vm();
JSLockHolder lock(vm);
auto catchScope = DECLARE_CATCH_SCOPE(vm);
CodeBlock* codeBlock = nullptr;
if (isTailDeleted())
codeBlock = m_shadowChickenFrame.codeBlock;
else
codeBlock = callFrame->codeBlock();
if (!codeBlock)
return jsUndefined();
DebuggerEvalEnabler evalEnabler(callFrame);
EvalContextType evalContextType;
if (isFunctionParseMode(codeBlock->unlinkedCodeBlock()->parseMode()))
evalContextType = EvalContextType::FunctionEvalContext;
else if (codeBlock->unlinkedCodeBlock()->codeType() == EvalCode)
evalContextType = codeBlock->unlinkedCodeBlock()->evalContextType();
else
evalContextType = EvalContextType::None;
VariableEnvironment variablesUnderTDZ;
JSScope::collectClosureVariablesUnderTDZ(scope()->jsScope(), variablesUnderTDZ);
EvalExecutable* eval = DirectEvalExecutable::create(callFrame, makeSource(script), codeBlock->isStrictMode(), codeBlock->unlinkedCodeBlock()->derivedContextType(), codeBlock->unlinkedCodeBlock()->isArrowFunction(), evalContextType, &variablesUnderTDZ);
if (UNLIKELY(catchScope.exception())) {
exception = catchScope.exception();
catchScope.clearException();
return jsUndefined();
}
JSGlobalObject* globalObject = callFrame->vmEntryGlobalObject();
if (scopeExtensionObject) {
JSScope* ignoredPreviousScope = globalObject->globalScope();
globalObject->setGlobalScopeExtension(JSWithScope::create(vm, globalObject, scopeExtensionObject, ignoredPreviousScope));
}
JSValue thisValue = this->thisValue();
JSValue result = vm.interpreter->execute(eval, callFrame, thisValue, scope()->jsScope());
if (UNLIKELY(catchScope.exception())) {
exception = catchScope.exception();
catchScope.clearException();
}
if (scopeExtensionObject)
globalObject->clearGlobalScopeExtension();
ASSERT(result);
return result;
}
示例5: argumentsGetter
EncodedJSValue JSLexicalEnvironment::argumentsGetter(ExecState*, JSObject* slotBase, EncodedJSValue, PropertyName)
{
JSLexicalEnvironment* lexicalEnvironment = jsCast<JSLexicalEnvironment*>(slotBase);
CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(lexicalEnvironment->m_registers));
return JSValue::encode(jsUndefined());
VirtualRegister argumentsRegister = callFrame->codeBlock()->argumentsRegister();
if (JSValue arguments = callFrame->uncheckedR(argumentsRegister.offset()).jsValue())
return JSValue::encode(arguments);
int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister).offset();
JSValue arguments = JSValue(Arguments::create(callFrame->vm(), callFrame));
callFrame->uncheckedR(argumentsRegister.offset()) = arguments;
callFrame->uncheckedR(realArgumentsRegister) = arguments;
ASSERT(callFrame->uncheckedR(realArgumentsRegister).jsValue().inherits(Arguments::info()));
return JSValue::encode(callFrame->uncheckedR(realArgumentsRegister).jsValue());
}
示例6: ASSERT
Arguments* StackVisitor::Frame::createArguments()
{
ASSERT(m_callFrame);
CallFrame* physicalFrame = m_callFrame;
VM& vm = physicalFrame->vm();
Arguments* arguments;
#if ENABLE(DFG_JIT)
if (isInlinedFrame()) {
ASSERT(m_inlineCallFrame);
arguments = Arguments::create(vm, physicalFrame, m_inlineCallFrame);
arguments->tearOff(physicalFrame, m_inlineCallFrame);
} else
#endif
{
arguments = Arguments::create(vm, physicalFrame);
arguments->tearOff(physicalFrame);
}
return arguments;
}
示例7: argumentsGetter
JSValue JSActivation::argumentsGetter(ExecState*, JSValue slotBase, PropertyName)
{
JSActivation* activation = jsCast<JSActivation*>(slotBase);
if (activation->isTornOff())
return jsUndefined();
CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(activation->m_registers));
int argumentsRegister = callFrame->codeBlock()->argumentsRegister();
if (JSValue arguments = callFrame->uncheckedR(argumentsRegister).jsValue())
return arguments;
int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister);
JSValue arguments = JSValue(Arguments::create(callFrame->vm(), callFrame));
callFrame->uncheckedR(argumentsRegister) = arguments;
callFrame->uncheckedR(realArgumentsRegister) = arguments;
ASSERT(callFrame->uncheckedR(realArgumentsRegister).jsValue().inherits(Arguments::info()));
return callFrame->uncheckedR(realArgumentsRegister).jsValue();
}
示例8: argumentsGetter
EncodedJSValue JSActivation::argumentsGetter(ExecState*, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
{
JSActivation* activation = jsCast<JSActivation*>(JSValue::decode(slotBase));
CallFrame* callFrame = CallFrame::create(reinterpret_cast<Register*>(activation->m_registers));
ASSERT(!activation->isTornOff() && (callFrame->codeBlock()->usesArguments() || callFrame->codeBlock()->usesEval()));
if (activation->isTornOff() || !(callFrame->codeBlock()->usesArguments() || callFrame->codeBlock()->usesEval()))
return JSValue::encode(jsUndefined());
VirtualRegister argumentsRegister = callFrame->codeBlock()->argumentsRegister();
if (JSValue arguments = callFrame->uncheckedR(argumentsRegister.offset()).jsValue())
return JSValue::encode(arguments);
int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister).offset();
JSValue arguments = JSValue(Arguments::create(callFrame->vm(), callFrame));
callFrame->uncheckedR(argumentsRegister.offset()) = arguments;
callFrame->uncheckedR(realArgumentsRegister) = arguments;
ASSERT(callFrame->uncheckedR(realArgumentsRegister).jsValue().inherits(Arguments::info()));
return JSValue::encode(callFrame->uncheckedR(realArgumentsRegister).jsValue());
}