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

Unified Diff: src/builtins.cc

Issue 1930: Adapt to new calling convention on ARM. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins.h ('k') | src/builtins-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
===================================================================
--- src/builtins.cc (revision 288)
+++ src/builtins.cc (working copy)
@@ -155,6 +155,28 @@
}
+Handle<Code> Builtins::GetCode(JavaScript id, bool* resolved) {
+ Code* code = Builtins::builtin(Builtins::Illegal);
+ *resolved = false;
+
+ if (Top::security_context() != NULL) {
+ Object* object = Top::security_context_builtins()->javascript_builtin(id);
+ if (object->IsJSFunction()) {
+ Handle<JSFunction> function(JSFunction::cast(object));
+ // Make sure the number of parameters match the formal parameter count.
+ ASSERT(function->shared()->formal_parameter_count() ==
+ Builtins::GetArgumentsCount(id));
+ if (function->is_compiled() || CompileLazy(function, CLEAR_EXCEPTION)) {
+ code = function->code();
+ *resolved = true;
+ }
+ }
+ }
+
+ return Handle<Code>(code);
+}
+
+
BUILTIN_0(Illegal) {
UNREACHABLE();
}
@@ -354,13 +376,8 @@
// TODO(1238487): This is not nice. We need to get rid of this
// kludgy behavior and start handling API calls in a more direct
// way - maybe compile specialized stubs lazily?.
-#ifdef USE_OLD_CALLING_CONVENTIONS
Handle<JSFunction> function =
- Handle<JSFunction>(JSFunction::cast(__argv__[1]));
-#else
- Handle<JSFunction> function =
Handle<JSFunction>(JSFunction::cast(Builtins::builtin_passed_function));
-#endif
if (is_construct) {
Handle<FunctionTemplateInfo> desc =
« no previous file with comments | « src/builtins.h ('k') | src/builtins-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698