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

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

Issue 1576423003: Fix the receiver check in the HandleFastApiCall builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. 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/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/builtins-arm64.cc
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc
index 506140d2bede6a26f2b39dbda53b50edcdd194b1..b6bae4ad0edc308cfb6d09b3628a05efdadec06f 100644
--- a/src/arm64/builtins-arm64.cc
+++ b/src/arm64/builtins-arm64.cc
@@ -1286,17 +1286,10 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
__ B(eq, &receiver_check_passed);
// Walk the prototype chain.
+ __ Ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
Label prototype_loop_start;
__ Bind(&prototype_loop_start);
- // End if the receiver is null or if it's a hidden type.
- __ CompareRoot(receiver, Heap::kNullValueRootIndex);
- __ B(eq, receiver_check_failed);
- __ Ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
- __ Ldr(x16, FieldMemOperand(map, Map::kBitField3Offset));
- __ Tst(x16, Operand(Map::IsHiddenPrototype::kMask));
- __ B(ne, receiver_check_failed);
-
// Get the constructor, if any
__ GetMapConstructor(constructor, map, x16, x16);
__ cmp(x16, Operand(JS_FUNCTION_TYPE));
@@ -1326,9 +1319,17 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
FieldMemOperand(type, FunctionTemplateInfo::kParentTemplateOffset));
__ B(&function_template_loop);
- // Load the next prototype and iterate.
+ // Load the next prototype.
__ Bind(&next_prototype);
__ Ldr(receiver, FieldMemOperand(map, Map::kPrototypeOffset));
+ // End if the prototype is null or not hidden.
+ __ CompareRoot(receiver, Heap::kNullValueRootIndex);
+ __ B(eq, receiver_check_failed);
+ __ Ldr(map, FieldMemOperand(receiver, HeapObject::kMapOffset));
+ __ Ldr(x16, FieldMemOperand(map, Map::kBitField3Offset));
+ __ Tst(x16, Operand(Map::IsHiddenPrototype::kMask));
+ __ B(eq, receiver_check_failed);
+ // Iterate.
__ B(&prototype_loop_start);
__ Bind(&receiver_check_passed);
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698