Merge branch 'reduce_function_scope_creation' into develop
This commit is contained in:
commit
b2b604e2ad
@ -1,10 +1,19 @@
|
|||||||
|
|
||||||
var my_array=["1", 4, 6.6l, 10ul, "1000", 100, 10.9f ];
|
def go()
|
||||||
|
|
||||||
for (var j = 0; j < 10000; ++j)
|
|
||||||
{
|
{
|
||||||
for (var i = 0; i < 6; ++i)
|
var my_array=["1", 4, 6.6l, 10ul, "1000", 100, 10.9f ];
|
||||||
|
|
||||||
|
var q = 0;
|
||||||
|
|
||||||
|
for (var j = 0; j < 10000; ++j)
|
||||||
{
|
{
|
||||||
to_string(my_array[i]);
|
for (var i = 0; i < 6; ++i)
|
||||||
|
{
|
||||||
|
to_string(my_array[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
q += j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go();
|
||||||
|
@ -90,9 +90,6 @@ namespace chaiscript
|
|||||||
Operators::Opers t_oper, const std::string &t_oper_string, const Boxed_Value &t_lhs, const Boxed_Value &t_rhs) const
|
Operators::Opers t_oper, const std::string &t_oper_string, const Boxed_Value &t_lhs, const Boxed_Value &t_rhs) const
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
chaiscript::eval::detail::Function_Push_Pop fpp(t_ss);
|
|
||||||
fpp.save_params({t_lhs, t_rhs});
|
|
||||||
|
|
||||||
if (t_oper != Operators::invalid && t_lhs.get_type_info().is_arithmetic() && t_rhs.get_type_info().is_arithmetic())
|
if (t_oper != Operators::invalid && t_lhs.get_type_info().is_arithmetic() && t_rhs.get_type_info().is_arithmetic())
|
||||||
{
|
{
|
||||||
// If it's an arithmetic operation we want to short circuit dispatch
|
// If it's an arithmetic operation we want to short circuit dispatch
|
||||||
@ -103,8 +100,9 @@ namespace chaiscript
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
throw exception::eval_error("Error with numeric operator calling: " + t_oper_string);
|
throw exception::eval_error("Error with numeric operator calling: " + t_oper_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
chaiscript::eval::detail::Function_Push_Pop fpp(t_ss);
|
||||||
|
fpp.save_params({t_lhs, t_rhs});
|
||||||
chaiscript::eval::detail::Stack_Push_Pop spp(t_ss);
|
chaiscript::eval::detail::Stack_Push_Pop spp(t_ss);
|
||||||
return t_ss.call_function(t_oper_string, t_lhs, t_rhs);
|
return t_ss.call_function(t_oper_string, t_lhs, t_rhs);
|
||||||
}
|
}
|
||||||
@ -1218,7 +1216,6 @@ namespace chaiscript
|
|||||||
|
|
||||||
virtual ~Prefix_AST_Node() {}
|
virtual ~Prefix_AST_Node() {}
|
||||||
virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) const CHAISCRIPT_OVERRIDE{
|
virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) const CHAISCRIPT_OVERRIDE{
|
||||||
chaiscript::eval::detail::Function_Push_Pop fpp(t_ss);
|
|
||||||
Boxed_Value bv(this->children[1]->eval(t_ss));
|
Boxed_Value bv(this->children[1]->eval(t_ss));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1227,6 +1224,7 @@ namespace chaiscript
|
|||||||
{
|
{
|
||||||
return Boxed_Number::do_oper(m_oper, std::move(bv));
|
return Boxed_Number::do_oper(m_oper, std::move(bv));
|
||||||
} else {
|
} else {
|
||||||
|
chaiscript::eval::detail::Function_Push_Pop fpp(t_ss);
|
||||||
chaiscript::eval::detail::Stack_Push_Pop spp(t_ss);
|
chaiscript::eval::detail::Stack_Push_Pop spp(t_ss);
|
||||||
fpp.save_params({bv});
|
fpp.save_params({bv});
|
||||||
return t_ss.call_function(this->children[0]->text, std::move(bv));
|
return t_ss.call_function(this->children[0]->text, std::move(bv));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user