| Index: src/ia32/macro-assembler-ia32.cc
|
| diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
|
| index 40554980ede4ca5c83ffb7d85c4199b044713e44..ba30c49ced678c18fcc4658323e9ff779e38ecd6 100644
|
| --- a/src/ia32/macro-assembler-ia32.cc
|
| +++ b/src/ia32/macro-assembler-ia32.cc
|
| @@ -41,14 +41,11 @@ namespace internal {
|
| // -------------------------------------------------------------------------
|
| // MacroAssembler implementation.
|
|
|
| -MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size)
|
| - : Assembler(arg_isolate, buffer, size),
|
| +MacroAssembler::MacroAssembler(void* buffer, int size)
|
| + : Assembler(buffer, size),
|
| generating_stub_(false),
|
| - allow_stub_calls_(true) {
|
| - if (isolate() != NULL) {
|
| - code_object_ = Handle<Object>(isolate()->heap()->undefined_value(),
|
| - isolate());
|
| - }
|
| + allow_stub_calls_(true),
|
| + code_object_(isolate()->heap()->undefined_value()) {
|
| }
|
|
|
|
|
| @@ -234,7 +231,7 @@ void MacroAssembler::IsInstanceJSObjectType(Register map,
|
|
|
|
|
| void MacroAssembler::FCmp() {
|
| - if (CpuFeatures::IsSupported(CMOV)) {
|
| + if (Isolate::Current()->cpu_features()->IsSupported(CMOV)) {
|
| fucomip();
|
| ffree(0);
|
| fincstp();
|
| @@ -1991,14 +1988,17 @@ void MacroAssembler::JumpIfNotBothSequentialAsciiStrings(Register object1,
|
|
|
|
|
| void MacroAssembler::PrepareCallCFunction(int num_arguments, Register scratch) {
|
| - int frame_alignment = OS::ActivationFrameAlignment();
|
| - if (frame_alignment != 0) {
|
| + // Reserve space for Isolate address which is always passed as last parameter
|
| + num_arguments += 1;
|
| +
|
| + int frameAlignment = OS::ActivationFrameAlignment();
|
| + if (frameAlignment != 0) {
|
| // Make stack end at alignment and make room for num_arguments words
|
| // and the original value of esp.
|
| mov(scratch, esp);
|
| sub(Operand(esp), Immediate((num_arguments + 1) * kPointerSize));
|
| - ASSERT(IsPowerOf2(frame_alignment));
|
| - and_(esp, -frame_alignment);
|
| + ASSERT(IsPowerOf2(frameAlignment));
|
| + and_(esp, -frameAlignment);
|
| mov(Operand(esp, num_arguments * kPointerSize), scratch);
|
| } else {
|
| sub(Operand(esp), Immediate(num_arguments * kPointerSize));
|
| @@ -2016,6 +2016,11 @@ void MacroAssembler::CallCFunction(ExternalReference function,
|
|
|
| void MacroAssembler::CallCFunction(Register function,
|
| int num_arguments) {
|
| + // Pass current isolate address as additional parameter.
|
| + mov(Operand(esp, num_arguments * kPointerSize),
|
| + Immediate(ExternalReference::isolate_address()));
|
| + num_arguments += 1;
|
| +
|
| // Check stack alignment.
|
| if (emit_debug_code()) {
|
| CheckStackAlignment();
|
| @@ -2025,15 +2030,13 @@ void MacroAssembler::CallCFunction(Register function,
|
| if (OS::ActivationFrameAlignment() != 0) {
|
| mov(esp, Operand(esp, num_arguments * kPointerSize));
|
| } else {
|
| - add(Operand(esp), Immediate(num_arguments * kPointerSize));
|
| + add(Operand(esp), Immediate(num_arguments * sizeof(int32_t)));
|
| }
|
| }
|
|
|
|
|
| CodePatcher::CodePatcher(byte* address, int size)
|
| - : address_(address),
|
| - size_(size),
|
| - masm_(Isolate::Current(), address, size + Assembler::kGap) {
|
| + : address_(address), size_(size), masm_(address, size + Assembler::kGap) {
|
| // 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
|
| // bytes of instructions without failing with buffer size constraints.
|
|
|