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

Unified Diff: src/arm/full-codegen-arm.cc

Issue 754863002: Optimize testing for an index's existence in packed Arrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: All fixed Created 6 years, 1 month 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 | src/arm64/full-codegen-arm64.cc » ('j') | src/runtime/runtime.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index fbf3fec6c885ac0f23605ba0b02d93115a996593..57a1e39cbc55b68ec2333dc4265b409bc4fe2205 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -4378,6 +4378,40 @@ void FullCodeGenerator::EmitDebugIsActive(CallRuntime* expr) {
}
+void FullCodeGenerator::EmitHasFastPackedElements(CallRuntime* expr) {
+ ZoneList<Expression*>* args = expr->arguments();
+ DCHECK(args->length() == 1);
+
+ VisitForAccumulatorValue(args->at(0));
+
+ Label materialize_true, materialize_false;
+ Label* if_true = NULL;
+ Label* if_false = NULL;
+ Label* fall_through = NULL;
+ context()->PrepareTest(&materialize_true, &materialize_false, &if_true,
+ &if_false, &fall_through);
+
+ Register object = r0;
+ Register map = r1;
+ Register elements_kind = r2;
+
+ __ JumpIfSmi(object, if_false);
+ __ ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
+ __ ldrb(elements_kind, FieldMemOperand(map, Map::kBitField2Offset));
+ __ mov(elements_kind,
+ Operand(elements_kind, LSR, Map::ElementsKindBits::kShift));
+ __ cmp(elements_kind, Operand(FAST_SMI_ELEMENTS));
+ __ b(eq, if_true);
+ __ cmp(elements_kind, Operand(FAST_ELEMENTS));
+ __ b(eq, if_true);
+ __ cmp(elements_kind, Operand(FAST_DOUBLE_ELEMENTS));
+ PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
+ Split(eq, if_true, if_false, fall_through);
+
+ context()->Plug(if_true, if_false);
+}
+
+
void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
if (expr->function() != NULL &&
expr->function()->intrinsic_type == Runtime::INLINE) {
« no previous file with comments | « no previous file | src/arm64/full-codegen-arm64.cc » ('j') | src/runtime/runtime.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698