diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index 46692bc16c..654814c1e6 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -45,11 +45,11 @@ MacroAssembler::MacroAssembler(void* buffer, int size) generating_stub_(false), allow_stub_calls_(true), root_array_available_(true), - code_object_(HEAP->undefined_value()) { + code_object_(isolate()->heap()->undefined_value()) { } - static intptr_t RootRegisterDelta(ExternalReference other, Isolate* isolate) { +static intptr_t RootRegisterDelta(ExternalReference other, Isolate* isolate) { Address roots_register_value = kRootRegisterBias + reinterpret_cast
(isolate->heap()->roots_address()); intptr_t delta = other.address() - roots_register_value; diff --git a/test/cctest/test-macro-assembler-x64.cc b/test/cctest/test-macro-assembler-x64.cc index 15dc6db2d5..c7c67b0588 100755 --- a/test/cctest/test-macro-assembler-x64.cc +++ b/test/cctest/test-macro-assembler-x64.cc @@ -95,6 +95,7 @@ typedef int (*F0)(); static void EntryCode(MacroAssembler* masm) { // Smi constant register is callee save. __ push(v8::internal::kSmiConstantRegister); + __ push(v8::internal::kRootRegister); __ InitializeSmiConstantRegister(); __ InitializeRootRegister(); } @@ -106,6 +107,7 @@ static void ExitCode(MacroAssembler* masm) { __ cmpq(rdx, v8::internal::kSmiConstantRegister); __ movq(rdx, Immediate(-1)); __ cmovq(not_equal, rax, rdx); + __ pop(v8::internal::kRootRegister); __ pop(v8::internal::kSmiConstantRegister); }