Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 10e423b5b9537f9b7841f2aa2f17c5eccc8b7cec..ef7dc1d12d91d44cc7eef5b1597d8be8b4339cce 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -1,4 +1,4 @@ |
-// Copyright 2011 the V8 project authors. All rights reserved. |
+// Copyright 2012 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -2742,12 +2742,38 @@ void MacroAssembler::StoreNumberToDoubleElements( |
void MacroAssembler::CheckMap(Register obj, |
Handle<Map> map, |
Label* fail, |
- SmiCheckType smi_check_type) { |
+ SmiCheckType smi_check_type, |
+ MapCheckMode mode) { |
if (smi_check_type == DO_SMI_CHECK) { |
JumpIfSmi(obj, fail); |
} |
+ |
+ Label success; |
Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
+ if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { |
fschneider
2012/01/04 09:20:18
The following code is the same as in lithium-codeg
danno
2012/01/04 10:42:15
Done.
|
+ bool ignore; |
+ Map* transitioned_double_map = |
+ map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, &ignore); |
+ ASSERT(transitioned_double_map == NULL || |
+ map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); |
+ Map* transitioned_fast_element_map = |
+ map->LookupElementsTransitionMap(FAST_ELEMENTS, &ignore); |
+ ASSERT(transitioned_fast_element_map == NULL || |
+ map->elements_kind() != FAST_ELEMENTS); |
+ if (transitioned_fast_element_map != NULL) { |
+ j(equal, &success, Label::kNear); |
+ Cmp(FieldOperand(obj, HeapObject::kMapOffset), |
+ Handle<Map>(transitioned_fast_element_map)); |
+ } |
+ |
+ if (transitioned_double_map != NULL) { |
+ j(equal, &success, Label::kNear); |
+ Cmp(FieldOperand(obj, HeapObject::kMapOffset), |
+ Handle<Map>(transitioned_double_map)); |
+ } |
+ } |
j(not_equal, fail); |
+ bind(&success); |
} |