From 3ba75a2dc3f0f7365b157cfb3b7765f7b661a51d Mon Sep 17 00:00:00 2001 From: "palfia@homejinni.com" Date: Fri, 15 Nov 2013 21:12:51 +0000 Subject: [PATCH] MIPS: Generate KeyedLoadDictionaryElementStub with Hydrogen Port r17804 (15aa3804) BUG= R=plind44@gmail.com Review URL: https://codereview.chromium.org/74363002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17806 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/code-stubs-mips.cc | 11 +++++++++++ src/mips/macro-assembler-mips.cc | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 6c8b0b2..e28eb7a 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -114,6 +114,17 @@ void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( } +void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor( + Isolate* isolate, + CodeStubInterfaceDescriptor* descriptor) { + static Register registers[] = {a1, a0 }; + descriptor->register_param_count_ = 2; + descriptor->register_params_ = registers; + descriptor->deoptimization_handler_ = + FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure); +} + + void LoadFieldStub::InitializeInterfaceDescriptor( Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) { diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 295e9c0..2fdfb67 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -510,8 +510,7 @@ void MacroAssembler::LoadFromNumberDictionary(Label* miss, Subu(reg1, reg1, Operand(1)); // Generate an unrolled loop that performs a few probes before giving up. - static const int kProbes = 4; - for (int i = 0; i < kProbes; i++) { + for (int i = 0; i < kNumberDictionaryProbes; i++) { // Use reg2 for index calculations and keep the hash intact in reg0. mov(reg2, reg0); // Compute the masked index: (hash + i + i * i) & mask. @@ -530,7 +529,7 @@ void MacroAssembler::LoadFromNumberDictionary(Label* miss, addu(reg2, elements, at); lw(at, FieldMemOperand(reg2, SeededNumberDictionary::kElementsStartOffset)); - if (i != kProbes - 1) { + if (i != kNumberDictionaryProbes - 1) { Branch(&done, eq, key, Operand(at)); } else { Branch(miss, ne, key, Operand(at)); -- 2.7.4