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

Side by Side Diff: src/builtins.cc

Issue 551189: Propagate receiver from initial call site to code generator. (Closed)
Patch Set: Created 10 years, 11 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
OLDNEW
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // ---------------------------------------------------------------------------- 168 // ----------------------------------------------------------------------------
169 169
170 170
171 Handle<Code> Builtins::GetCode(JavaScript id, bool* resolved) { 171 Handle<Code> Builtins::GetCode(JavaScript id, bool* resolved) {
172 Code* code = Builtins::builtin(Builtins::Illegal); 172 Code* code = Builtins::builtin(Builtins::Illegal);
173 *resolved = false; 173 *resolved = false;
174 174
175 if (Top::context() != NULL) { 175 if (Top::context() != NULL) {
176 Object* object = Top::builtins()->javascript_builtin(id); 176 Object* object = Top::builtins()->javascript_builtin(id);
177 if (object->IsJSFunction()) { 177 if (object->IsJSFunction()) {
178 Handle<JSFunction> function(JSFunction::cast(object)); 178 Handle<SharedFunctionInfo> shared(JSFunction::cast(object)->shared());
179 // Make sure the number of parameters match the formal parameter count. 179 // Make sure the number of parameters match the formal parameter count.
180 ASSERT(function->shared()->formal_parameter_count() == 180 ASSERT(shared->formal_parameter_count() ==
181 Builtins::GetArgumentsCount(id)); 181 Builtins::GetArgumentsCount(id));
182 if (function->is_compiled() || CompileLazy(function, CLEAR_EXCEPTION)) { 182 if (EnsureCompiled(shared, CLEAR_EXCEPTION)) {
183 code = function->code(); 183 code = shared->code();
184 *resolved = true; 184 *resolved = true;
185 } 185 }
186 } 186 }
187 } 187 }
188 188
189 return Handle<Code>(code); 189 return Handle<Code>(code);
190 } 190 }
191 191
192 192
193 BUILTIN(Illegal) { 193 BUILTIN(Illegal) {
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 if (entry->contains(pc)) { 908 if (entry->contains(pc)) {
909 return names_[i]; 909 return names_[i];
910 } 910 }
911 } 911 }
912 } 912 }
913 return NULL; 913 return NULL;
914 } 914 }
915 915
916 916
917 } } // namespace v8::internal 917 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/compiler.h » ('j') | src/compiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698