Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1022)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 23537067: Add support for keyed-call on arrays of fast elements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Compare with actual map loaded from the context Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 130 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
131 Isolate* isolate, 131 Isolate* isolate,
132 CodeStubInterfaceDescriptor* descriptor) { 132 CodeStubInterfaceDescriptor* descriptor) {
133 static Register registers[] = { edx }; 133 static Register registers[] = { edx };
134 descriptor->register_param_count_ = 1; 134 descriptor->register_param_count_ = 1;
135 descriptor->register_params_ = registers; 135 descriptor->register_params_ = registers;
136 descriptor->deoptimization_handler_ = NULL; 136 descriptor->deoptimization_handler_ = NULL;
137 } 137 }
138 138
139 139
140 void KeyedArrayCallStub::InitializeInterfaceDescriptor(
141 Isolate* isolate,
142 CodeStubInterfaceDescriptor* descriptor) {
143 static Register registers[] = { ecx };
144 descriptor->register_param_count_ = 1;
145 descriptor->register_params_ = registers;
146 descriptor->call_stub_ = true;
147 descriptor->deoptimization_handler_ =
148 FUNCTION_ADDR(KeyedCallIC_MissFromStubFailure);
149 }
150
151
140 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 152 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
141 Isolate* isolate, 153 Isolate* isolate,
142 CodeStubInterfaceDescriptor* descriptor) { 154 CodeStubInterfaceDescriptor* descriptor) {
143 static Register registers[] = { edx, ecx, eax }; 155 static Register registers[] = { edx, ecx, eax };
144 descriptor->register_param_count_ = 3; 156 descriptor->register_param_count_ = 3;
145 descriptor->register_params_ = registers; 157 descriptor->register_params_ = registers;
146 descriptor->deoptimization_handler_ = 158 descriptor->deoptimization_handler_ =
147 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 159 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
148 } 160 }
149 161
(...skipping 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after
4350 CEntryStub::GenerateAheadOfTime(isolate); 4362 CEntryStub::GenerateAheadOfTime(isolate);
4351 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate); 4363 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate);
4352 StubFailureTrampolineStub::GenerateAheadOfTime(isolate); 4364 StubFailureTrampolineStub::GenerateAheadOfTime(isolate);
4353 // It is important that the store buffer overflow stubs are generated first. 4365 // It is important that the store buffer overflow stubs are generated first.
4354 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate); 4366 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate);
4355 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 4367 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
4356 CreateAllocationSiteStub::GenerateAheadOfTime(isolate); 4368 CreateAllocationSiteStub::GenerateAheadOfTime(isolate);
4357 } 4369 }
4358 4370
4359 4371
4372 void CodeStub::GenerateStubsRequiringBuiltinsAheadOfTime(Isolate* isolate) {
4373 CallStubFailureTrampolineStub::GenerateAheadOfTime(isolate);
4374 }
4375
4376
4360 void CodeStub::GenerateFPStubs(Isolate* isolate) { 4377 void CodeStub::GenerateFPStubs(Isolate* isolate) {
4361 if (CpuFeatures::IsSupported(SSE2)) { 4378 if (CpuFeatures::IsSupported(SSE2)) {
4362 CEntryStub save_doubles(1, kSaveFPRegs); 4379 CEntryStub save_doubles(1, kSaveFPRegs);
4363 // Stubs might already be in the snapshot, detect that and don't regenerate, 4380 // Stubs might already be in the snapshot, detect that and don't regenerate,
4364 // which would lead to code stub initialization state being messed up. 4381 // which would lead to code stub initialization state being messed up.
4365 Code* save_doubles_code; 4382 Code* save_doubles_code;
4366 if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) { 4383 if (!save_doubles.FindCodeInCache(&save_doubles_code, isolate)) {
4367 save_doubles_code = *(save_doubles.GetCode(isolate)); 4384 save_doubles_code = *(save_doubles.GetCode(isolate));
4368 } 4385 }
4369 save_doubles_code->set_is_pregenerated(true); 4386 save_doubles_code->set_is_pregenerated(true);
(...skipping 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after
7080 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 7097 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
7081 __ pop(ecx); 7098 __ pop(ecx);
7082 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE 7099 int additional_offset = function_mode_ == JS_FUNCTION_STUB_MODE
7083 ? kPointerSize 7100 ? kPointerSize
7084 : 0; 7101 : 0;
7085 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); 7102 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset));
7086 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. 7103 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack.
7087 } 7104 }
7088 7105
7089 7106
7107 void CallStubFailureTrampolineStub::Generate(MacroAssembler* masm) {
7108 CEntryStub ces(1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
7109 __ call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
7110 __ mov(edi, eax);
7111 int parameter_count_offset =
7112 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
7113 __ mov(eax, MemOperand(ebp, parameter_count_offset));
7114 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
7115 ParameterCount argument_count(eax);
7116 __ InvokeFunction(edi,
7117 argument_count,
7118 JUMP_FUNCTION,
7119 NullCallWrapper(),
7120 CALL_AS_METHOD);
7121 }
7122
7123
7090 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { 7124 void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
7091 if (masm->isolate()->function_entry_hook() != NULL) { 7125 if (masm->isolate()->function_entry_hook() != NULL) {
7092 // It's always safe to call the entry hook stub, as the hook itself 7126 // It's always safe to call the entry hook stub, as the hook itself
7093 // is not allowed to call back to V8. 7127 // is not allowed to call back to V8.
7094 AllowStubCallsScope allow_stub_calls(masm, true); 7128 AllowStubCallsScope allow_stub_calls(masm, true);
7095 7129
7096 ProfileEntryHookStub stub; 7130 ProfileEntryHookStub stub;
7097 masm->CallStub(&stub); 7131 masm->CallStub(&stub);
7098 } 7132 }
7099 } 7133 }
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
7452 __ bind(&fast_elements_case); 7486 __ bind(&fast_elements_case);
7453 GenerateCase(masm, FAST_ELEMENTS); 7487 GenerateCase(masm, FAST_ELEMENTS);
7454 } 7488 }
7455 7489
7456 7490
7457 #undef __ 7491 #undef __
7458 7492
7459 } } // namespace v8::internal 7493 } } // namespace v8::internal
7460 7494
7461 #endif // V8_TARGET_ARCH_IA32 7495 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698