| OLD | NEW |
| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 Isolate* isolate, | 343 Isolate* isolate, |
| 344 CodeStubInterfaceDescriptor* descriptor) { | 344 CodeStubInterfaceDescriptor* descriptor) { |
| 345 static Register registers[] = { r1, r0 }; | 345 static Register registers[] = { r1, r0 }; |
| 346 descriptor->register_param_count_ = 2; | 346 descriptor->register_param_count_ = 2; |
| 347 descriptor->register_params_ = registers; | 347 descriptor->register_params_ = registers; |
| 348 descriptor->deoptimization_handler_ = | 348 descriptor->deoptimization_handler_ = |
| 349 Runtime::FunctionForId(Runtime::kStringAdd)->entry; | 349 Runtime::FunctionForId(Runtime::kStringAdd)->entry; |
| 350 } | 350 } |
| 351 | 351 |
| 352 | 352 |
| 353 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 354 { |
| 355 CodeStubInterfaceDescriptor* descriptor = |
| 356 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); |
| 357 static Register registers[] = { r1, // JSFunction |
| 358 cp, // context |
| 359 r5, // call kind |
| 360 r0, // actual number of arguments |
| 361 r2, // expected number of arguments |
| 362 }; |
| 363 static Representation representations[] = { |
| 364 Representation::Tagged(), // JSFunction |
| 365 Representation::Tagged(), // context |
| 366 Representation::Smi(), // call kind |
| 367 Representation::Integer32(), // actual number of arguments |
| 368 Representation::Integer32(), // expected number of arguments |
| 369 }; |
| 370 descriptor->register_param_count_ = 5; |
| 371 descriptor->register_params_ = registers; |
| 372 descriptor->param_representations_ = representations; |
| 373 descriptor->deoptimization_handler_ = NULL; |
| 374 } |
| 375 { |
| 376 CodeStubInterfaceDescriptor* descriptor = |
| 377 isolate->call_descriptor(Isolate::KeyedCall); |
| 378 static Register registers[] = { cp, // context |
| 379 r2, // key |
| 380 }; |
| 381 static Representation representations[] = { |
| 382 Representation::Tagged(), // context |
| 383 Representation::Tagged(), // key |
| 384 }; |
| 385 descriptor->register_param_count_ = 2; |
| 386 descriptor->register_params_ = registers; |
| 387 descriptor->param_representations_ = representations; |
| 388 descriptor->deoptimization_handler_ = NULL; |
| 389 } |
| 390 { |
| 391 CodeStubInterfaceDescriptor* descriptor = |
| 392 isolate->call_descriptor(Isolate::NamedCall); |
| 393 static Register registers[] = { cp, // context |
| 394 r2, // name |
| 395 }; |
| 396 static Representation representations[] = { |
| 397 Representation::Tagged(), // context |
| 398 Representation::Tagged(), // name |
| 399 }; |
| 400 descriptor->register_param_count_ = 2; |
| 401 descriptor->register_params_ = registers; |
| 402 descriptor->param_representations_ = representations; |
| 403 descriptor->deoptimization_handler_ = NULL; |
| 404 } |
| 405 } |
| 406 |
| 407 |
| 353 #define __ ACCESS_MASM(masm) | 408 #define __ ACCESS_MASM(masm) |
| 354 | 409 |
| 355 | 410 |
| 356 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 411 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
| 357 Label* slow, | 412 Label* slow, |
| 358 Condition cond); | 413 Condition cond); |
| 359 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 414 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
| 360 Register lhs, | 415 Register lhs, |
| 361 Register rhs, | 416 Register rhs, |
| 362 Label* lhs_not_nan, | 417 Label* lhs_not_nan, |
| (...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3436 masm->isolate()->heap()->undefined_value()); | 3491 masm->isolate()->heap()->undefined_value()); |
| 3437 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 3492 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 3438 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset)); | 3493 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset)); |
| 3439 } | 3494 } |
| 3440 // Check for function proxy. | 3495 // Check for function proxy. |
| 3441 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); | 3496 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 3442 __ b(ne, &non_function); | 3497 __ b(ne, &non_function); |
| 3443 __ push(r1); // put proxy as additional argument | 3498 __ push(r1); // put proxy as additional argument |
| 3444 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32)); | 3499 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32)); |
| 3445 __ mov(r2, Operand::Zero()); | 3500 __ mov(r2, Operand::Zero()); |
| 3446 __ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY); | 3501 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY); |
| 3447 __ SetCallKind(r5, CALL_AS_METHOD); | 3502 __ SetCallKind(r5, CALL_AS_METHOD); |
| 3448 { | 3503 { |
| 3449 Handle<Code> adaptor = | 3504 Handle<Code> adaptor = |
| 3450 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); | 3505 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
| 3451 __ Jump(adaptor, RelocInfo::CODE_TARGET); | 3506 __ Jump(adaptor, RelocInfo::CODE_TARGET); |
| 3452 } | 3507 } |
| 3453 | 3508 |
| 3454 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead | 3509 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
| 3455 // of the original receiver from the call site). | 3510 // of the original receiver from the call site). |
| 3456 __ bind(&non_function); | 3511 __ bind(&non_function); |
| 3457 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); | 3512 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); |
| 3458 __ mov(r0, Operand(argc_)); // Set up the number of arguments. | 3513 __ mov(r0, Operand(argc_)); // Set up the number of arguments. |
| 3459 __ mov(r2, Operand::Zero()); | 3514 __ mov(r2, Operand::Zero()); |
| 3460 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 3515 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION); |
| 3461 __ SetCallKind(r5, CALL_AS_METHOD); | 3516 __ SetCallKind(r5, CALL_AS_METHOD); |
| 3462 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3517 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
| 3463 RelocInfo::CODE_TARGET); | 3518 RelocInfo::CODE_TARGET); |
| 3464 } | 3519 } |
| 3465 | 3520 |
| 3466 | 3521 |
| 3467 void CallConstructStub::Generate(MacroAssembler* masm) { | 3522 void CallConstructStub::Generate(MacroAssembler* masm) { |
| 3468 // r0 : number of arguments | 3523 // r0 : number of arguments |
| 3469 // r1 : the function to call | 3524 // r1 : the function to call |
| 3470 // r2 : cache cell for call target | 3525 // r2 : cache cell for call target |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3487 SharedFunctionInfo::kConstructStubOffset)); | 3542 SharedFunctionInfo::kConstructStubOffset)); |
| 3488 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3543 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 3489 | 3544 |
| 3490 // r0: number of arguments | 3545 // r0: number of arguments |
| 3491 // r1: called object | 3546 // r1: called object |
| 3492 // r3: object type | 3547 // r3: object type |
| 3493 Label do_call; | 3548 Label do_call; |
| 3494 __ bind(&slow); | 3549 __ bind(&slow); |
| 3495 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); | 3550 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 3496 __ b(ne, &non_function_call); | 3551 __ b(ne, &non_function_call); |
| 3497 __ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); | 3552 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); |
| 3498 __ jmp(&do_call); | 3553 __ jmp(&do_call); |
| 3499 | 3554 |
| 3500 __ bind(&non_function_call); | 3555 __ bind(&non_function_call); |
| 3501 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); | 3556 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
| 3502 __ bind(&do_call); | 3557 __ bind(&do_call); |
| 3503 // Set expected number of arguments to zero (not changing r0). | 3558 // Set expected number of arguments to zero (not changing r0). |
| 3504 __ mov(r2, Operand::Zero()); | 3559 __ mov(r2, Operand::Zero()); |
| 3505 __ SetCallKind(r5, CALL_AS_METHOD); | 3560 __ SetCallKind(r5, CALL_AS_METHOD); |
| 3506 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3561 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
| 3507 RelocInfo::CODE_TARGET); | 3562 RelocInfo::CODE_TARGET); |
| 3508 } | 3563 } |
| 3509 | 3564 |
| 3510 | 3565 |
| 3511 // StringCharCodeAtGenerator | 3566 // StringCharCodeAtGenerator |
| (...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6015 __ bind(&fast_elements_case); | 6070 __ bind(&fast_elements_case); |
| 6016 GenerateCase(masm, FAST_ELEMENTS); | 6071 GenerateCase(masm, FAST_ELEMENTS); |
| 6017 } | 6072 } |
| 6018 | 6073 |
| 6019 | 6074 |
| 6020 #undef __ | 6075 #undef __ |
| 6021 | 6076 |
| 6022 } } // namespace v8::internal | 6077 } } // namespace v8::internal |
| 6023 | 6078 |
| 6024 #endif // V8_TARGET_ARCH_ARM | 6079 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |