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

Unified Diff: src/mips/builtins-mips.cc

Issue 7062007: Avoid calling ToObject on JSFunction receiver arguments for Function.call and Function.apply. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add static asserts. Created 9 years, 7 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/ia32/builtins-ia32.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/builtins-mips.cc
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
index fdcb7c73c0ff65fdb67a111805c23e365c8bc32b..732915f0132a92f315d27ad53ed53861a36a6ef0 100644
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -1222,9 +1222,10 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ LoadRoot(a3, Heap::kNullValueRootIndex);
__ Branch(&use_global_receiver, eq, a2, Operand(a3));
+ STATIC_ASSERT(LAST_JS_OBJECT_TYPE + 1 == LAST_TYPE);
+ STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
__ GetObjectType(a2, a3, a3);
- __ Branch(&convert_to_object, lt, a3, Operand(FIRST_JS_OBJECT_TYPE));
- __ Branch(&shift_arguments, le, a3, Operand(LAST_JS_OBJECT_TYPE));
+ __ Branch(&shift_arguments, ge, a3, Operand(FIRST_JS_OBJECT_TYPE));
__ bind(&convert_to_object);
__ EnterInternalFrame(); // In order to preserve argument count.
@@ -1401,9 +1402,10 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
// Check if the receiver is already a JavaScript object.
// a0: receiver
+ STATIC_ASSERT(LAST_JS_OBJECT_TYPE + 1 == LAST_TYPE);
+ STATIC_ASSERT(LAST_TYPE == JS_FUNCTION_TYPE);
__ GetObjectType(a0, a1, a1);
- __ Branch(&call_to_object, lt, a1, Operand(FIRST_JS_OBJECT_TYPE));
- __ Branch(&push_receiver, le, a1, Operand(LAST_JS_OBJECT_TYPE));
+ __ Branch(&push_receiver, ge, a1, Operand(FIRST_JS_OBJECT_TYPE));
// Convert the receiver to a regular object.
// a0: receiver
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698