Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/parser.cc

Issue 2918001: Move serialized scope info from Code object to SharedFunctionInfo. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | src/profile-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 // Compute the function template for the native function. 1961 // Compute the function template for the native function.
1962 v8::Handle<v8::FunctionTemplate> fun_template = 1962 v8::Handle<v8::FunctionTemplate> fun_template =
1963 extension_->GetNativeFunction(v8::Utils::ToLocal(name)); 1963 extension_->GetNativeFunction(v8::Utils::ToLocal(name));
1964 ASSERT(!fun_template.IsEmpty()); 1964 ASSERT(!fun_template.IsEmpty());
1965 1965
1966 // Instantiate the function and create a shared function info from it. 1966 // Instantiate the function and create a shared function info from it.
1967 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction()); 1967 Handle<JSFunction> fun = Utils::OpenHandle(*fun_template->GetFunction());
1968 const int literals = fun->NumberOfLiterals(); 1968 const int literals = fun->NumberOfLiterals();
1969 Handle<Code> code = Handle<Code>(fun->shared()->code()); 1969 Handle<Code> code = Handle<Code>(fun->shared()->code());
1970 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub()); 1970 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub());
1971 Handle<SharedFunctionInfo> shared = 1971 Handle<SharedFunctionInfo> shared = Factory::NewSharedFunctionInfo(
1972 Factory::NewSharedFunctionInfo(name, literals, code); 1972 name, literals, code, Handle<Object>(fun->shared()->scope_info()));
1973 shared->set_construct_stub(*construct_stub); 1973 shared->set_construct_stub(*construct_stub);
1974 1974
1975 // Copy the function data to the shared function info. 1975 // Copy the function data to the shared function info.
1976 shared->set_function_data(fun->shared()->function_data()); 1976 shared->set_function_data(fun->shared()->function_data());
1977 int parameters = fun->shared()->formal_parameter_count(); 1977 int parameters = fun->shared()->formal_parameter_count();
1978 shared->set_formal_parameter_count(parameters); 1978 shared->set_formal_parameter_count(parameters);
1979 1979
1980 // TODO(1240846): It's weird that native function declarations are 1980 // TODO(1240846): It's weird that native function declarations are
1981 // introduced dynamically when we meet their declarations, whereas 1981 // introduced dynamically when we meet their declarations, whereas
1982 // other functions are setup when entering the surrounding scope. 1982 // other functions are setup when entering the surrounding scope.
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
5196 parser.ParseLazy(script_source, name, 5196 parser.ParseLazy(script_source, name,
5197 start_position, end_position, is_expression); 5197 start_position, end_position, is_expression);
5198 return result; 5198 return result;
5199 } 5199 }
5200 5200
5201 5201
5202 #undef NEW 5202 #undef NEW
5203 5203
5204 5204
5205 } } // namespace v8::internal 5205 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698