OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // -- esp[8] : api function | 422 // -- esp[8] : api function |
423 // (first fast api call extra argument) | 423 // (first fast api call extra argument) |
424 // -- esp[12] : api call data | 424 // -- esp[12] : api call data |
425 // -- esp[16] : last argument | 425 // -- esp[16] : last argument |
426 // -- ... | 426 // -- ... |
427 // -- esp[(argc + 3) * 4] : first argument | 427 // -- esp[(argc + 3) * 4] : first argument |
428 // -- esp[(argc + 4) * 4] : receiver | 428 // -- esp[(argc + 4) * 4] : receiver |
429 // ----------------------------------- | 429 // ----------------------------------- |
430 // Get the function and setup the context. | 430 // Get the function and setup the context. |
431 Handle<JSFunction> function = optimization.constant_function(); | 431 Handle<JSFunction> function = optimization.constant_function(); |
432 __ mov(edi, Immediate(function)); | 432 __ LoadHeapObject(edi, function); |
433 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 433 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
434 | 434 |
435 // Pass the additional arguments. | 435 // Pass the additional arguments. |
436 __ mov(Operand(esp, 2 * kPointerSize), edi); | 436 __ mov(Operand(esp, 2 * kPointerSize), edi); |
437 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 437 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
438 Handle<Object> call_data(api_call_info->data()); | 438 Handle<Object> call_data(api_call_info->data()); |
439 if (masm->isolate()->heap()->InNewSpace(*call_data)) { | 439 if (masm->isolate()->heap()->InNewSpace(*call_data)) { |
440 __ mov(ecx, api_call_info); | 440 __ mov(ecx, api_call_info); |
441 __ mov(ebx, FieldOperand(ecx, CallHandlerInfo::kDataOffset)); | 441 __ mov(ebx, FieldOperand(ecx, CallHandlerInfo::kDataOffset)); |
442 __ mov(Operand(esp, 3 * kPointerSize), ebx); | 442 __ mov(Operand(esp, 3 * kPointerSize), ebx); |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 __ CallApiFunctionAndReturn(getter_address, kStackSpace); | 1018 __ CallApiFunctionAndReturn(getter_address, kStackSpace); |
1019 } | 1019 } |
1020 | 1020 |
1021 | 1021 |
1022 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object, | 1022 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object, |
1023 Handle<JSObject> holder, | 1023 Handle<JSObject> holder, |
1024 Register receiver, | 1024 Register receiver, |
1025 Register scratch1, | 1025 Register scratch1, |
1026 Register scratch2, | 1026 Register scratch2, |
1027 Register scratch3, | 1027 Register scratch3, |
1028 Handle<Object> value, | 1028 Handle<JSFunction> value, |
1029 Handle<String> name, | 1029 Handle<String> name, |
1030 Label* miss) { | 1030 Label* miss) { |
1031 // Check that the receiver isn't a smi. | 1031 // Check that the receiver isn't a smi. |
1032 __ JumpIfSmi(receiver, miss); | 1032 __ JumpIfSmi(receiver, miss); |
1033 | 1033 |
1034 // Check that the maps haven't changed. | 1034 // Check that the maps haven't changed. |
1035 CheckPrototypes( | 1035 CheckPrototypes( |
1036 object, receiver, holder, scratch1, scratch2, scratch3, name, miss); | 1036 object, receiver, holder, scratch1, scratch2, scratch3, name, miss); |
1037 | 1037 |
1038 // Return the constant value. | 1038 // Return the constant value. |
1039 __ mov(eax, value); | 1039 __ LoadHeapObject(eax, value); |
1040 __ ret(0); | 1040 __ ret(0); |
1041 } | 1041 } |
1042 | 1042 |
1043 | 1043 |
1044 void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object, | 1044 void StubCompiler::GenerateLoadInterceptor(Handle<JSObject> object, |
1045 Handle<JSObject> interceptor_holder, | 1045 Handle<JSObject> interceptor_holder, |
1046 LookupResult* lookup, | 1046 LookupResult* lookup, |
1047 Register receiver, | 1047 Register receiver, |
1048 Register name_reg, | 1048 Register name_reg, |
1049 Register scratch1, | 1049 Register scratch1, |
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2722 __ bind(&miss); | 2722 __ bind(&miss); |
2723 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2723 GenerateLoadMiss(masm(), Code::LOAD_IC); |
2724 | 2724 |
2725 // Return the generated code. | 2725 // Return the generated code. |
2726 return GetCode(CALLBACKS, name); | 2726 return GetCode(CALLBACKS, name); |
2727 } | 2727 } |
2728 | 2728 |
2729 | 2729 |
2730 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, | 2730 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
2731 Handle<JSObject> holder, | 2731 Handle<JSObject> holder, |
2732 Handle<Object> value, | 2732 Handle<JSFunction> value, |
2733 Handle<String> name) { | 2733 Handle<String> name) { |
2734 // ----------- S t a t e ------------- | 2734 // ----------- S t a t e ------------- |
2735 // -- eax : receiver | 2735 // -- eax : receiver |
2736 // -- ecx : name | 2736 // -- ecx : name |
2737 // -- esp[0] : return address | 2737 // -- esp[0] : return address |
2738 // ----------------------------------- | 2738 // ----------------------------------- |
2739 Label miss; | 2739 Label miss; |
2740 | 2740 |
2741 GenerateLoadConstant(object, holder, eax, ebx, edx, edi, value, name, &miss); | 2741 GenerateLoadConstant(object, holder, eax, ebx, edx, edi, value, name, &miss); |
2742 __ bind(&miss); | 2742 __ bind(&miss); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 | 2884 |
2885 // Return the generated code. | 2885 // Return the generated code. |
2886 return GetCode(CALLBACKS, name); | 2886 return GetCode(CALLBACKS, name); |
2887 } | 2887 } |
2888 | 2888 |
2889 | 2889 |
2890 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( | 2890 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( |
2891 Handle<String> name, | 2891 Handle<String> name, |
2892 Handle<JSObject> receiver, | 2892 Handle<JSObject> receiver, |
2893 Handle<JSObject> holder, | 2893 Handle<JSObject> holder, |
2894 Handle<Object> value) { | 2894 Handle<JSFunction> value) { |
2895 // ----------- S t a t e ------------- | 2895 // ----------- S t a t e ------------- |
2896 // -- eax : key | 2896 // -- eax : key |
2897 // -- edx : receiver | 2897 // -- edx : receiver |
2898 // -- esp[0] : return address | 2898 // -- esp[0] : return address |
2899 // ----------------------------------- | 2899 // ----------------------------------- |
2900 Label miss; | 2900 Label miss; |
2901 | 2901 |
2902 Counters* counters = isolate()->counters(); | 2902 Counters* counters = isolate()->counters(); |
2903 __ IncrementCounter(counters->keyed_load_constant_function(), 1); | 2903 __ IncrementCounter(counters->keyed_load_constant_function(), 1); |
2904 | 2904 |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3845 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3845 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3846 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3846 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3847 } | 3847 } |
3848 | 3848 |
3849 | 3849 |
3850 #undef __ | 3850 #undef __ |
3851 | 3851 |
3852 } } // namespace v8::internal | 3852 } } // namespace v8::internal |
3853 | 3853 |
3854 #endif // V8_TARGET_ARCH_IA32 | 3854 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |