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

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

Issue 517993002: Refactoring InterfaceDescriptors away from code-stubs.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports. Created 6 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
« no previous file with comments | « src/arm64/code-stubs-arm64.h ('k') | src/arm64/interface-descriptors-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // cp: context 153 // cp: context
154 // x0: value to compare 154 // x0: value to compare
155 Register registers[] = { cp, x0 }; 155 Register registers[] = { cp, x0 };
156 descriptor->Initialize(MajorKey(), arraysize(registers), registers, 156 descriptor->Initialize(MajorKey(), arraysize(registers), registers,
157 FUNCTION_ADDR(CompareNilIC_Miss)); 157 FUNCTION_ADDR(CompareNilIC_Miss));
158 descriptor->SetMissHandler( 158 descriptor->SetMissHandler(
159 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); 159 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate()));
160 } 160 }
161 161
162 162
163 const Register InterfaceDescriptor::ContextRegister() { return cp; }
164
165
166 static void InitializeArrayConstructorDescriptor( 163 static void InitializeArrayConstructorDescriptor(
167 CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor, 164 CodeStub::Major major, CodeStubInterfaceDescriptor* descriptor,
168 int constant_stack_parameter_count) { 165 int constant_stack_parameter_count) {
169 // cp: context 166 // cp: context
170 // x1: function 167 // x1: function
171 // x2: allocation site with elements kind 168 // x2: allocation site with elements kind
172 // x0: number of arguments to the constructor function 169 // x0: number of arguments to the constructor function
173 Address deopt_handler = Runtime::FunctionForId( 170 Address deopt_handler = Runtime::FunctionForId(
174 Runtime::kArrayConstructor)->entry; 171 Runtime::kArrayConstructor)->entry;
175 172
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 CodeStubInterfaceDescriptor* descriptor) { 297 CodeStubInterfaceDescriptor* descriptor) {
301 // cp: context 298 // cp: context
302 // x1: left operand 299 // x1: left operand
303 // x0: right operand 300 // x0: right operand
304 Register registers[] = { cp, x1, x0 }; 301 Register registers[] = { cp, x1, x0 };
305 descriptor->Initialize(MajorKey(), arraysize(registers), registers, 302 descriptor->Initialize(MajorKey(), arraysize(registers), registers,
306 Runtime::FunctionForId(Runtime::kStringAdd)->entry); 303 Runtime::FunctionForId(Runtime::kStringAdd)->entry);
307 } 304 }
308 305
309 306
310 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
311 static PlatformInterfaceDescriptor default_descriptor =
312 PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
313
314 static PlatformInterfaceDescriptor noInlineDescriptor =
315 PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
316
317 {
318 CallInterfaceDescriptor* descriptor =
319 isolate->call_descriptor(Isolate::ArgumentAdaptorCall);
320 Register registers[] = { cp, // context
321 x1, // JSFunction
322 x0, // actual number of arguments
323 x2, // expected number of arguments
324 };
325 Representation representations[] = {
326 Representation::Tagged(), // context
327 Representation::Tagged(), // JSFunction
328 Representation::Integer32(), // actual number of arguments
329 Representation::Integer32(), // expected number of arguments
330 };
331 descriptor->Initialize(arraysize(registers), registers,
332 representations, &default_descriptor);
333 }
334 {
335 CallInterfaceDescriptor* descriptor =
336 isolate->call_descriptor(Isolate::KeyedCall);
337 Register registers[] = { cp, // context
338 x2, // key
339 };
340 Representation representations[] = {
341 Representation::Tagged(), // context
342 Representation::Tagged(), // key
343 };
344 descriptor->Initialize(arraysize(registers), registers,
345 representations, &noInlineDescriptor);
346 }
347 {
348 CallInterfaceDescriptor* descriptor =
349 isolate->call_descriptor(Isolate::NamedCall);
350 Register registers[] = { cp, // context
351 x2, // name
352 };
353 Representation representations[] = {
354 Representation::Tagged(), // context
355 Representation::Tagged(), // name
356 };
357 descriptor->Initialize(arraysize(registers), registers,
358 representations, &noInlineDescriptor);
359 }
360 {
361 CallInterfaceDescriptor* descriptor =
362 isolate->call_descriptor(Isolate::CallHandler);
363 Register registers[] = { cp, // context
364 x0, // receiver
365 };
366 Representation representations[] = {
367 Representation::Tagged(), // context
368 Representation::Tagged(), // receiver
369 };
370 descriptor->Initialize(arraysize(registers), registers,
371 representations, &default_descriptor);
372 }
373 {
374 CallInterfaceDescriptor* descriptor =
375 isolate->call_descriptor(Isolate::ApiFunctionCall);
376 Register registers[] = { cp, // context
377 x0, // callee
378 x4, // call_data
379 x2, // holder
380 x1, // api_function_address
381 };
382 Representation representations[] = {
383 Representation::Tagged(), // context
384 Representation::Tagged(), // callee
385 Representation::Tagged(), // call_data
386 Representation::Tagged(), // holder
387 Representation::External(), // api_function_address
388 };
389 descriptor->Initialize(arraysize(registers), registers,
390 representations, &default_descriptor);
391 }
392 }
393
394
395 #define __ ACCESS_MASM(masm) 307 #define __ ACCESS_MASM(masm)
396 308
397 309
398 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { 310 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
399 // Update the static counter each time a new code stub is generated. 311 // Update the static counter each time a new code stub is generated.
400 isolate()->counters()->code_stubs()->Increment(); 312 isolate()->counters()->code_stubs()->Increment();
401 313
402 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); 314 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor();
403 int param_count = descriptor->GetEnvironmentParameterCount(); 315 int param_count = descriptor->GetEnvironmentParameterCount();
404 { 316 {
(...skipping 5032 matching lines...) Expand 10 before | Expand all | Expand 10 after
5437 MemOperand(fp, 6 * kPointerSize), 5349 MemOperand(fp, 6 * kPointerSize),
5438 NULL); 5350 NULL);
5439 } 5351 }
5440 5352
5441 5353
5442 #undef __ 5354 #undef __
5443 5355
5444 } } // namespace v8::internal 5356 } } // namespace v8::internal
5445 5357
5446 #endif // V8_TARGET_ARCH_ARM64 5358 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/code-stubs-arm64.h ('k') | src/arm64/interface-descriptors-arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698