Index: src/ic/mips64/ic-mips64.cc |
diff --git a/src/ic/mips64/ic-mips64.cc b/src/ic/mips64/ic-mips64.cc |
index 92bb9706680d61014b47af8dda457f694001f36b..a6075dfcaab4b2f6c7107d5279decee839f46675 100644 |
--- a/src/ic/mips64/ic-mips64.cc |
+++ b/src/ic/mips64/ic-mips64.cc |
@@ -162,7 +162,8 @@ static void GenerateKeyedLoadReceiverCheck(MacroAssembler* masm, |
static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, |
Register key, Register elements, |
Register scratch1, Register scratch2, |
- Register result, Label* slow) { |
+ Register result, Label* slow, |
+ LanguageMode language_mode) { |
// Register use: |
// |
// receiver - holds the receiver on entry. |
@@ -184,7 +185,7 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, |
// |
// scratch2 - used to hold maps, prototypes, and the loaded value. |
Label check_prototypes, check_next_prototype; |
- Label done, in_bounds, return_undefined; |
+ Label done, in_bounds, absent; |
__ ld(elements, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
__ AssertFastElements(elements); |
@@ -202,7 +203,7 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, |
__ ld(scratch2, FieldMemOperand(scratch2, Map::kPrototypeOffset)); |
// scratch2: current prototype |
__ LoadRoot(at, Heap::kNullValueRootIndex); |
- __ Branch(&return_undefined, eq, scratch2, Operand(at)); |
+ __ Branch(&absent, eq, scratch2, Operand(at)); |
__ ld(elements, FieldMemOperand(scratch2, JSObject::kElementsOffset)); |
__ ld(scratch2, FieldMemOperand(scratch2, HeapObject::kMapOffset)); |
// elements: elements of current prototype |
@@ -217,9 +218,13 @@ static void GenerateFastArrayLoad(MacroAssembler* masm, Register receiver, |
__ Branch(slow, ne, elements, Operand(at)); |
__ Branch(&check_next_prototype); |
- __ bind(&return_undefined); |
- __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
- __ Branch(&done); |
+ __ bind(&absent); |
+ if (is_strong(language_mode)) { |
+ __ Branch(slow); |
+ } else { |
+ __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
+ __ Branch(&done); |
+ } |
__ bind(&in_bounds); |
// Fast case: Do the load. |
@@ -269,7 +274,7 @@ static void GenerateKeyNameCheck(MacroAssembler* masm, Register key, |
} |
-void LoadIC::GenerateNormal(MacroAssembler* masm) { |
+void LoadIC::GenerateNormal(MacroAssembler* masm, LanguageMode language_mode) { |
Register dictionary = a0; |
DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); |
DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); |
@@ -283,7 +288,7 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) { |
// Dictionary load failed, go slow (but don't miss). |
__ bind(&slow); |
- GenerateRuntimeGetProperty(masm); |
+ GenerateRuntimeGetProperty(masm, language_mode); |
} |
@@ -318,13 +323,17 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) { |
} |
-void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
+void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
+ LanguageMode language_mode) { |
// The return address is in ra. |
__ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); |
__ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); |
- __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
+ // Do tail-call to runtime routine. |
+ __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong |
+ : Runtime::kGetProperty, |
+ 2, 1); |
} |
@@ -347,16 +356,21 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
} |
-void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
+void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, |
+ LanguageMode language_mode) { |
// The return address is in ra. |
__ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); |
- __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
+ // Do tail-call to runtime routine. |
+ __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong |
+ : Runtime::kKeyedGetProperty, |
+ 2, 1); |
} |
-void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
+void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm, |
+ LanguageMode language_mode) { |
// The return address is in ra. |
Label slow, check_name, index_smi, index_name, property_array_property; |
Label probe_dictionary, check_number_dictionary; |
@@ -380,7 +394,8 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
// Check the receiver's map to see if it has fast elements. |
__ CheckFastElements(a0, a3, &check_number_dictionary); |
- GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow); |
+ GenerateFastArrayLoad(masm, receiver, key, a0, a3, a4, v0, &slow, |
+ language_mode); |
__ IncrementCounter(isolate->counters()->keyed_load_generic_smi(), 1, a4, a3); |
__ Ret(); |
@@ -401,7 +416,7 @@ void KeyedLoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
__ bind(&slow); |
__ IncrementCounter(isolate->counters()->keyed_load_generic_slow(), 1, a4, |
a3); |
- GenerateRuntimeGetProperty(masm); |
+ GenerateRuntimeGetProperty(masm, language_mode); |
__ bind(&check_name); |
GenerateKeyNameCheck(masm, key, a0, a3, &index_name, &slow); |