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

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

Issue 13886013: Add infrastructure to automatucally generate IC miss stubs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review feedback Created 7 years, 8 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
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( 135 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
136 Isolate* isolate, 136 Isolate* isolate,
137 CodeStubInterfaceDescriptor* descriptor) { 137 CodeStubInterfaceDescriptor* descriptor) {
138 InitializeArrayConstructorDescriptor(isolate, descriptor); 138 InitializeArrayConstructorDescriptor(isolate, descriptor);
139 } 139 }
140 140
141 141
142 #define __ ACCESS_MASM(masm) 142 #define __ ACCESS_MASM(masm)
143 143
144
145 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
146 // Update the static counter each time a new code stub is generated.
147 Isolate* isolate = masm->isolate();
148 isolate->counters()->code_stubs()->Increment();
149
150 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(isolate);
151 int param_count = descriptor->register_param_count_;
152 {
153 // Call the runtime system in a fresh internal frame.
154 FrameScope scope(masm, StackFrame::INTERNAL);
155 ASSERT(descriptor->register_param_count_ == 0 ||
156 eax.is(descriptor->register_params_[param_count - 1]));
157 // Push arguments
158 for (int i = 0; i < param_count; ++i) {
159 __ push(descriptor->register_params_[i]);
160 }
161 ExternalReference miss = descriptor->miss_handler_;
162 __ CallExternalReference(miss, descriptor->register_param_count_);
163 }
164
165 __ ret(0);
166 }
167
168
144 void ToNumberStub::Generate(MacroAssembler* masm) { 169 void ToNumberStub::Generate(MacroAssembler* masm) {
145 // The ToNumber stub takes one argument in eax. 170 // The ToNumber stub takes one argument in eax.
146 Label check_heap_number, call_builtin; 171 Label check_heap_number, call_builtin;
147 __ JumpIfNotSmi(eax, &check_heap_number, Label::kNear); 172 __ JumpIfNotSmi(eax, &check_heap_number, Label::kNear);
148 __ ret(0); 173 __ ret(0);
149 174
150 __ bind(&check_heap_number); 175 __ bind(&check_heap_number);
151 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); 176 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
152 Factory* factory = masm->isolate()->factory(); 177 Factory* factory = masm->isolate()->factory();
153 __ cmp(ebx, Immediate(factory->heap_number_map())); 178 __ cmp(ebx, Immediate(factory->heap_number_map()));
(...skipping 7530 matching lines...) Expand 10 before | Expand all | Expand 10 after
7684 // Restore ecx. 7709 // Restore ecx.
7685 __ pop(ecx); 7710 __ pop(ecx);
7686 __ ret(0); 7711 __ ret(0);
7687 } 7712 }
7688 7713
7689 #undef __ 7714 #undef __
7690 7715
7691 } } // namespace v8::internal 7716 } } // namespace v8::internal
7692 7717
7693 #endif // V8_TARGET_ARCH_IA32 7718 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698