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

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

Issue 1575973006: [builtins] Sanitize receiver patching for API functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. MIPS fixes. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.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 590543ab68153c848a847aad0041f0712fe15c46..e65b7d1cfa24b449d3b6ee35706e07cd0173aa96 100644
--- a/src/mips/builtins-mips.cc
+++ b/src/mips/builtins-mips.cc
@@ -1226,10 +1226,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register constructor = t4;
Register scratch = t5;
- // If the receiver is not an object, jump to receiver_check_failed.
- __ GetObjectType(receiver, map, scratch);
- __ Branch(receiver_check_failed, lo, scratch, Operand(FIRST_JS_OBJECT_TYPE));
-
// If there is no signature, return the holder.
__ lw(signature, FieldMemOperand(function_template_info,
FunctionTemplateInfo::kSignatureOffset));
@@ -1296,22 +1292,15 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// -- sp[4 * argc] : receiver
// -----------------------------------
- // Load the receiver.
- __ sll(at, a0, kPointerSizeLog2);
- __ Addu(t8, sp, at);
- __ lw(t0, MemOperand(t8));
-
- // Update the receiver if this is a contextual call.
- Label set_global_proxy, valid_receiver;
- __ JumpIfRoot(t0, Heap::kUndefinedValueRootIndex, &set_global_proxy);
-
// Load the FunctionTemplateInfo.
- __ bind(&valid_receiver);
__ lw(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
__ lw(t1, FieldMemOperand(t1, SharedFunctionInfo::kFunctionDataOffset));
// Do the compatible receiver check.
Label receiver_check_failed;
+ __ sll(at, a0, kPointerSizeLog2);
+ __ Addu(t8, sp, at);
+ __ lw(t0, MemOperand(t8));
CompatibleReceiverCheck(masm, t0, t1, &receiver_check_failed);
// Get the callback offset from the FunctionTemplateInfo, and jump to the
@@ -1321,11 +1310,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ Addu(t2, t2, Operand(Code::kHeaderSize - kHeapObjectTag));
__ Jump(t2);
- __ bind(&set_global_proxy);
- __ LoadGlobalProxy(t0);
- __ sw(t0, MemOperand(t8));
- __ Branch(&valid_receiver);
-
// Compatible receiver check failed: throw an Illegal Invocation exception.
__ bind(&receiver_check_failed);
// Drop the arguments (including the receiver);
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698