Revision: 8163
Author:   [email protected]
Date:     Fri Jun  3 03:11:10 2011
Log: Report out of memory if we cannot allocate memory for the deoptimization table.

Currently we pass a null pointer to memcpy. We will crash either way,
but going through FatalProcessOutOfMemory makes it clear what is going
on.

[email protected]
BUG=http://crbug.com/84717

Review URL: http://codereview.chromium.org/6993022
http://code.google.com/p/v8/source/detail?r=8163

Modified:
 /branches/bleeding_edge/src/deoptimizer.cc

=======================================
--- /branches/bleeding_edge/src/deoptimizer.cc  Tue May 31 08:21:25 2011
+++ /branches/bleeding_edge/src/deoptimizer.cc  Fri Jun  3 03:11:10 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 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:
@@ -901,6 +901,9 @@
   ASSERT(desc.reloc_size == 0);

LargeObjectChunk* chunk = LargeObjectChunk::New(desc.instr_size, EXECUTABLE);
+  if (chunk == NULL) {
+ V8::FatalProcessOutOfMemory("Not enough memory for deoptimization table");
+  }
   memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
   CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
   return chunk;

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to