| Index: src/x64/stub-cache-x64.cc
|
| diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
|
| index b0bdf70a4e650de6f27e7687e461b7570e09a74f..43a28d5bb395c3ab7785572f6c6c40af65bcbc73 100644
|
| --- a/src/x64/stub-cache-x64.cc
|
| +++ b/src/x64/stub-cache-x64.cc
|
| @@ -75,14 +75,14 @@ static void ProbeTable(Isolate* isolate,
|
|
|
| // Get the map entry from the cache.
|
| // Use key_offset + kPointerSize * 2, rather than loading map_offset.
|
| - __ movq(kScratchRegister,
|
| + __ movp(kScratchRegister,
|
| Operand(kScratchRegister, offset, scale_factor, kPointerSize * 2));
|
| __ cmpq(kScratchRegister, FieldOperand(receiver, HeapObject::kMapOffset));
|
| __ j(not_equal, &miss);
|
|
|
| // Get the code entry from the cache.
|
| __ LoadAddress(kScratchRegister, value_offset);
|
| - __ movq(kScratchRegister,
|
| + __ movp(kScratchRegister,
|
| Operand(kScratchRegister, offset, scale_factor, 0));
|
|
|
| // Check that the flags match what we're looking for.
|
| @@ -119,7 +119,7 @@ void StubCompiler::GenerateDictionaryNegativeLookup(MacroAssembler* masm,
|
| __ IncrementCounter(counters->negative_lookups(), 1);
|
| __ IncrementCounter(counters->negative_lookups_miss(), 1);
|
|
|
| - __ movq(scratch0, FieldOperand(receiver, HeapObject::kMapOffset));
|
| + __ movp(scratch0, FieldOperand(receiver, HeapObject::kMapOffset));
|
|
|
| const int kInterceptorOrAccessCheckNeededMask =
|
| (1 << Map::kHasNamedInterceptor) | (1 << Map::kIsAccessCheckNeeded);
|
| @@ -135,7 +135,7 @@ void StubCompiler::GenerateDictionaryNegativeLookup(MacroAssembler* masm,
|
|
|
| // Load properties array.
|
| Register properties = scratch0;
|
| - __ movq(properties, FieldOperand(receiver, JSObject::kPropertiesOffset));
|
| + __ movp(properties, FieldOperand(receiver, JSObject::kPropertiesOffset));
|
|
|
| // Check that the properties array is a dictionary.
|
| __ CompareRoot(FieldOperand(properties, HeapObject::kMapOffset),
|
| @@ -224,18 +224,18 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
|
| int index,
|
| Register prototype) {
|
| // Load the global or builtins object from the current context.
|
| - __ movq(prototype,
|
| + __ movp(prototype,
|
| Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
|
| // Load the native context from the global or builtins object.
|
| - __ movq(prototype,
|
| + __ movp(prototype,
|
| FieldOperand(prototype, GlobalObject::kNativeContextOffset));
|
| // Load the function from the native context.
|
| - __ movq(prototype, Operand(prototype, Context::SlotOffset(index)));
|
| + __ movp(prototype, Operand(prototype, Context::SlotOffset(index)));
|
| // Load the initial map. The global functions all have initial maps.
|
| - __ movq(prototype,
|
| + __ movp(prototype,
|
| FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset));
|
| // Load the prototype from the initial map.
|
| - __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
|
| + __ movp(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
|
| }
|
|
|
|
|
| @@ -256,7 +256,7 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
|
| // Load its initial map. The global functions all have initial maps.
|
| __ Move(prototype, Handle<Map>(function->initial_map()));
|
| // Load the prototype from the initial map.
|
| - __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
|
| + __ movp(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
|
| }
|
|
|
|
|
| @@ -272,7 +272,7 @@ void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
|
| __ j(not_equal, miss_label);
|
|
|
| // Load length directly from the JS array.
|
| - __ movq(rax, FieldOperand(receiver, JSArray::kLengthOffset));
|
| + __ movp(rax, FieldOperand(receiver, JSArray::kLengthOffset));
|
| __ ret(0);
|
| }
|
|
|
| @@ -288,7 +288,7 @@ static void GenerateStringCheck(MacroAssembler* masm,
|
| __ JumpIfSmi(receiver, smi);
|
|
|
| // Check that the object is a string.
|
| - __ movq(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
|
| + __ movp(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
|
| __ movzxbq(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
|
| STATIC_ASSERT(kNotStringTag != 0);
|
| __ testl(scratch, Immediate(kNotStringTag));
|
| @@ -308,7 +308,7 @@ void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
|
| GenerateStringCheck(masm, receiver, scratch1, miss, &check_wrapper);
|
|
|
| // Load length directly from the string.
|
| - __ movq(rax, FieldOperand(receiver, String::kLengthOffset));
|
| + __ movp(rax, FieldOperand(receiver, String::kLengthOffset));
|
| __ ret(0);
|
|
|
| // Check if the object is a JSValue wrapper.
|
| @@ -318,9 +318,9 @@ void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm,
|
|
|
| // Check if the wrapped value is a string and load the length
|
| // directly if it is.
|
| - __ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset));
|
| + __ movp(scratch2, FieldOperand(receiver, JSValue::kValueOffset));
|
| GenerateStringCheck(masm, scratch2, scratch1, miss, miss);
|
| - __ movq(rax, FieldOperand(scratch2, String::kLengthOffset));
|
| + __ movp(rax, FieldOperand(scratch2, String::kLengthOffset));
|
| __ ret(0);
|
| }
|
|
|
| @@ -331,7 +331,7 @@ void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
|
| Register scratch,
|
| Label* miss_label) {
|
| __ TryGetFunctionPrototype(receiver, result, miss_label);
|
| - if (!result.is(rax)) __ movq(rax, result);
|
| + if (!result.is(rax)) __ movp(rax, result);
|
| __ ret(0);
|
| }
|
|
|
| @@ -347,10 +347,10 @@ void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
|
| if (!inobject) {
|
| // Calculate the offset into the properties array.
|
| offset = offset + FixedArray::kHeaderSize;
|
| - __ movq(dst, FieldOperand(src, JSObject::kPropertiesOffset));
|
| + __ movp(dst, FieldOperand(src, JSObject::kPropertiesOffset));
|
| src = dst;
|
| }
|
| - __ movq(dst, FieldOperand(src, offset));
|
| + __ movp(dst, FieldOperand(src, offset));
|
| }
|
|
|
|
|
| @@ -408,7 +408,7 @@ static void ReserveSpaceForFastApiCall(MacroAssembler* masm, Register scratch) {
|
| StackArgumentsAccessor args(rsp, kFastApiCallArguments,
|
| ARGUMENTS_DONT_CONTAIN_RECEIVER);
|
| for (int i = 0; i < kFastApiCallArguments; i++) {
|
| - __ movq(args.GetArgumentOperand(i), scratch);
|
| + __ movp(args.GetArgumentOperand(i), scratch);
|
| }
|
| }
|
|
|
| @@ -446,31 +446,31 @@ static void GenerateFastApiCall(MacroAssembler* masm,
|
|
|
| // Save calling context.
|
| int offset = argc + kFastApiCallArguments;
|
| - __ movq(args.GetArgumentOperand(offset - FCA::kContextSaveIndex), rsi);
|
| + __ movp(args.GetArgumentOperand(offset - FCA::kContextSaveIndex), rsi);
|
|
|
| // Get the function and setup the context.
|
| Handle<JSFunction> function = optimization.constant_function();
|
| __ Move(rdi, function);
|
| - __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
|
| + __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
|
| // Construct the FunctionCallbackInfo on the stack.
|
| - __ movq(args.GetArgumentOperand(offset - FCA::kCalleeIndex), rdi);
|
| + __ movp(args.GetArgumentOperand(offset - FCA::kCalleeIndex), rdi);
|
| Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
|
| Handle<Object> call_data(api_call_info->data(), masm->isolate());
|
| if (masm->isolate()->heap()->InNewSpace(*call_data)) {
|
| __ Move(rcx, api_call_info);
|
| - __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset));
|
| - __ movq(args.GetArgumentOperand(offset - FCA::kDataIndex), rbx);
|
| + __ movp(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset));
|
| + __ movp(args.GetArgumentOperand(offset - FCA::kDataIndex), rbx);
|
| } else {
|
| __ Move(args.GetArgumentOperand(offset - FCA::kDataIndex), call_data);
|
| }
|
| __ Move(kScratchRegister,
|
| ExternalReference::isolate_address(masm->isolate()));
|
| - __ movq(args.GetArgumentOperand(offset - FCA::kIsolateIndex),
|
| + __ movp(args.GetArgumentOperand(offset - FCA::kIsolateIndex),
|
| kScratchRegister);
|
| __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
|
| - __ movq(args.GetArgumentOperand(offset - FCA::kReturnValueDefaultValueIndex),
|
| + __ movp(args.GetArgumentOperand(offset - FCA::kReturnValueDefaultValueIndex),
|
| kScratchRegister);
|
| - __ movq(args.GetArgumentOperand(offset - FCA::kReturnValueOffset),
|
| + __ movp(args.GetArgumentOperand(offset - FCA::kReturnValueOffset),
|
| kScratchRegister);
|
|
|
| // Prepare arguments.
|
| @@ -536,7 +536,7 @@ static void GenerateFastApiCall(MacroAssembler* masm,
|
| bool call_data_undefined = false;
|
| if (isolate->heap()->InNewSpace(*call_data)) {
|
| __ Move(scratch2, api_call_info);
|
| - __ movq(scratch3, FieldOperand(scratch2, CallHandlerInfo::kDataOffset));
|
| + __ movp(scratch3, FieldOperand(scratch2, CallHandlerInfo::kDataOffset));
|
| } else if (call_data->IsUndefined()) {
|
| call_data_undefined = true;
|
| __ LoadRoot(scratch3, Heap::kUndefinedValueRootIndex);
|
| @@ -561,7 +561,7 @@ static void GenerateFastApiCall(MacroAssembler* masm,
|
|
|
| ASSERT(!scratch1.is(rax));
|
| // store receiver address for GenerateFastApiCallBody
|
| - __ movq(rax, rsp);
|
| + __ movp(rax, rsp);
|
| __ PushReturnAddressFrom(scratch1);
|
|
|
| GenerateFastApiCallBody(masm, optimization, argc, true);
|
| @@ -596,9 +596,9 @@ static void GenerateFastApiCallBody(MacroAssembler* masm,
|
|
|
| __ PrepareCallApiFunction(kApiStackSpace);
|
|
|
| - __ movq(StackSpaceOperand(0), rax); // FunctionCallbackInfo::implicit_args_.
|
| + __ movp(StackSpaceOperand(0), rax); // FunctionCallbackInfo::implicit_args_.
|
| __ addq(rax, Immediate((argc + kFastApiCallArguments - 1) * kPointerSize));
|
| - __ movq(StackSpaceOperand(1), rax); // FunctionCallbackInfo::values_.
|
| + __ movp(StackSpaceOperand(1), rax); // FunctionCallbackInfo::values_.
|
| __ Set(StackSpaceOperand(2), argc); // FunctionCallbackInfo::length_.
|
| // FunctionCallbackInfo::is_construct_call_.
|
| __ Set(StackSpaceOperand(3), 0);
|
| @@ -932,7 +932,7 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
|
|
|
| // Update the map of the object.
|
| __ Move(scratch1, transition);
|
| - __ movq(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1);
|
| + __ movp(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch1);
|
|
|
| // Update the write barrier for the map field.
|
| __ RecordWriteField(receiver_reg,
|
| @@ -964,15 +964,15 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
|
| // Set the property straight into the object.
|
| int offset = object->map()->instance_size() + (index * kPointerSize);
|
| if (FLAG_track_double_fields && representation.IsDouble()) {
|
| - __ movq(FieldOperand(receiver_reg, offset), storage_reg);
|
| + __ movp(FieldOperand(receiver_reg, offset), storage_reg);
|
| } else {
|
| - __ movq(FieldOperand(receiver_reg, offset), value_reg);
|
| + __ movp(FieldOperand(receiver_reg, offset), value_reg);
|
| }
|
|
|
| if (!FLAG_track_fields || !representation.IsSmi()) {
|
| // Update the write barrier for the array address.
|
| if (!FLAG_track_double_fields || !representation.IsDouble()) {
|
| - __ movq(storage_reg, value_reg);
|
| + __ movp(storage_reg, value_reg);
|
| }
|
| __ RecordWriteField(
|
| receiver_reg, offset, storage_reg, scratch1, kDontSaveFPRegs,
|
| @@ -982,17 +982,17 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm,
|
| // Write to the properties array.
|
| int offset = index * kPointerSize + FixedArray::kHeaderSize;
|
| // Get the properties array (optimistically).
|
| - __ movq(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
|
| + __ movp(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
|
| if (FLAG_track_double_fields && representation.IsDouble()) {
|
| - __ movq(FieldOperand(scratch1, offset), storage_reg);
|
| + __ movp(FieldOperand(scratch1, offset), storage_reg);
|
| } else {
|
| - __ movq(FieldOperand(scratch1, offset), value_reg);
|
| + __ movp(FieldOperand(scratch1, offset), value_reg);
|
| }
|
|
|
| if (!FLAG_track_fields || !representation.IsSmi()) {
|
| // Update the write barrier for the array address.
|
| if (!FLAG_track_double_fields || !representation.IsDouble()) {
|
| - __ movq(storage_reg, value_reg);
|
| + __ movp(storage_reg, value_reg);
|
| }
|
| __ RecordWriteField(
|
| scratch1, offset, storage_reg, receiver_reg, kDontSaveFPRegs,
|
| @@ -1038,12 +1038,12 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
|
| // Load the double storage.
|
| if (index < 0) {
|
| int offset = object->map()->instance_size() + (index * kPointerSize);
|
| - __ movq(scratch1, FieldOperand(receiver_reg, offset));
|
| + __ movp(scratch1, FieldOperand(receiver_reg, offset));
|
| } else {
|
| - __ movq(scratch1,
|
| + __ movp(scratch1,
|
| FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
|
| int offset = index * kPointerSize + FixedArray::kHeaderSize;
|
| - __ movq(scratch1, FieldOperand(scratch1, offset));
|
| + __ movp(scratch1, FieldOperand(scratch1, offset));
|
| }
|
|
|
| // Store the value into the storage.
|
| @@ -1071,12 +1071,12 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
|
| if (index < 0) {
|
| // Set the property straight into the object.
|
| int offset = object->map()->instance_size() + (index * kPointerSize);
|
| - __ movq(FieldOperand(receiver_reg, offset), value_reg);
|
| + __ movp(FieldOperand(receiver_reg, offset), value_reg);
|
|
|
| if (!FLAG_track_fields || !representation.IsSmi()) {
|
| // Update the write barrier for the array address.
|
| // Pass the value being stored in the now unused name_reg.
|
| - __ movq(name_reg, value_reg);
|
| + __ movp(name_reg, value_reg);
|
| __ RecordWriteField(
|
| receiver_reg, offset, name_reg, scratch1, kDontSaveFPRegs,
|
| EMIT_REMEMBERED_SET, smi_check);
|
| @@ -1085,13 +1085,13 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm,
|
| // Write to the properties array.
|
| int offset = index * kPointerSize + FixedArray::kHeaderSize;
|
| // Get the properties array (optimistically).
|
| - __ movq(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
|
| - __ movq(FieldOperand(scratch1, offset), value_reg);
|
| + __ movp(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
|
| + __ movp(FieldOperand(scratch1, offset), value_reg);
|
|
|
| if (!FLAG_track_fields || !representation.IsSmi()) {
|
| // Update the write barrier for the array address.
|
| // Pass the value being stored in the now unused name_reg.
|
| - __ movq(name_reg, value_reg);
|
| + __ movp(name_reg, value_reg);
|
| __ RecordWriteField(
|
| scratch1, offset, name_reg, receiver_reg, kDontSaveFPRegs,
|
| EMIT_REMEMBERED_SET, smi_check);
|
| @@ -1145,7 +1145,7 @@ Register StubCompiler::CheckPrototypes(Handle<Type> type,
|
| FunctionCallbackArguments::kHolderIndex;
|
|
|
| if (save_at_depth == depth) {
|
| - __ movq(args.GetArgumentOperand(kHolderIndex), object_reg);
|
| + __ movp(args.GetArgumentOperand(kHolderIndex), object_reg);
|
| }
|
|
|
| Handle<JSObject> current = Handle<JSObject>::null();
|
| @@ -1178,14 +1178,14 @@ Register StubCompiler::CheckPrototypes(Handle<Type> type,
|
| GenerateDictionaryNegativeLookup(masm(), miss, reg, name,
|
| scratch1, scratch2);
|
|
|
| - __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
|
| + __ movp(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
|
| reg = holder_reg; // From now on the object will be in holder_reg.
|
| - __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
|
| + __ movp(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
|
| } else {
|
| bool in_new_space = heap()->InNewSpace(*prototype);
|
| if (in_new_space) {
|
| // Save the map in scratch1 for later.
|
| - __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
|
| + __ movp(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
|
| }
|
| if (depth != 1 || check == CHECK_ALL_MAPS) {
|
| __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK);
|
| @@ -1206,7 +1206,7 @@ Register StubCompiler::CheckPrototypes(Handle<Type> type,
|
| if (in_new_space) {
|
| // The prototype is in new space; we cannot store a reference to it
|
| // in the code. Load it from the map.
|
| - __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
|
| + __ movp(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
|
| } else {
|
| // The prototype is in old space; load it directly.
|
| __ Move(reg, prototype);
|
| @@ -1214,7 +1214,7 @@ Register StubCompiler::CheckPrototypes(Handle<Type> type,
|
| }
|
|
|
| if (save_at_depth == depth) {
|
| - __ movq(args.GetArgumentOperand(kHolderIndex), reg);
|
| + __ movp(args.GetArgumentOperand(kHolderIndex), reg);
|
| }
|
|
|
| // Go to the next object in the prototype chain.
|
| @@ -1281,7 +1281,7 @@ Register LoadStubCompiler::CallbackHandlerFrontend(
|
|
|
| // Load the properties dictionary.
|
| Register dictionary = scratch4();
|
| - __ movq(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset));
|
| + __ movp(dictionary, FieldOperand(reg, JSObject::kPropertiesOffset));
|
|
|
| // Probe the dictionary.
|
| Label probe_done;
|
| @@ -1301,7 +1301,7 @@ Register LoadStubCompiler::CallbackHandlerFrontend(
|
| NameDictionary::kHeaderSize +
|
| NameDictionary::kElementsStartIndex * kPointerSize;
|
| const int kValueOffset = kElementsStartOffset + kPointerSize;
|
| - __ movq(scratch2(),
|
| + __ movp(scratch2(),
|
| Operand(dictionary, index, times_pointer_size,
|
| kValueOffset - kHeapObjectTag));
|
| __ Move(scratch3(), callback, RelocInfo::EMBEDDED_OBJECT);
|
| @@ -1318,7 +1318,7 @@ void LoadStubCompiler::GenerateLoadField(Register reg,
|
| Handle<JSObject> holder,
|
| PropertyIndex field,
|
| Representation representation) {
|
| - if (!reg.is(receiver())) __ movq(receiver(), reg);
|
| + if (!reg.is(receiver())) __ movp(receiver(), reg);
|
| if (kind() == Code::LOAD_IC) {
|
| LoadFieldStub stub(field.is_inobject(holder),
|
| field.translate(holder),
|
| @@ -1387,7 +1387,7 @@ void LoadStubCompiler::GenerateLoadCallback(
|
| #endif
|
|
|
| ASSERT(!name_arg.is(scratch4()));
|
| - __ movq(name_arg, rsp);
|
| + __ movp(name_arg, rsp);
|
| __ PushReturnAddressFrom(scratch4());
|
|
|
| // v8::Arguments::values_ and handler for name.
|
| @@ -1400,7 +1400,7 @@ void LoadStubCompiler::GenerateLoadCallback(
|
| __ lea(rax, Operand(name_arg, 1 * kPointerSize));
|
|
|
| // v8::PropertyAccessorInfo::args_.
|
| - __ movq(StackSpaceOperand(0), rax);
|
| + __ movp(StackSpaceOperand(0), rax);
|
|
|
| // The context register (rsi) has been saved in PrepareCallApiFunction and
|
| // could be used to pass arguments.
|
| @@ -1543,7 +1543,7 @@ void CallStubCompiler::GenerateLoadFunctionFromCell(
|
| Label* miss) {
|
| // Get the value from the cell.
|
| __ Move(rdi, cell);
|
| - __ movq(rdi, FieldOperand(rdi, Cell::kValueOffset));
|
| + __ movp(rdi, FieldOperand(rdi, Cell::kValueOffset));
|
|
|
| // Check that the cell contains the same function.
|
| if (heap()->InNewSpace(*function)) {
|
| @@ -1593,39 +1593,6 @@ Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object,
|
| }
|
|
|
|
|
| -Handle<Code> CallStubCompiler::CompileArrayCodeCall(
|
| - Handle<Object> object,
|
| - Handle<JSObject> holder,
|
| - Handle<Cell> cell,
|
| - Handle<JSFunction> function,
|
| - Handle<String> name,
|
| - Code::StubType type) {
|
| - Label miss;
|
| -
|
| - HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
|
| - if (!cell.is_null()) {
|
| - ASSERT(cell->value() == *function);
|
| - GenerateLoadFunctionFromCell(cell, function, &miss);
|
| - }
|
| -
|
| - Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite();
|
| - site->SetElementsKind(GetInitialFastElementsKind());
|
| - Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site);
|
| - const int argc = arguments().immediate();
|
| - __ movq(rax, Immediate(argc));
|
| - __ Move(rbx, site_feedback_cell);
|
| - __ Move(rdi, function);
|
| -
|
| - ArrayConstructorStub stub(isolate());
|
| - __ TailCallStub(&stub);
|
| -
|
| - HandlerFrontendFooter(&miss);
|
| -
|
| - // Return the generated code.
|
| - return GetCode(type, name);
|
| -}
|
| -
|
| -
|
| Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| Handle<Object> object,
|
| Handle<JSObject> holder,
|
| @@ -1650,7 +1617,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| StackArgumentsAccessor args(rsp, argc);
|
| if (argc == 0) {
|
| // Noop, return the length.
|
| - __ movq(rax, FieldOperand(rdx, JSArray::kLengthOffset));
|
| + __ movp(rax, FieldOperand(rdx, JSArray::kLengthOffset));
|
| __ ret((argc + 1) * kPointerSize);
|
| } else {
|
| Label call_builtin;
|
| @@ -1659,7 +1626,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| Label attempt_to_grow_elements, with_write_barrier, check_double;
|
|
|
| // Get the elements array of the object.
|
| - __ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
| + __ movp(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
|
|
| // Check that the elements are in fast mode and writable.
|
| __ Cmp(FieldOperand(rdi, HeapObject::kMapOffset),
|
| @@ -1679,14 +1646,14 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| __ j(greater, &attempt_to_grow_elements);
|
|
|
| // Check if value is a smi.
|
| - __ movq(rcx, args.GetArgumentOperand(1));
|
| + __ movp(rcx, args.GetArgumentOperand(1));
|
| __ JumpIfNotSmi(rcx, &with_write_barrier);
|
|
|
| // Save new length.
|
| __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax);
|
|
|
| // Store the value.
|
| - __ movq(FieldOperand(rdi,
|
| + __ movp(FieldOperand(rdi,
|
| rax,
|
| times_pointer_size,
|
| FixedArray::kHeaderSize - argc * kPointerSize),
|
| @@ -1714,7 +1681,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| __ cmpl(rax, rcx);
|
| __ j(greater, &call_builtin);
|
|
|
| - __ movq(rcx, args.GetArgumentOperand(1));
|
| + __ movp(rcx, args.GetArgumentOperand(1));
|
| __ StoreNumberToDoubleElements(
|
| rcx, rdi, rax, xmm0, &call_builtin, argc * kDoubleSize);
|
|
|
| @@ -1725,7 +1692,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
|
| __ bind(&with_write_barrier);
|
|
|
| - __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset));
|
| + __ movp(rbx, FieldOperand(rdx, HeapObject::kMapOffset));
|
|
|
| if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) {
|
| Label fast_object, not_fast_object;
|
| @@ -1752,7 +1719,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| DONT_TRACK_ALLOCATION_SITE,
|
| NULL);
|
| // Restore edi.
|
| - __ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
| + __ movp(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
| __ jmp(&fast_object);
|
|
|
| __ bind(&try_holey_map);
|
| @@ -1765,7 +1732,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| GenerateMapChangeElementsTransition(masm(),
|
| DONT_TRACK_ALLOCATION_SITE,
|
| NULL);
|
| - __ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
| + __ movp(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
|
| __ bind(&fast_object);
|
| } else {
|
| __ CheckFastObjectElements(rbx, &call_builtin);
|
| @@ -1778,7 +1745,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| __ lea(rdx, FieldOperand(rdi,
|
| rax, times_pointer_size,
|
| FixedArray::kHeaderSize - argc * kPointerSize));
|
| - __ movq(Operand(rdx, 0), rcx);
|
| + __ movp(Operand(rdx, 0), rcx);
|
|
|
| __ RecordWrite(rdi, rdx, rcx, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
|
| OMIT_SMI_CHECK);
|
| @@ -1791,12 +1758,12 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| __ jmp(&call_builtin);
|
| }
|
|
|
| - __ movq(rbx, args.GetArgumentOperand(1));
|
| + __ movp(rbx, args.GetArgumentOperand(1));
|
| // Growing elements that are SMI-only requires special handling in case
|
| // the new element is non-Smi. For now, delegate to the builtin.
|
| Label no_fast_elements_check;
|
| __ JumpIfSmi(rbx, &no_fast_elements_check);
|
| - __ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
|
| + __ movp(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
|
| __ CheckFastObjectElements(rcx, &call_builtin, Label::kFar);
|
| __ bind(&no_fast_elements_check);
|
|
|
| @@ -1825,11 +1792,11 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| __ Store(new_space_allocation_top, rcx);
|
|
|
| // Push the argument...
|
| - __ movq(Operand(rdx, 0), rbx);
|
| + __ movp(Operand(rdx, 0), rbx);
|
| // ... and fill the rest with holes.
|
| __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
|
| for (int i = 1; i < kAllocationDelta; i++) {
|
| - __ movq(Operand(rdx, i * kPointerSize), kScratchRegister);
|
| + __ movp(Operand(rdx, i * kPointerSize), kScratchRegister);
|
| }
|
|
|
| // We know the elements array is in new space so we don't need the
|
| @@ -1840,7 +1807,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
| __ RecordWrite(rdi, rdx, rbx, kDontSaveFPRegs, OMIT_REMEMBERED_SET);
|
|
|
| // Restore receiver to rdx as finish sequence assumes it's here.
|
| - __ movq(rdx, args.GetReceiverOperand());
|
| + __ movp(rdx, args.GetReceiverOperand());
|
|
|
| // Increment element's and array's sizes.
|
| __ SmiAddConstant(FieldOperand(rdi, FixedArray::kLengthOffset),
|
| @@ -1848,7 +1815,7 @@ Handle<Code> CallStubCompiler::CompileArrayPushCall(
|
|
|
| // Make new length a smi before returning it.
|
| __ Integer32ToSmi(rax, rax);
|
| - __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rax);
|
| + __ movp(FieldOperand(rdx, JSArray::kLengthOffset), rax);
|
|
|
| __ ret((argc + 1) * kPointerSize);
|
| }
|
| @@ -1888,7 +1855,7 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
|
|
|
| // Get the elements array of the object.
|
| - __ movq(rbx, FieldOperand(rdx, JSArray::kElementsOffset));
|
| + __ movp(rbx, FieldOperand(rdx, JSArray::kElementsOffset));
|
|
|
| // Check that the elements are in fast mode and writable.
|
| __ CompareRoot(FieldOperand(rbx, HeapObject::kMapOffset),
|
| @@ -1902,7 +1869,7 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
|
|
| // Get the last element.
|
| __ LoadRoot(r9, Heap::kTheHoleValueRootIndex);
|
| - __ movq(rax, FieldOperand(rbx,
|
| + __ movp(rax, FieldOperand(rbx,
|
| rcx, times_pointer_size,
|
| FixedArray::kHeaderSize));
|
| // Check if element is already the hole.
|
| @@ -1914,7 +1881,7 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rcx);
|
|
|
| // Fill with the hole and return original value.
|
| - __ movq(FieldOperand(rbx,
|
| + __ movp(FieldOperand(rbx,
|
| rcx, times_pointer_size,
|
| FixedArray::kHeaderSize),
|
| r9);
|
| @@ -1938,376 +1905,6 @@ Handle<Code> CallStubCompiler::CompileArrayPopCall(
|
| }
|
|
|
|
|
| -Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
|
| - Handle<Object> object,
|
| - Handle<JSObject> holder,
|
| - Handle<Cell> cell,
|
| - Handle<JSFunction> function,
|
| - Handle<String> name,
|
| - Code::StubType type) {
|
| - // If object is not a string, bail out to regular call.
|
| - if (!object->IsString() || !cell.is_null()) return Handle<Code>::null();
|
| -
|
| - Label miss;
|
| - Label name_miss;
|
| - Label index_out_of_range;
|
| - Label* index_out_of_range_label = &index_out_of_range;
|
| - if (kind_ == Code::CALL_IC &&
|
| - (CallICBase::StringStubState::decode(extra_state()) ==
|
| - DEFAULT_STRING_STUB)) {
|
| - index_out_of_range_label = &miss;
|
| - }
|
| -
|
| - HandlerFrontendHeader(object, holder, name, STRING_CHECK, &name_miss);
|
| -
|
| - Register receiver = rbx;
|
| - Register index = rdi;
|
| - Register result = rax;
|
| - const int argc = arguments().immediate();
|
| - StackArgumentsAccessor args(rsp, argc);
|
| -
|
| - __ movq(receiver, args.GetReceiverOperand());
|
| - if (argc > 0) {
|
| - __ movq(index, args.GetArgumentOperand(1));
|
| - } else {
|
| - __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
|
| - }
|
| -
|
| - StringCharCodeAtGenerator generator(receiver,
|
| - index,
|
| - result,
|
| - &miss, // When not a string.
|
| - &miss, // When not a number.
|
| - index_out_of_range_label,
|
| - STRING_INDEX_IS_NUMBER);
|
| - generator.GenerateFast(masm());
|
| - __ ret((argc + 1) * kPointerSize);
|
| -
|
| - StubRuntimeCallHelper call_helper;
|
| - generator.GenerateSlow(masm(), call_helper);
|
| -
|
| - if (index_out_of_range.is_linked()) {
|
| - __ bind(&index_out_of_range);
|
| - __ LoadRoot(rax, Heap::kNanValueRootIndex);
|
| - __ ret((argc + 1) * kPointerSize);
|
| - }
|
| -
|
| - __ bind(&miss);
|
| - // Restore function name in rcx.
|
| - __ Move(rcx, name);
|
| - HandlerFrontendFooter(&name_miss);
|
| -
|
| - // Return the generated code.
|
| - return GetCode(type, name);
|
| -}
|
| -
|
| -
|
| -Handle<Code> CallStubCompiler::CompileStringCharAtCall(
|
| - Handle<Object> object,
|
| - Handle<JSObject> holder,
|
| - Handle<Cell> cell,
|
| - Handle<JSFunction> function,
|
| - Handle<String> name,
|
| - Code::StubType type) {
|
| - // If object is not a string, bail out to regular call.
|
| - if (!object->IsString() || !cell.is_null()) return Handle<Code>::null();
|
| -
|
| - const int argc = arguments().immediate();
|
| - StackArgumentsAccessor args(rsp, argc);
|
| -
|
| - Label miss;
|
| - Label name_miss;
|
| - Label index_out_of_range;
|
| - Label* index_out_of_range_label = &index_out_of_range;
|
| - if (kind_ == Code::CALL_IC &&
|
| - (CallICBase::StringStubState::decode(extra_state()) ==
|
| - DEFAULT_STRING_STUB)) {
|
| - index_out_of_range_label = &miss;
|
| - }
|
| -
|
| - HandlerFrontendHeader(object, holder, name, STRING_CHECK, &name_miss);
|
| -
|
| - Register receiver = rax;
|
| - Register index = rdi;
|
| - Register scratch = rdx;
|
| - Register result = rax;
|
| - __ movq(receiver, args.GetReceiverOperand());
|
| - if (argc > 0) {
|
| - __ movq(index, args.GetArgumentOperand(1));
|
| - } else {
|
| - __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
|
| - }
|
| -
|
| - StringCharAtGenerator generator(receiver,
|
| - index,
|
| - scratch,
|
| - result,
|
| - &miss, // When not a string.
|
| - &miss, // When not a number.
|
| - index_out_of_range_label,
|
| - STRING_INDEX_IS_NUMBER);
|
| - generator.GenerateFast(masm());
|
| - __ ret((argc + 1) * kPointerSize);
|
| -
|
| - StubRuntimeCallHelper call_helper;
|
| - generator.GenerateSlow(masm(), call_helper);
|
| -
|
| - if (index_out_of_range.is_linked()) {
|
| - __ bind(&index_out_of_range);
|
| - __ LoadRoot(rax, Heap::kempty_stringRootIndex);
|
| - __ ret((argc + 1) * kPointerSize);
|
| - }
|
| - __ bind(&miss);
|
| - // Restore function name in rcx.
|
| - __ Move(rcx, name);
|
| - HandlerFrontendFooter(&name_miss);
|
| -
|
| - // Return the generated code.
|
| - return GetCode(type, name);
|
| -}
|
| -
|
| -
|
| -Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
|
| - Handle<Object> object,
|
| - Handle<JSObject> holder,
|
| - Handle<Cell> cell,
|
| - Handle<JSFunction> function,
|
| - Handle<String> name,
|
| - Code::StubType type) {
|
| - // If the object is not a JSObject or we got an unexpected number of
|
| - // arguments, bail out to the regular call.
|
| - const int argc = arguments().immediate();
|
| - StackArgumentsAccessor args(rsp, argc);
|
| - if (!object->IsJSObject() || argc != 1) return Handle<Code>::null();
|
| -
|
| - Label miss;
|
| -
|
| - HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
|
| - if (!cell.is_null()) {
|
| - ASSERT(cell->value() == *function);
|
| - GenerateLoadFunctionFromCell(cell, function, &miss);
|
| - }
|
| -
|
| - // Load the char code argument.
|
| - Register code = rbx;
|
| - __ movq(code, args.GetArgumentOperand(1));
|
| -
|
| - // Check the code is a smi.
|
| - Label slow;
|
| - __ JumpIfNotSmi(code, &slow);
|
| -
|
| - // Convert the smi code to uint16.
|
| - __ SmiAndConstant(code, code, Smi::FromInt(0xffff));
|
| -
|
| - StringCharFromCodeGenerator generator(code, rax);
|
| - generator.GenerateFast(masm());
|
| - __ ret(2 * kPointerSize);
|
| -
|
| - StubRuntimeCallHelper call_helper;
|
| - generator.GenerateSlow(masm(), call_helper);
|
| -
|
| - __ bind(&slow);
|
| - // We do not have to patch the receiver because the function makes no use of
|
| - // it.
|
| - GenerateJumpFunctionIgnoreReceiver(function);
|
| -
|
| - HandlerFrontendFooter(&miss);
|
| -
|
| - // Return the generated code.
|
| - return GetCode(type, name);
|
| -}
|
| -
|
| -
|
| -Handle<Code> CallStubCompiler::CompileMathFloorCall(
|
| - Handle<Object> object,
|
| - Handle<JSObject> holder,
|
| - Handle<Cell> cell,
|
| - Handle<JSFunction> function,
|
| - Handle<String> name,
|
| - Code::StubType type) {
|
| - const int argc = arguments().immediate();
|
| - StackArgumentsAccessor args(rsp, argc);
|
| -
|
| - // If the object is not a JSObject or we got an unexpected number of
|
| - // arguments, bail out to the regular call.
|
| - if (!object->IsJSObject() || argc != 1) {
|
| - return Handle<Code>::null();
|
| - }
|
| -
|
| - Label miss, slow;
|
| -
|
| - HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
|
| - if (!cell.is_null()) {
|
| - ASSERT(cell->value() == *function);
|
| - GenerateLoadFunctionFromCell(cell, function, &miss);
|
| - }
|
| -
|
| - // Load the (only) argument into rax.
|
| - __ movq(rax, args.GetArgumentOperand(1));
|
| -
|
| - // Check if the argument is a smi.
|
| - Label smi;
|
| - STATIC_ASSERT(kSmiTag == 0);
|
| - __ JumpIfSmi(rax, &smi);
|
| -
|
| - // Check if the argument is a heap number and load its value into xmm0.
|
| - __ CheckMap(rax, factory()->heap_number_map(), &slow, DONT_DO_SMI_CHECK);
|
| - __ movsd(xmm0, FieldOperand(rax, HeapNumber::kValueOffset));
|
| -
|
| - // Check if the argument is strictly positive. Note this also discards NaN.
|
| - __ xorpd(xmm1, xmm1);
|
| - __ ucomisd(xmm0, xmm1);
|
| - __ j(below_equal, &slow);
|
| -
|
| - // Do a truncating conversion.
|
| - __ cvttsd2si(rax, xmm0);
|
| -
|
| - // Checks for 0x80000000 which signals a failed conversion.
|
| - Label conversion_failure;
|
| - __ cmpl(rax, Immediate(0x80000000));
|
| - __ j(equal, &conversion_failure);
|
| -
|
| - // Smi tag and return.
|
| - __ Integer32ToSmi(rax, rax);
|
| - __ bind(&smi);
|
| - __ ret(2 * kPointerSize);
|
| -
|
| - // Check if the argument is < 2^kMantissaBits.
|
| - Label already_round;
|
| - __ bind(&conversion_failure);
|
| - int64_t kTwoMantissaBits= V8_INT64_C(0x4330000000000000);
|
| - __ movq(rbx, kTwoMantissaBits);
|
| - __ movq(xmm1, rbx);
|
| - __ ucomisd(xmm0, xmm1);
|
| - __ j(above_equal, &already_round);
|
| -
|
| - // Save a copy of the argument.
|
| - __ movaps(xmm2, xmm0);
|
| -
|
| - // Compute (argument + 2^kMantissaBits) - 2^kMantissaBits.
|
| - __ addsd(xmm0, xmm1);
|
| - __ subsd(xmm0, xmm1);
|
| -
|
| - // Compare the argument and the tentative result to get the right mask:
|
| - // if xmm2 < xmm0:
|
| - // xmm2 = 1...1
|
| - // else:
|
| - // xmm2 = 0...0
|
| - __ cmpltsd(xmm2, xmm0);
|
| -
|
| - // Subtract 1 if the argument was less than the tentative result.
|
| - int64_t kOne = V8_INT64_C(0x3ff0000000000000);
|
| - __ movq(rbx, kOne);
|
| - __ movq(xmm1, rbx);
|
| - __ andpd(xmm1, xmm2);
|
| - __ subsd(xmm0, xmm1);
|
| -
|
| - // Return a new heap number.
|
| - __ AllocateHeapNumber(rax, rbx, &slow);
|
| - __ movsd(FieldOperand(rax, HeapNumber::kValueOffset), xmm0);
|
| - __ ret(2 * kPointerSize);
|
| -
|
| - // Return the argument (when it's an already round heap number).
|
| - __ bind(&already_round);
|
| - __ movq(rax, args.GetArgumentOperand(1));
|
| - __ ret(2 * kPointerSize);
|
| -
|
| - __ bind(&slow);
|
| - // We do not have to patch the receiver because the function makes no use of
|
| - // it.
|
| - GenerateJumpFunctionIgnoreReceiver(function);
|
| -
|
| - HandlerFrontendFooter(&miss);
|
| -
|
| - // Return the generated code.
|
| - return GetCode(type, name);
|
| -}
|
| -
|
| -
|
| -Handle<Code> CallStubCompiler::CompileMathAbsCall(
|
| - Handle<Object> object,
|
| - Handle<JSObject> holder,
|
| - Handle<Cell> cell,
|
| - Handle<JSFunction> function,
|
| - Handle<String> name,
|
| - Code::StubType type) {
|
| - // If the object is not a JSObject or we got an unexpected number of
|
| - // arguments, bail out to the regular call.
|
| - const int argc = arguments().immediate();
|
| - StackArgumentsAccessor args(rsp, argc);
|
| - if (!object->IsJSObject() || argc != 1) return Handle<Code>::null();
|
| -
|
| - Label miss;
|
| -
|
| - HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
|
| - if (!cell.is_null()) {
|
| - ASSERT(cell->value() == *function);
|
| - GenerateLoadFunctionFromCell(cell, function, &miss);
|
| - }
|
| -
|
| - // Load the (only) argument into rax.
|
| - __ movq(rax, args.GetArgumentOperand(1));
|
| -
|
| - // Check if the argument is a smi.
|
| - Label not_smi;
|
| - STATIC_ASSERT(kSmiTag == 0);
|
| - __ JumpIfNotSmi(rax, ¬_smi);
|
| -
|
| - // Branchless abs implementation, refer to below:
|
| - // http://graphics.stanford.edu/~seander/bithacks.html#IntegerAbs
|
| - // Set ebx to 1...1 (== -1) if the argument is negative, or to 0...0
|
| - // otherwise.
|
| - __ movq(rbx, rax);
|
| - __ sar(rbx, Immediate(kBitsPerPointer - 1));
|
| -
|
| - // Do bitwise not or do nothing depending on ebx.
|
| - __ xor_(rax, rbx);
|
| -
|
| - // Add 1 or do nothing depending on ebx.
|
| - __ subq(rax, rbx);
|
| -
|
| - // If the result is still negative, go to the slow case.
|
| - // This only happens for the most negative smi.
|
| - Label slow;
|
| - __ j(negative, &slow);
|
| -
|
| - __ ret(2 * kPointerSize);
|
| -
|
| - // Check if the argument is a heap number and load its value.
|
| - __ bind(¬_smi);
|
| - __ CheckMap(rax, factory()->heap_number_map(), &slow, DONT_DO_SMI_CHECK);
|
| - __ MoveDouble(rbx, FieldOperand(rax, HeapNumber::kValueOffset));
|
| -
|
| - // Check the sign of the argument. If the argument is positive,
|
| - // just return it.
|
| - Label negative_sign;
|
| - const int sign_mask_shift =
|
| - (HeapNumber::kExponentOffset - HeapNumber::kValueOffset) * kBitsPerByte;
|
| - __ Set(rdi, static_cast<int64_t>(HeapNumber::kSignMask) << sign_mask_shift);
|
| - __ testq(rbx, rdi);
|
| - __ j(not_zero, &negative_sign);
|
| - __ ret(2 * kPointerSize);
|
| -
|
| - // If the argument is negative, clear the sign, and return a new
|
| - // number. We still have the sign mask in rdi.
|
| - __ bind(&negative_sign);
|
| - __ xor_(rbx, rdi);
|
| - __ AllocateHeapNumber(rax, rdx, &slow);
|
| - __ MoveDouble(FieldOperand(rax, HeapNumber::kValueOffset), rbx);
|
| - __ ret(2 * kPointerSize);
|
| -
|
| - __ bind(&slow);
|
| - // We do not have to patch the receiver because the function makes no use of
|
| - // it.
|
| - GenerateJumpFunctionIgnoreReceiver(function);
|
| -
|
| - HandlerFrontendFooter(&miss);
|
| -
|
| - // Return the generated code.
|
| - return GetCode(type, name);
|
| -}
|
| -
|
| -
|
| Handle<Code> CallStubCompiler::CompileFastApiCall(
|
| const CallOptimization& optimization,
|
| Handle<Object> object,
|
| @@ -2330,7 +1927,7 @@ Handle<Code> CallStubCompiler::CompileFastApiCall(
|
|
|
| const int argc = arguments().immediate();
|
| StackArgumentsAccessor args(rsp, argc);
|
| - __ movq(rdx, args.GetReceiverOperand());
|
| + __ movp(rdx, args.GetReceiverOperand());
|
|
|
| // Check that the receiver isn't a smi.
|
| __ JumpIfSmi(rdx, &miss_before_stack_reserved);
|
| @@ -2379,7 +1976,7 @@ void CallStubCompiler::PatchImplicitReceiver(Handle<Object> object) {
|
| if (object->IsGlobalObject()) {
|
| StackArgumentsAccessor args(rsp, arguments());
|
| __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
|
| - __ movq(args.GetReceiverOperand(), rdx);
|
| + __ movp(args.GetReceiverOperand(), rdx);
|
| }
|
| }
|
|
|
| @@ -2394,7 +1991,7 @@ Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object,
|
| Register reg = rdx;
|
|
|
| StackArgumentsAccessor args(rsp, arguments());
|
| - __ movq(reg, args.GetReceiverOperand());
|
| + __ movp(reg, args.GetReceiverOperand());
|
|
|
| // Check that the receiver isn't a smi.
|
| if (check != NUMBER_CHECK) {
|
| @@ -2471,7 +2068,7 @@ void CallStubCompiler::GenerateJumpFunction(Handle<Object> object,
|
| // Check that the function really is a function.
|
| GenerateFunctionCheck(function, rbx, miss);
|
|
|
| - if (!function.is(rdi)) __ movq(rdi, function);
|
| + if (!function.is(rdi)) __ movp(rdi, function);
|
| PatchImplicitReceiver(object);
|
|
|
| // Invoke the function.
|
| @@ -2490,14 +2087,14 @@ Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
|
|
|
| // Get the receiver from the stack.
|
| StackArgumentsAccessor args(rsp, arguments());
|
| - __ movq(rdx, args.GetReceiverOperand());
|
| + __ movp(rdx, args.GetReceiverOperand());
|
|
|
| CallInterceptorCompiler compiler(this, arguments(), rcx);
|
| compiler.Compile(masm(), object, holder, name, &lookup, rdx, rbx, rdi, rax,
|
| &miss);
|
|
|
| // Restore receiver.
|
| - __ movq(rdx, args.GetReceiverOperand());
|
| + __ movp(rdx, args.GetReceiverOperand());
|
|
|
| GenerateJumpFunction(object, rax, &miss);
|
|
|
| @@ -2617,7 +2214,7 @@ void StoreStubCompiler::GenerateStoreViaSetter(
|
| __ pop(rax);
|
|
|
| // Restore context register.
|
| - __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
| + __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
| }
|
| __ ret(0);
|
| }
|
| @@ -2653,7 +2250,7 @@ Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
|
| Label miss;
|
| __ JumpIfSmi(receiver(), &miss, Label::kNear);
|
|
|
| - __ movq(scratch1(), FieldOperand(receiver(), HeapObject::kMapOffset));
|
| + __ movp(scratch1(), FieldOperand(receiver(), HeapObject::kMapOffset));
|
| int receiver_count = receiver_maps->length();
|
| for (int i = 0; i < receiver_count; ++i) {
|
| // Check map and tail call if there's a match
|
| @@ -2724,22 +2321,6 @@ Register* KeyedStoreStubCompiler::registers() {
|
| }
|
|
|
|
|
| -void KeyedLoadStubCompiler::GenerateNameCheck(Handle<Name> name,
|
| - Register name_reg,
|
| - Label* miss) {
|
| - __ Cmp(name_reg, name);
|
| - __ j(not_equal, miss);
|
| -}
|
| -
|
| -
|
| -void KeyedStoreStubCompiler::GenerateNameCheck(Handle<Name> name,
|
| - Register name_reg,
|
| - Label* miss) {
|
| - __ Cmp(name_reg, name);
|
| - __ j(not_equal, miss);
|
| -}
|
| -
|
| -
|
| #undef __
|
| #define __ ACCESS_MASM(masm)
|
|
|
| @@ -2769,7 +2350,7 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
| }
|
|
|
| // Restore context register.
|
| - __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
| + __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
| }
|
| __ ret(0);
|
| }
|
| @@ -2793,7 +2374,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
|
|
| // Get the value from the cell.
|
| __ Move(rbx, cell);
|
| - __ movq(rbx, FieldOperand(rbx, PropertyCell::kValueOffset));
|
| + __ movp(rbx, FieldOperand(rbx, PropertyCell::kValueOffset));
|
|
|
| // Check for deleted property if property can actually be deleted.
|
| if (!is_dont_delete) {
|
| @@ -2808,7 +2389,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal(
|
|
|
| Counters* counters = isolate()->counters();
|
| __ IncrementCounter(counters->named_load_global_stub(), 1);
|
| - __ movq(rax, rbx);
|
| + __ movp(rax, rbx);
|
| __ ret(0);
|
|
|
| // Return the generated code.
|
| @@ -2824,8 +2405,10 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
|
| IcCheckType check) {
|
| Label miss;
|
|
|
| - if (check == PROPERTY) {
|
| - GenerateNameCheck(name, this->name(), &miss);
|
| + if (check == PROPERTY &&
|
| + (kind() == Code::KEYED_LOAD_IC || kind() == Code::KEYED_STORE_IC)) {
|
| + __ Cmp(this->name(), name);
|
| + __ j(not_equal, &miss);
|
| }
|
|
|
| Label number_case;
|
| @@ -2833,7 +2416,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
|
| __ JumpIfSmi(receiver(), smi_target);
|
|
|
| Register map_reg = scratch1();
|
| - __ movq(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
|
| + __ movp(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
|
| int receiver_count = types->length();
|
| int number_of_handled_maps = 0;
|
| for (int current = 0; current < receiver_count; ++current) {
|
| @@ -2880,7 +2463,7 @@ void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
|
|
|
| __ JumpIfNotSmi(rax, &miss);
|
| __ SmiToInteger32(rbx, rax);
|
| - __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
|
| + __ movp(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
|
|
|
| // Check whether the elements is a number dictionary.
|
| // rdx: receiver
|
|
|