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

Unified Diff: src/arm/builtins-arm.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 | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index 8bc95bc7071e1ce5a956e0710bdb22a754ec4dbd..914233011a960f9a2ea1e88fdb8f2d68e3e454d4 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -1212,10 +1212,6 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register map = scratch1;
Register constructor = scratch2;
- // If the receiver is not an object, jump to receiver_check_failed.
- __ CompareObjectType(receiver, map, ip, FIRST_JS_OBJECT_TYPE);
- __ b(lo, receiver_check_failed);
-
// If there is no signature, return the holder.
__ ldr(signature, FieldMemOperand(function_template_info,
FunctionTemplateInfo::kSignatureOffset));
@@ -1284,21 +1280,13 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// -- sp[4 * argc] : receiver
// -----------------------------------
- // Load the receiver.
- __ ldr(r2, MemOperand(sp, r0, LSL, kPointerSizeLog2));
-
- // Update the receiver if this is a contextual call.
- Label set_global_proxy, valid_receiver;
- __ CompareRoot(r2, Heap::kUndefinedValueRootIndex);
- __ b(eq, &set_global_proxy);
- __ bind(&valid_receiver);
-
// Load the FunctionTemplateInfo.
__ ldr(r3, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kFunctionDataOffset));
// Do the compatible receiver check.
Label receiver_check_failed;
+ __ ldr(r2, MemOperand(sp, r0, LSL, kPointerSizeLog2));
CompatibleReceiverCheck(masm, r2, r3, r4, r5, r6, &receiver_check_failed);
// Get the callback offset from the FunctionTemplateInfo, and jump to the
@@ -1308,11 +1296,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ add(r4, r4, Operand(Code::kHeaderSize - kHeapObjectTag));
__ Jump(r4);
- __ bind(&set_global_proxy);
- __ LoadGlobalProxy(r2);
- __ str(r2, MemOperand(sp, r0, LSL, kPointerSizeLog2));
- __ b(&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 | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698