OSDN Git Service

Fix CreateLinearAlloc bug
authorMathieu Chartier <mathieuc@google.com>
Tue, 22 Sep 2015 18:04:26 +0000 (11:04 -0700)
committerMathieu Chartier <mathieuc@google.com>
Tue, 22 Sep 2015 18:04:26 +0000 (11:04 -0700)
Should have been using IsAotCompiler since the JIT has IsCompiler
as true but no low 4 GB arena pool.

Fixes 64 bit JIT tests.

Change-Id: Idc4d3e66c573eacd31ae85c66f8493b418d221d7

runtime/runtime.cc

index fe97394..8cba1a9 100644 (file)
@@ -944,7 +944,7 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
   // can't be trimmed as easily.
   const bool use_malloc = IsAotCompiler();
   arena_pool_.reset(new ArenaPool(use_malloc, false));
-  if (IsCompiler() && Is64BitInstructionSet(kRuntimeISA)) {
+  if (IsAotCompiler() && Is64BitInstructionSet(kRuntimeISA)) {
     // 4gb, no malloc. Explanation in header.
     low_4gb_arena_pool_.reset(new ArenaPool(false, true));
   }
@@ -1790,7 +1790,7 @@ bool Runtime::IsVerificationSoftFail() const {
 }
 
 LinearAlloc* Runtime::CreateLinearAlloc() {
-  return (IsCompiler() && Is64BitInstructionSet(kRuntimeISA))
+  return (IsAotCompiler() && Is64BitInstructionSet(kRuntimeISA))
       ? new LinearAlloc(low_4gb_arena_pool_.get())
       : new LinearAlloc(arena_pool_.get());
 }