bool ScriptValue::isEqual(ScriptState* scriptState, const ScriptValue& anotherValue) const { if (hasNoValue()) return anotherValue.hasNoValue(); return JSValueIsEqual(toRef(scriptState), toRef(scriptState, jsValue()), toRef(scriptState, anotherValue.jsValue()), 0); }
// This method used to fill a JSValue to a GPR when linking speculative -> non-speculative. void JITCompiler::fillToJS(NodeIndex nodeIndex, GPRReg gpr) { Node& node = graph()[nodeIndex]; if (node.isArgument()) { loadPtr(addressForArgument(node.argumentNumber()), gprToRegisterID(gpr)); return; } if (node.isConstant()) { if (isInt32Constant(nodeIndex)) { JSValue jsValue = jsNumber(valueOfInt32Constant(nodeIndex)); move(MacroAssembler::ImmPtr(JSValue::encode(jsValue)), gprToRegisterID(gpr)); } else if (isDoubleConstant(nodeIndex)) { JSValue jsValue(JSValue::EncodeAsDouble, valueOfDoubleConstant(nodeIndex)); move(MacroAssembler::ImmPtr(JSValue::encode(jsValue)), gprToRegisterID(gpr)); } else { ASSERT(isJSConstant(nodeIndex)); JSValue jsValue = valueOfJSConstant(nodeIndex); move(MacroAssembler::ImmPtr(JSValue::encode(jsValue)), gprToRegisterID(gpr)); } return; } loadPtr(addressFor(node.virtualRegister), gprToRegisterID(gpr)); }
main() { int i; readDat(); jsValue(); writeDat(); for (i=0;i<cnt;i++) printf("b[%d]=%d\n",i,b[i]); }
main() { int i=0; readDat(); jsValue(); writeDat(); printf("cnt=%d\n满足条件的平均值pjz1=%7.2lf\n不满足条件的平均值pjz2=%7.2lf\n", cnt,pjz1,pjz2); }
void main() { int i,first; unsigned int initial_no = nondet_int(); unsigned int size = nondet_int(); __CPROVER_assume (size <= SIZE); jsValue(initial_no,size,array); first = array[0]; for(i=1;i<size;i++) { assert( array[i]<=first); first=array[i]; } }
void writeDat() { int *array; int i; int initial_no=-10; int size=5; array=(int *)malloc(sizeof(int)*size); jsValue(initial_no,size,array); for(i=0;i<size;i++) { printf("%d ",array[i]); } printf("\n"); return; }
CFXJSE_Value* CXFA_ScriptContext::GetJSValueFromMap(CXFA_Object* pObject) { if (!pObject) return nullptr; if (pObject->IsNode()) RunVariablesScript(pObject->AsNode()); auto iter = m_mapObjectToValue.find(pObject); if (iter != m_mapObjectToValue.end()) return iter->second.get(); std::unique_ptr<CFXJSE_Value> jsValue(new CFXJSE_Value(m_pIsolate)); jsValue->SetObject(pObject, m_pJsClass); CFXJSE_Value* pValue = jsValue.get(); m_mapObjectToValue.insert(std::make_pair(pObject, std::move(jsValue))); return pValue; }
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(ScriptState* scriptState, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, bool& didThrow) { JSValueRef exception = 0; RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(toRef(scriptState), toRef(scriptState, jsValue()), messagePorts, arrayBuffers, &exception); didThrow = exception ? true : false; return serializedValue.release(); }
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(ScriptState* scriptState, SerializationErrorMode throwExceptions) { return SerializedScriptValue::create(scriptState, jsValue(), 0, 0, throwExceptions); }
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(ScriptState* scriptState, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, bool& didThrow) { RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(scriptState, jsValue(), messagePorts, arrayBuffers); didThrow = scriptState->hadException(); return serializedValue.release(); }
PassRefPtr<SerializedScriptValue> ScriptValue::serialize(ScriptState* scriptState) { return SerializedScriptValue::create(scriptState, jsValue()); }
void ObjectWrapper::setBoolean(Key key, bool val) { JS::RootedValue jsValue(_context); jsValue.setBoolean(val); setValue(key, jsValue); }
void ObjectWrapper::setString(Key key, StringData val) { JS::RootedValue jsValue(_context); ValueReader(_context, &jsValue).fromStringData(val); setValue(key, jsValue); }
void ObjectWrapper::setNumber(Key key, double val) { JS::RootedValue jsValue(_context); ValueReader(_context, &jsValue).fromDouble(val); setValue(key, jsValue); }
main() { jsValue(); printf("M=100,n=%d\nM=1000,n=%d\nM=10000,n=%d\n",b[0],b[1],b[2]); }