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

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

Issue 6894003: Better support for 'polymorphic' JS and external arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: new strategy Created 9 years, 8 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
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 339420679184b15ead2d8a4921d07368eeb86106..fc9840edfcfce4b4d86a10a7032d2c31bfe1fc08 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -1896,6 +1896,36 @@ void MacroAssembler::CheckMap(Register obj,
}
+void MacroAssembler::CheckMaps(Register obj,
+ ZoneMapList* receiver_maps,
+ Label* fail,
+ bool is_heap_object) {
+ if (!is_heap_object) {
+ testb(obj, Immediate(kSmiTagMask));
+ j(zero, fail);
+ }
+
+ // Check that the map matches.
+ if (receiver_maps->length() == 0) {
+ jmp(fail);
+ } else if (receiver_maps->length() == 1) {
+ Cmp(FieldOperand(obj, HeapObject::kMapOffset), receiver_maps->at(0));
+ j(not_equal, fail);
+ } else {
+ NearLabel map_match;
+ for (int current = 0; current < receiver_maps->length() - 1; ++current) {
+ Handle<Map> current_map = receiver_maps->at(current);
+ Cmp(FieldOperand(obj, HeapObject::kMapOffset), current_map);
+ j(equal, &map_match);
+ }
+ Cmp(FieldOperand(obj, HeapObject::kMapOffset),
+ receiver_maps->at(receiver_maps->length()-1));
+ j(not_equal, fail);
+ bind(&map_match);
+ }
+}
+
+
void MacroAssembler::AbortIfNotNumber(Register object) {
NearLabel ok;
Condition is_smi = CheckSmi(object);
« src/ic.cc ('K') | « src/x64/macro-assembler-x64.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698