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

Unified Diff: src/mips64/builtins-mips64.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/mips/builtins-mips.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/mips64/builtins-mips64.cc
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc
index 9fc60ddfe74fa4eebd52e66a9dcfe27bbdd38aff..188eb16c14f925762c1ed960952e624fe467cb54 100644
--- a/src/mips64/builtins-mips64.cc
+++ b/src/mips64/builtins-mips64.cc
@@ -1217,10 +1217,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register constructor = a4;
Register scratch = a5;
- // 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.
__ ld(signature, FieldMemOperand(function_template_info,
FunctionTemplateInfo::kSignatureOffset));
@@ -1287,22 +1283,15 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// -- sp[8 * argc] : receiver
// -----------------------------------
- // Load the receiver.
- __ sll(at, a0, kPointerSizeLog2);
- __ Daddu(t8, sp, at);
- __ ld(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.
__ ld(t1, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
- __ bind(&valid_receiver);
__ ld(t1, FieldMemOperand(t1, SharedFunctionInfo::kFunctionDataOffset));
// Do the compatible receiver check
Label receiver_check_failed;
+ __ sll(at, a0, kPointerSizeLog2);
+ __ Daddu(t8, sp, at);
+ __ ld(t0, MemOperand(t8));
CompatibleReceiverCheck(masm, t0, t1, &receiver_check_failed);
// Get the callback offset from the FunctionTemplateInfo, and jump to the
@@ -1312,11 +1301,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ Daddu(t2, t2, Operand(Code::kHeaderSize - kHeapObjectTag));
__ Jump(t2);
- __ bind(&set_global_proxy);
- __ LoadGlobalProxy(t0);
- __ sd(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/mips/builtins-mips.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698