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

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

Issue 1583893002: PPC: [builtins] Sanitize receiver patching for API functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index 151a7421f80f30eb1bed7d77eb90019339643c46..7c683096bc9c3c26babfa365122bbaec2ca7c8b3 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -1211,9 +1211,6 @@ void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
Register constructor = r9;
Register scratch = r10;
- __ CompareObjectType(receiver, map, no_reg, FIRST_JS_OBJECT_TYPE);
- __ blt(receiver_check_failed);
-
// If there is no signature, return the holder.
__ LoadP(signature, FieldMemOperand(function_template_info,
FunctionTemplateInfo::kSignatureOffset));
@@ -1283,21 +1280,15 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
// -- sp[4 * argc] : receiver
// -----------------------------------
- // Load the receiver.
- __ ShiftLeftImm(r11, r3, Operand(kPointerSizeLog2));
- __ LoadPX(r5, MemOperand(sp, r11));
-
- // Update the receiver if this is a contextual call.
- Label set_global_proxy, valid_receiver;
- __ JumpIfRoot(r5, Heap::kUndefinedValueRootIndex, &set_global_proxy);
// Load the FunctionTemplateInfo.
- __ bind(&valid_receiver);
__ LoadP(r6, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
__ LoadP(r6, FieldMemOperand(r6, SharedFunctionInfo::kFunctionDataOffset));
// Do the compatible receiver check.
Label receiver_check_failed;
+ __ ShiftLeftImm(r11, r3, Operand(kPointerSizeLog2));
+ __ LoadPX(r5, MemOperand(sp, r11));
CompatibleReceiverCheck(masm, r5, r6, &receiver_check_failed);
// Get the callback offset from the FunctionTemplateInfo, and jump to the
@@ -1307,11 +1298,6 @@ void Builtins::Generate_HandleFastApiCall(MacroAssembler* masm) {
__ addi(ip, r7, Operand(Code::kHeaderSize - kHeapObjectTag));
__ JumpToJSEntry(ip);
- __ bind(&set_global_proxy);
- __ LoadGlobalProxy(r5);
- __ StorePX(r5, MemOperand(sp, r11));
- __ 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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698