Commit 6952f68e authored by vitalyr@chromium.org's avatar vitalyr@chromium.org

Fix non-ia32 build.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7484 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 66446147
...@@ -39,11 +39,14 @@ ...@@ -39,11 +39,14 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
MacroAssembler::MacroAssembler(void* buffer, int size) MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
: Assembler(Isolate::Current(), buffer, size), : Assembler(arg_isolate, buffer, size),
generating_stub_(false), generating_stub_(false),
allow_stub_calls_(true), allow_stub_calls_(true) {
code_object_(isolate()->heap()->undefined_value()) { if (isolate() != NULL) {
code_object_ = Handle<Object>(isolate()->heap()->undefined_value(),
isolate());
}
} }
...@@ -2896,7 +2899,7 @@ CodePatcher::CodePatcher(byte* address, int instructions) ...@@ -2896,7 +2899,7 @@ CodePatcher::CodePatcher(byte* address, int instructions)
: address_(address), : address_(address),
instructions_(instructions), instructions_(instructions),
size_(instructions * Assembler::kInstrSize), size_(instructions * Assembler::kInstrSize),
masm_(address, size_ + Assembler::kGap) { masm_(Isolate::Current(), address, size_ + Assembler::kGap) {
// Create a new macro assembler pointing to the address of the code to patch. // Create a new macro assembler pointing to the address of the code to patch.
// The size is adjusted with kGap on order for the assembler to generate size // The size is adjusted with kGap on order for the assembler to generate size
// bytes of instructions without failing with buffer size constraints. // bytes of instructions without failing with buffer size constraints.
......
...@@ -90,7 +90,11 @@ enum ObjectToDoubleFlags { ...@@ -90,7 +90,11 @@ enum ObjectToDoubleFlags {
// MacroAssembler implements a collection of frequently used macros. // MacroAssembler implements a collection of frequently used macros.
class MacroAssembler: public Assembler { class MacroAssembler: public Assembler {
public: public:
MacroAssembler(void* buffer, int size); // The isolate parameter can be NULL if the macro assembler should
// not use isolate-dependent functionality. In this case, it's the
// responsibility of the caller to never invoke such function on the
// macro assembler.
MacroAssembler(Isolate* isolate, void* buffer, int size);
// Jump, Call, and Ret pseudo instructions implementing inter-working. // Jump, Call, and Ret pseudo instructions implementing inter-working.
void Jump(Register target, Condition cond = al); void Jump(Register target, Condition cond = al);
...@@ -781,7 +785,10 @@ class MacroAssembler: public Assembler { ...@@ -781,7 +785,10 @@ class MacroAssembler: public Assembler {
// Store the function for the given builtin in the target register. // Store the function for the given builtin in the target register.
void GetBuiltinFunction(Register target, Builtins::JavaScript id); void GetBuiltinFunction(Register target, Builtins::JavaScript id);
Handle<Object> CodeObject() { return code_object_; } Handle<Object> CodeObject() {
ASSERT(!code_object_.is_null());
return code_object_;
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
...@@ -116,7 +116,7 @@ namespace internal { ...@@ -116,7 +116,7 @@ namespace internal {
RegExpMacroAssemblerARM::RegExpMacroAssemblerARM( RegExpMacroAssemblerARM::RegExpMacroAssemblerARM(
Mode mode, Mode mode,
int registers_to_save) int registers_to_save)
: masm_(new MacroAssembler(NULL, kRegExpCodeSize)), : masm_(new MacroAssembler(Isolate::Current(), NULL, kRegExpCodeSize)),
mode_(mode), mode_(mode),
num_registers_(registers_to_save), num_registers_(registers_to_save),
num_saved_registers_(registers_to_save), num_saved_registers_(registers_to_save),
......
...@@ -40,12 +40,15 @@ ...@@ -40,12 +40,15 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
MacroAssembler::MacroAssembler(void* buffer, int size) MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
: Assembler(Isolate::Current(), buffer, size), : Assembler(arg_isolate, buffer, size),
generating_stub_(false), generating_stub_(false),
allow_stub_calls_(true), allow_stub_calls_(true),
root_array_available_(true), root_array_available_(true) {
code_object_(isolate()->heap()->undefined_value()) { if (isolate() != NULL) {
code_object_ = Handle<Object>(isolate()->heap()->undefined_value(),
isolate());
}
} }
...@@ -2885,7 +2888,9 @@ void MacroAssembler::CallCFunction(Register function, int num_arguments) { ...@@ -2885,7 +2888,9 @@ void MacroAssembler::CallCFunction(Register function, int num_arguments) {
CodePatcher::CodePatcher(byte* address, int size) CodePatcher::CodePatcher(byte* address, int size)
: address_(address), size_(size), masm_(address, size + Assembler::kGap) { : address_(address),
size_(size),
masm_(Isolate::Current(), address, size + Assembler::kGap) {
// Create a new macro assembler pointing to the address of the code to patch. // Create a new macro assembler pointing to the address of the code to patch.
// The size is adjusted with kGap on order for the assembler to generate size // The size is adjusted with kGap on order for the assembler to generate size
// bytes of instructions without failing with buffer size constraints. // bytes of instructions without failing with buffer size constraints.
......
...@@ -74,7 +74,11 @@ struct SmiIndex { ...@@ -74,7 +74,11 @@ struct SmiIndex {
// MacroAssembler implements a collection of frequently used macros. // MacroAssembler implements a collection of frequently used macros.
class MacroAssembler: public Assembler { class MacroAssembler: public Assembler {
public: public:
MacroAssembler(void* buffer, int size); // The isolate parameter can be NULL if the macro assembler should
// not use isolate-dependent functionality. In this case, it's the
// responsibility of the caller to never invoke such function on the
// macro assembler.
MacroAssembler(Isolate* isolate, void* buffer, int size);
// Prevent the use of the RootArray during the lifetime of this // Prevent the use of the RootArray during the lifetime of this
// scope object. // scope object.
...@@ -1029,7 +1033,10 @@ class MacroAssembler: public Assembler { ...@@ -1029,7 +1033,10 @@ class MacroAssembler: public Assembler {
// may be bigger than 2^16 - 1. Requires a scratch register. // may be bigger than 2^16 - 1. Requires a scratch register.
void Ret(int bytes_dropped, Register scratch); void Ret(int bytes_dropped, Register scratch);
Handle<Object> CodeObject() { return code_object_; } Handle<Object> CodeObject() {
ASSERT(!code_object_.is_null());
return code_object_;
}
// Copy length bytes from source to destination. // Copy length bytes from source to destination.
// Uses scratch register internally (if you have a low-eight register // Uses scratch register internally (if you have a low-eight register
......
...@@ -114,7 +114,7 @@ namespace internal { ...@@ -114,7 +114,7 @@ namespace internal {
RegExpMacroAssemblerX64::RegExpMacroAssemblerX64( RegExpMacroAssemblerX64::RegExpMacroAssemblerX64(
Mode mode, Mode mode,
int registers_to_save) int registers_to_save)
: masm_(NULL, kRegExpCodeSize), : masm_(Isolate::Current(), NULL, kRegExpCodeSize),
no_root_array_scope_(&masm_), no_root_array_scope_(&masm_),
code_relative_fixup_positions_(4), code_relative_fixup_positions_(4),
mode_(mode), mode_(mode),
......
This diff is collapsed.
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