From 6803006b2d0b77022ece49cd549fa57ca84a45f4 Mon Sep 17 00:00:00 2001 From: "chunyang.dai" Date: Wed, 13 May 2015 04:14:35 -0700 Subject: [PATCH] X87: Add a MathFloor stub generated with TurboFan port abc35080b33cc31e47b9913e64ac99ec687c6b65 (r28339) original commit message: This stub will be used as the basis of a Math.floor-specific CallIC to detect and track calls to floor that return -0. Along the way: - Create a TurboFanCodeStub super class from which the StringLength and MathRound TF stubs derive. - Fix the ugly hack that passes the first stub parameter as the "this" pointer in the the TF-compiled JS function. - Fix bugs in the ia32/x64 disassembler. BUG= Review URL: https://codereview.chromium.org/1134323002 Cr-Commit-Position: refs/heads/master@{#28386} --- src/x87/disasm-x87.cc | 2 +- src/x87/interface-descriptors-x87.cc | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/x87/disasm-x87.cc b/src/x87/disasm-x87.cc index 7e0a075..ce7ac14 100644 --- a/src/x87/disasm-x87.cc +++ b/src/x87/disasm-x87.cc @@ -1292,7 +1292,7 @@ int DisassemblerX87::InstructionDecode(v8::internal::Vector out_buffer, } else if (*data == 0x16) { data++; int mod, regop, rm; - get_modrm(*data, &mod, ®op, &rm); + get_modrm(*data, &mod, &rm, ®op); int8_t imm8 = static_cast(data[1]); AppendToBuffer("pextrd %s,%s,%d", NameOfCPURegister(regop), diff --git a/src/x87/interface-descriptors-x87.cc b/src/x87/interface-descriptors-x87.cc index 515d56c..c9c2775 100644 --- a/src/x87/interface-descriptors-x87.cc +++ b/src/x87/interface-descriptors-x87.cc @@ -370,6 +370,21 @@ void ApiAccessorDescriptor::Initialize(CallInterfaceDescriptorData* data) { }; data->Initialize(arraysize(registers), registers, representations); } + + +void MathRoundVariantDescriptor::Initialize(CallInterfaceDescriptorData* data) { + Register registers[] = { + esi, // context + edi, // math rounding function + edx, // vector slot id + }; + Representation representations[] = { + Representation::Tagged(), // + Representation::Tagged(), // + Representation::Tagged(), // + }; + data->Initialize(arraysize(registers), registers, representations); +} } } // namespace v8::internal -- 2.7.4