aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/x64/ic-x64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/x64/ic-x64.cc')
-rw-r--r--deps/v8/src/x64/ic-x64.cc28
1 files changed, 12 insertions, 16 deletions
diff --git a/deps/v8/src/x64/ic-x64.cc b/deps/v8/src/x64/ic-x64.cc
index 62e769123e..a74e621e15 100644
--- a/deps/v8/src/x64/ic-x64.cc
+++ b/deps/v8/src/x64/ic-x64.cc
@@ -730,6 +730,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
// -- rsp[0] : return address
// -----------------------------------
Label miss;
+ Label index_out_of_range;
Register receiver = rdx;
Register index = rax;
@@ -744,7 +745,7 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
result,
&miss, // When not a string.
&miss, // When not a number.
- &miss, // When index out of range.
+ &index_out_of_range,
STRING_INDEX_IS_ARRAY_INDEX);
char_at_generator.GenerateFast(masm);
__ ret(0);
@@ -752,6 +753,10 @@ void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
ICRuntimeCallHelper call_helper;
char_at_generator.GenerateSlow(masm, call_helper);
+ __ bind(&index_out_of_range);
+ __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
+ __ ret(0);
+
__ bind(&miss);
GenerateMiss(masm);
}
@@ -842,7 +847,7 @@ void KeyedLoadIC::GenerateExternalArray(MacroAssembler* masm,
// For the UnsignedInt array type, we need to see whether
// the value can be represented in a Smi. If not, we need to convert
// it to a HeapNumber.
- NearLabel box_int;
+ Label box_int;
__ JumpIfUIntNotValidSmiValue(rcx, &box_int);
@@ -1027,7 +1032,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
// No more bailouts to slow case on this path, so key not needed.
__ SmiToInteger32(rdi, rax);
{ // Clamp the value to [0..255].
- NearLabel done;
+ Label done;
__ testl(rdi, Immediate(0xFFFFFF00));
__ j(zero, &done);
__ setcc(negative, rdi); // 1 if negative, 0 if positive.
@@ -1077,7 +1082,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
// rax: value
// rbx: receiver's elements array (a FixedArray)
// rcx: index
- NearLabel non_smi_value;
+ Label non_smi_value;
__ movq(FieldOperand(rbx, rcx, times_pointer_size, FixedArray::kHeaderSize),
rax);
__ JumpIfNotSmi(rax, &non_smi_value);
@@ -1099,7 +1104,7 @@ void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
// -- rdx : receiver
// -- rsp[0] : return address
// -----------------------------------
- Label slow;
+ Label slow, check_heap_number;
// Check that the object isn't a smi.
__ JumpIfSmi(rdx, &slow);
@@ -1140,7 +1145,6 @@ void KeyedStoreIC::GenerateExternalArray(MacroAssembler* masm,
// rdx: receiver (a JSObject)
// rbx: elements array
// rdi: untagged key
- NearLabel check_heap_number;
__ JumpIfNotSmi(rax, &check_heap_number);
// No more branches to slow case on this path. Key and receiver not needed.
__ SmiToInteger32(rdx, rax);
@@ -1484,7 +1488,7 @@ void KeyedCallIC::GenerateMegamorphic(MacroAssembler* masm, int argc) {
// Get the receiver of the function from the stack; 1 ~ return address.
__ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
- Label do_call, slow_call, slow_load;
+ Label do_call, slow_call, slow_load, slow_reload_receiver;
Label check_number_dictionary, check_string, lookup_monomorphic_cache;
Label index_smi, index_string;
@@ -1726,14 +1730,6 @@ bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
}
-bool LoadIC::PatchInlinedContextualLoad(Address address,
- Object* map,
- Object* cell) {
- // TODO(<bug#>): implement this.
- return false;
-}
-
-
// The offset from the inlined patch site to the start of the inlined
// store instruction.
const int StoreIC::kOffsetToStoreInstruction = 20;
@@ -1884,7 +1880,7 @@ void StoreIC::GenerateNormal(MacroAssembler* masm) {
// -- rsp[0] : return address
// -----------------------------------
- Label miss;
+ Label miss, restore_miss;
GenerateStringDictionaryReceiverCheck(masm, rdx, rbx, rdi, &miss);