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

Unified Diff: src/builtins.cc

Issue 2884: Stop adapting the arguments passed to the builtin implementations... (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 311)
+++ src/builtins.cc (working copy)
@@ -67,7 +67,7 @@
// and start calling the builtins in a more direct way. Looking at the
// stack frames for all builtin invocations comes with a pretty
// significant performance penalty.
-#define BUILTIN_0(name) \
+#define BUILTIN(name) \
static Object* Builtin_##name(int __argc__, \
Object** __argv__) { \
Handle<Object> receiver(&__argv__[0]); \
@@ -95,21 +95,15 @@
}
-#define BUILTIN_1(name, a0) \
- BUILTIN_0(name) \
- Object* a0 = BUILTIN_ARG(1);
+// We're transitioning to a much simpler builtins framework where all
+// builtins are called *without* arguments adaption. For now, only a
+// few of the builtins have been rewritten to support this and they
+// all use the NEW_BUILTIN macro instead of plain old BUILTIN.
+#define NEW_BUILTIN(name) \
+ static Object* Builtin_##name(int __argc__, Object** __argv__) { \
+ Handle<Object> receiver(&__argv__[0]);
-#define BUILTIN_2(name, a0, a1) \
- BUILTIN_1(name, a0) \
- Object* a1 = BUILTIN_ARG(2);
-
-
-#define BUILTIN_3(name, a0, a1, a2) \
- BUILTIN_2(name, a0, a1) \
- Object* a2 = BUILTIN_ARG(3);
-
-
// Use an inline function to avoid evaluating the index (n) more than
// once in the BUILTIN_ARG macro.
static inline Object* __builtin_arg__(int n, int argc, Object** argv) {
@@ -172,18 +166,18 @@
}
-BUILTIN_0(Illegal) {
+BUILTIN(Illegal) {
UNREACHABLE();
}
BUILTIN_END
-BUILTIN_0(EmptyFunction) {
+BUILTIN(EmptyFunction) {
}
BUILTIN_END
-BUILTIN_0(ArrayCode) {
+BUILTIN(ArrayCode) {
JSArray* array;
if (is_construct) {
array = JSArray::cast(*receiver);
@@ -241,7 +235,7 @@
BUILTIN_END
-BUILTIN_0(ArrayPush) {
+NEW_BUILTIN(ArrayPush) {
JSArray* array = JSArray::cast(*receiver);
ASSERT(array->HasFastElements());
@@ -280,7 +274,7 @@
BUILTIN_END
-BUILTIN_0(ArrayPop) {
+NEW_BUILTIN(ArrayPop) {
JSArray* array = JSArray::cast(*receiver);
ASSERT(array->HasFastElements());
Object* undefined = Heap::undefined_value();
@@ -365,7 +359,7 @@
}
-BUILTIN_0(HandleApiCall) {
+BUILTIN(HandleApiCall) {
HandleScope scope;
// TODO(1238487): This is not nice. We need to get rid of this
@@ -445,7 +439,7 @@
// Handle calls to non-function objects created through the API that
// support calls.
-BUILTIN_0(HandleApiCallAsFunction) {
+BUILTIN(HandleApiCallAsFunction) {
// Non-functions are never called as constructors.
ASSERT(!is_construct);
« 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