Merge "Fix GetOutVROffset to use correct Method* size."
diff --git a/build/Android.common.mk b/build/Android.common.mk
index d65f11a..aa167b2 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -222,14 +222,14 @@
   art_cflags += -DART_SEA_IR_MODE=1
 endif
 
-ifeq ($(HOST_OS),linux)
-  art_non_debug_cflags := \
-	-Wframe-larger-than=1728
-endif
-
 art_non_debug_cflags := \
 	-O3
 
+ifeq ($(HOST_OS),linux)
+  art_non_debug_cflags += \
+	-Wframe-larger-than=1728
+endif
+
 # FIXME: upstream LLVM has a vectorizer bug that needs to be fixed
 ART_TARGET_CLANG_CFLAGS_arm64 += \
 	-fno-vectorize
diff --git a/runtime/gc/accounting/space_bitmap.cc b/runtime/gc/accounting/space_bitmap.cc
index 8e817e5..3cb8d94 100644
--- a/runtime/gc/accounting/space_bitmap.cc
+++ b/runtime/gc/accounting/space_bitmap.cc
@@ -127,9 +127,17 @@
   }
 
   // TODO: rewrite the callbacks to accept a std::vector<mirror::Object*> rather than a mirror::Object**?
-  const size_t buffer_size = kWordSize * kBitsPerWord;
+  constexpr size_t buffer_size = kWordSize * kBitsPerWord;
+#ifdef __LP64__
+  // Heap-allocate for smaller stack frame.
+  std::unique_ptr<mirror::Object*[]> pointer_buf_ptr(new mirror::Object*[buffer_size]);
+  mirror::Object** pointer_buf = pointer_buf_ptr.get();
+#else
+  // Stack-allocate buffer as it's small enough.
   mirror::Object* pointer_buf[buffer_size];
+#endif
   mirror::Object** pb = &pointer_buf[0];
+
   size_t start = OffsetToIndex(sweep_begin - live_bitmap.heap_begin_);
   size_t end = OffsetToIndex(sweep_end - live_bitmap.heap_begin_ - 1);
   CHECK_LT(end, live_bitmap.Size() / kWordSize);