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

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 1228063004: Fix keyed element access wrt string wrappers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/objects.cc ('k') | test/mjsunit/regress/regress-4296.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 5a3e6db59191731d78094ee54c0e508eadf17cfc..9b4f4301af2ee5c6fb56b9e67f0f358b49302d5e 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -5044,13 +5044,21 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain(
DCHECK(!(scratch0.is(kScratchRegister) && scratch1.is(kScratchRegister)));
DCHECK(!scratch1.is(scratch0));
Register current = scratch0;
- Label loop_again;
+ Label loop_again, end;
movp(current, object);
+ movp(current, FieldOperand(current, HeapObject::kMapOffset));
+ movp(current, FieldOperand(current, Map::kPrototypeOffset));
+ CompareRoot(current, Heap::kNullValueRootIndex);
+ j(equal, &end);
// Loop based on the map going up the prototype chain.
bind(&loop_again);
movp(current, FieldOperand(current, HeapObject::kMapOffset));
+ STATIC_ASSERT(JS_PROXY_TYPE < JS_OBJECT_TYPE);
+ STATIC_ASSERT(JS_VALUE_TYPE < JS_OBJECT_TYPE);
+ CmpInstanceType(current, JS_OBJECT_TYPE);
+ j(below, found);
movp(scratch1, FieldOperand(current, Map::kBitField2Offset));
DecodeField<Map::ElementsKindBits>(scratch1);
cmpp(scratch1, Immediate(DICTIONARY_ELEMENTS));
@@ -5058,6 +5066,8 @@ void MacroAssembler::JumpIfDictionaryInPrototypeChain(
movp(current, FieldOperand(current, Map::kPrototypeOffset));
CompareRoot(current, Heap::kNullValueRootIndex);
j(not_equal, &loop_again);
+
+ bind(&end);
}
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/regress/regress-4296.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698