Commit 04a60315 authored by whesse@chromium.org's avatar whesse@chromium.org

Allow construction of x64 Assembler with a NULL Isolate.

BUG=
TEST=

Review URL: http://codereview.chromium.org/6771049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 65fb2cf9
...@@ -354,7 +354,7 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) ...@@ -354,7 +354,7 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
if (buffer_size <= kMinimalBufferSize) { if (buffer_size <= kMinimalBufferSize) {
buffer_size = kMinimalBufferSize; buffer_size = kMinimalBufferSize;
if (isolate()->assembler_spare_buffer() != NULL) { if (isolate() != NULL && isolate()->assembler_spare_buffer() != NULL) {
buffer = isolate()->assembler_spare_buffer(); buffer = isolate()->assembler_spare_buffer();
isolate()->set_assembler_spare_buffer(NULL); isolate()->set_assembler_spare_buffer(NULL);
} }
...@@ -397,7 +397,8 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) ...@@ -397,7 +397,8 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size)
Assembler::~Assembler() { Assembler::~Assembler() {
if (own_buffer_) { if (own_buffer_) {
if (isolate()->assembler_spare_buffer() == NULL && if (isolate() != NULL &&
isolate()->assembler_spare_buffer() == NULL &&
buffer_size_ == kMinimalBufferSize) { buffer_size_ == kMinimalBufferSize) {
isolate()->set_assembler_spare_buffer(buffer_); isolate()->set_assembler_spare_buffer(buffer_);
} else { } else {
...@@ -518,7 +519,8 @@ void Assembler::GrowBuffer() { ...@@ -518,7 +519,8 @@ void Assembler::GrowBuffer() {
reloc_info_writer.pos(), desc.reloc_size); reloc_info_writer.pos(), desc.reloc_size);
// Switch buffers. // Switch buffers.
if (isolate()->assembler_spare_buffer() == NULL && if (isolate() != NULL &&
isolate()->assembler_spare_buffer() == NULL &&
buffer_size_ == kMinimalBufferSize) { buffer_size_ == kMinimalBufferSize) {
isolate()->set_assembler_spare_buffer(buffer_); isolate()->set_assembler_spare_buffer(buffer_);
} else { } else {
......
...@@ -8755,7 +8755,7 @@ ModuloFunction CreateModuloFunction() { ...@@ -8755,7 +8755,7 @@ ModuloFunction CreateModuloFunction() {
&actual_size, &actual_size,
true)); true));
CHECK(buffer); CHECK(buffer);
Assembler masm(Isolate::Current(), buffer, static_cast<int>(actual_size)); Assembler masm(NULL, buffer, static_cast<int>(actual_size));
// Generated code is put into a fixed, unmovable, buffer, and not into // Generated code is put into a fixed, unmovable, buffer, and not into
// the V8 heap. We can't, and don't, refer to any relocatable addresses // the V8 heap. We can't, and don't, refer to any relocatable addresses
// (e.g. the JavaScript nan-object). // (e.g. the JavaScript nan-object).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment