Changed Array.prototype.sort to use quick sort.

Fixed code generation issue where leaving a finally block with break or continue would accumulate elements on the expression stack (issue 86).

Made sure that the name accessor on functions returns the expected names for builtin JavaScript functions and C++ callback functions.

Added fast case code for extending the property storage array of JavaScript objects.

Ported switch statement optimizations introduced in version 0.3.3 to the ARM code generator.

Allowed GCC to use strict-aliasing rules when compiling.

Improved performance of arguments object allocation by taking care of arguments adaptor frames in the generated code.

Updated the V8 benchmark suite to version 2.


git-svn-id: http://v8.googlecode.com/svn/trunk@439 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/macro-assembler-arm.cc b/src/macro-assembler-arm.cc
index 5e5b9c9..a6c336f 100644
--- a/src/macro-assembler-arm.cc
+++ b/src/macro-assembler-arm.cc
@@ -690,12 +690,24 @@
 }
 
 
+void MacroAssembler::IllegalOperation(int num_arguments) {
+  if (num_arguments > 0) {
+    add(sp, sp, Operand(num_arguments * kPointerSize));
+  }
+  mov(r0, Operand(Factory::undefined_value()));
+}
+
+
 void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
   // All parameters are on the stack.  r0 has the return value after call.
 
-  // Either the expected number of arguments is unknown, or the actual
-  // number of arguments match the expectation.
-  ASSERT(f->nargs < 0 || f->nargs == num_arguments);
+  // If the expected number of arguments of the runtime function is
+  // constant, we check that the actual number of arguments match the
+  // expectation.
+  if (f->nargs >= 0 && f->nargs != num_arguments) {
+    IllegalOperation(num_arguments);
+    return;
+  }
 
   Runtime::FunctionId function_id =
       static_cast<Runtime::FunctionId>(f->stub_id);