| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); | 1131 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); |
| 1132 const int literals = fun->NumberOfLiterals(); | 1132 const int literals = fun->NumberOfLiterals(); |
| 1133 Handle<Code> code = Handle<Code>(fun->shared()->code()); | 1133 Handle<Code> code = Handle<Code>(fun->shared()->code()); |
| 1134 Handle<JSFunction> boilerplate = | 1134 Handle<JSFunction> boilerplate = |
| 1135 Factory::NewFunctionBoilerplate(name, literals, false, code); | 1135 Factory::NewFunctionBoilerplate(name, literals, false, code); |
| 1136 | 1136 |
| 1137 // Copy the function data to the boilerplate. Used by | 1137 // Copy the function data to the boilerplate. Used by |
| 1138 // builtins.cc:HandleApiCall to perform argument type checks and to | 1138 // builtins.cc:HandleApiCall to perform argument type checks and to |
| 1139 // find the right native code to call. | 1139 // find the right native code to call. |
| 1140 boilerplate->shared()->set_function_data(fun->shared()->function_data()); | 1140 boilerplate->shared()->set_function_data(fun->shared()->function_data()); |
| 1141 int parameters = fun->shared()->formal_parameter_count(); |
| 1142 boilerplate->shared()->set_formal_parameter_count(parameters); |
| 1141 | 1143 |
| 1142 // TODO(1240846): It's weird that native function declarations are | 1144 // TODO(1240846): It's weird that native function declarations are |
| 1143 // introduced dynamically when we meet their declarations, whereas | 1145 // introduced dynamically when we meet their declarations, whereas |
| 1144 // other functions are setup when entering the surrounding scope. | 1146 // other functions are setup when entering the surrounding scope. |
| 1145 FunctionBoilerplateLiteral* lit = | 1147 FunctionBoilerplateLiteral* lit = |
| 1146 NEW(FunctionBoilerplateLiteral(boilerplate)); | 1148 NEW(FunctionBoilerplateLiteral(boilerplate)); |
| 1147 VariableProxy* var = Declare(name, Variable::VAR, NULL, true, CHECK_OK); | 1149 VariableProxy* var = Declare(name, Variable::VAR, NULL, true, CHECK_OK); |
| 1148 return NEW(ExpressionStatement( | 1150 return NEW(ExpressionStatement( |
| 1149 new Assignment(Token::INIT_VAR, var, lit, kNoPosition))); | 1151 new Assignment(Token::INIT_VAR, var, lit, kNoPosition))); |
| 1150 } | 1152 } |
| (...skipping 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3253 start_position, | 3255 start_position, |
| 3254 is_expression); | 3256 is_expression); |
| 3255 return result; | 3257 return result; |
| 3256 } | 3258 } |
| 3257 | 3259 |
| 3258 | 3260 |
| 3259 #undef NEW | 3261 #undef NEW |
| 3260 | 3262 |
| 3261 | 3263 |
| 3262 } } // namespace v8::internal | 3264 } } // namespace v8::internal |
| OLD | NEW |