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

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

Issue 104663004: Preview of a first step towards unification of hydrogen calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge fix Created 6 years, 11 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/arm/code-stubs-arm.h ('k') | src/arm/lithium-arm.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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 Isolate* isolate, 354 Isolate* isolate,
355 CodeStubInterfaceDescriptor* descriptor) { 355 CodeStubInterfaceDescriptor* descriptor) {
356 static Register registers[] = { r1, r0 }; 356 static Register registers[] = { r1, r0 };
357 descriptor->register_param_count_ = 2; 357 descriptor->register_param_count_ = 2;
358 descriptor->register_params_ = registers; 358 descriptor->register_params_ = registers;
359 descriptor->deoptimization_handler_ = 359 descriptor->deoptimization_handler_ =
360 Runtime::FunctionForId(Runtime::kStringAdd)->entry; 360 Runtime::FunctionForId(Runtime::kStringAdd)->entry;
361 } 361 }
362 362
363 363
364 void CallDescriptors::InitializeForIsolate(Isolate* isolate) {
365 static PlatformCallInterfaceDescriptor default_descriptor =
366 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS);
367
368 static PlatformCallInterfaceDescriptor noInlineDescriptor =
369 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS);
370
371 {
372 CallInterfaceDescriptor* descriptor =
373 isolate->call_descriptor(Isolate::ArgumentAdaptorCall);
374 static Register registers[] = { r1, // JSFunction
375 cp, // context
376 r0, // actual number of arguments
377 r2, // expected number of arguments
378 };
379 static Representation representations[] = {
380 Representation::Tagged(), // JSFunction
381 Representation::Tagged(), // context
382 Representation::Integer32(), // actual number of arguments
383 Representation::Integer32(), // expected number of arguments
384 };
385 descriptor->register_param_count_ = 4;
386 descriptor->register_params_ = registers;
387 descriptor->param_representations_ = representations;
388 descriptor->platform_specific_descriptor_ = &default_descriptor;
389 }
390 {
391 CallInterfaceDescriptor* descriptor =
392 isolate->call_descriptor(Isolate::KeyedCall);
393 static Register registers[] = { cp, // context
394 r2, // key
395 };
396 static Representation representations[] = {
397 Representation::Tagged(), // context
398 Representation::Tagged(), // key
399 };
400 descriptor->register_param_count_ = 2;
401 descriptor->register_params_ = registers;
402 descriptor->param_representations_ = representations;
403 descriptor->platform_specific_descriptor_ = &noInlineDescriptor;
404 }
405 {
406 CallInterfaceDescriptor* descriptor =
407 isolate->call_descriptor(Isolate::NamedCall);
408 static Register registers[] = { cp, // context
409 r2, // name
410 };
411 static Representation representations[] = {
412 Representation::Tagged(), // context
413 Representation::Tagged(), // name
414 };
415 descriptor->register_param_count_ = 2;
416 descriptor->register_params_ = registers;
417 descriptor->param_representations_ = representations;
418 descriptor->platform_specific_descriptor_ = &noInlineDescriptor;
419 }
420 }
421
422
364 #define __ ACCESS_MASM(masm) 423 #define __ ACCESS_MASM(masm)
365 424
366 425
367 static void EmitIdenticalObjectComparison(MacroAssembler* masm, 426 static void EmitIdenticalObjectComparison(MacroAssembler* masm,
368 Label* slow, 427 Label* slow,
369 Condition cond); 428 Condition cond);
370 static void EmitSmiNonsmiComparison(MacroAssembler* masm, 429 static void EmitSmiNonsmiComparison(MacroAssembler* masm,
371 Register lhs, 430 Register lhs,
372 Register rhs, 431 Register rhs,
373 Label* lhs_not_nan, 432 Label* lhs_not_nan,
(...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after
3210 masm->isolate()->heap()->undefined_value()); 3269 masm->isolate()->heap()->undefined_value());
3211 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 3270 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
3212 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset)); 3271 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset));
3213 } 3272 }
3214 // Check for function proxy. 3273 // Check for function proxy.
3215 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); 3274 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE));
3216 __ b(ne, &non_function); 3275 __ b(ne, &non_function);
3217 __ push(r1); // put proxy as additional argument 3276 __ push(r1); // put proxy as additional argument
3218 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32)); 3277 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32));
3219 __ mov(r2, Operand::Zero()); 3278 __ mov(r2, Operand::Zero());
3220 __ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY); 3279 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY);
3221 { 3280 {
3222 Handle<Code> adaptor = 3281 Handle<Code> adaptor =
3223 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); 3282 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline();
3224 __ Jump(adaptor, RelocInfo::CODE_TARGET); 3283 __ Jump(adaptor, RelocInfo::CODE_TARGET);
3225 } 3284 }
3226 3285
3227 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead 3286 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead
3228 // of the original receiver from the call site). 3287 // of the original receiver from the call site).
3229 __ bind(&non_function); 3288 __ bind(&non_function);
3230 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); 3289 __ str(r1, MemOperand(sp, argc_ * kPointerSize));
3231 __ mov(r0, Operand(argc_)); // Set up the number of arguments. 3290 __ mov(r0, Operand(argc_)); // Set up the number of arguments.
3232 __ mov(r2, Operand::Zero()); 3291 __ mov(r2, Operand::Zero());
3233 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); 3292 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION);
3234 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 3293 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
3235 RelocInfo::CODE_TARGET); 3294 RelocInfo::CODE_TARGET);
3236 } 3295 }
3237 3296
3238 3297
3239 void CallConstructStub::Generate(MacroAssembler* masm) { 3298 void CallConstructStub::Generate(MacroAssembler* masm) {
3240 // r0 : number of arguments 3299 // r0 : number of arguments
3241 // r1 : the function to call 3300 // r1 : the function to call
3242 // r2 : cache cell for call target 3301 // r2 : cache cell for call target
3243 Label slow, non_function_call; 3302 Label slow, non_function_call;
(...skipping 15 matching lines...) Expand all
3259 SharedFunctionInfo::kConstructStubOffset)); 3318 SharedFunctionInfo::kConstructStubOffset));
3260 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); 3319 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag));
3261 3320
3262 // r0: number of arguments 3321 // r0: number of arguments
3263 // r1: called object 3322 // r1: called object
3264 // r3: object type 3323 // r3: object type
3265 Label do_call; 3324 Label do_call;
3266 __ bind(&slow); 3325 __ bind(&slow);
3267 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); 3326 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE));
3268 __ b(ne, &non_function_call); 3327 __ b(ne, &non_function_call);
3269 __ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); 3328 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR);
3270 __ jmp(&do_call); 3329 __ jmp(&do_call);
3271 3330
3272 __ bind(&non_function_call); 3331 __ bind(&non_function_call);
3273 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); 3332 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
3274 __ bind(&do_call); 3333 __ bind(&do_call);
3275 // Set expected number of arguments to zero (not changing r0). 3334 // Set expected number of arguments to zero (not changing r0).
3276 __ mov(r2, Operand::Zero()); 3335 __ mov(r2, Operand::Zero());
3277 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), 3336 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
3278 RelocInfo::CODE_TARGET); 3337 RelocInfo::CODE_TARGET);
3279 } 3338 }
3280 3339
3281 3340
3282 // StringCharCodeAtGenerator 3341 // StringCharCodeAtGenerator
3283 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { 3342 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
(...skipping 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after
5792 __ bind(&fast_elements_case); 5851 __ bind(&fast_elements_case);
5793 GenerateCase(masm, FAST_ELEMENTS); 5852 GenerateCase(masm, FAST_ELEMENTS);
5794 } 5853 }
5795 5854
5796 5855
5797 #undef __ 5856 #undef __
5798 5857
5799 } } // namespace v8::internal 5858 } } // namespace v8::internal
5800 5859
5801 #endif // V8_TARGET_ARCH_ARM 5860 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/arm/lithium-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698