| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 Isolate* isolate, | 355 Isolate* isolate, |
| 356 CodeStubInterfaceDescriptor* descriptor) { | 356 CodeStubInterfaceDescriptor* descriptor) { |
| 357 static Register registers[] = { a1, a0 }; | 357 static Register registers[] = { a1, a0 }; |
| 358 descriptor->register_param_count_ = 2; | 358 descriptor->register_param_count_ = 2; |
| 359 descriptor->register_params_ = registers; | 359 descriptor->register_params_ = registers; |
| 360 descriptor->deoptimization_handler_ = | 360 descriptor->deoptimization_handler_ = |
| 361 Runtime::FunctionForId(Runtime::kStringAdd)->entry; | 361 Runtime::FunctionForId(Runtime::kStringAdd)->entry; |
| 362 } | 362 } |
| 363 | 363 |
| 364 | 364 |
| 365 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 366 { |
| 367 CallInterfaceDescriptor* descriptor = |
| 368 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); |
| 369 static Register registers[] = { a1, // JSFunction |
| 370 cp, // context |
| 371 a0, // actual number of arguments |
| 372 a2, // expected number of arguments |
| 373 }; |
| 374 static Representation representations[] = { |
| 375 Representation::Tagged(), // JSFunction |
| 376 Representation::Tagged(), // context |
| 377 Representation::Integer32(), // actual number of arguments |
| 378 Representation::Integer32(), // expected number of arguments |
| 379 }; |
| 380 descriptor->register_param_count_ = 4; |
| 381 descriptor->register_params_ = registers; |
| 382 descriptor->param_representations_ = representations; |
| 383 } |
| 384 { |
| 385 CallInterfaceDescriptor* descriptor = |
| 386 isolate->call_descriptor(Isolate::KeyedCall); |
| 387 static Register registers[] = { cp, // context |
| 388 a2, // key |
| 389 }; |
| 390 static Representation representations[] = { |
| 391 Representation::Tagged(), // context |
| 392 Representation::Tagged(), // key |
| 393 }; |
| 394 descriptor->register_param_count_ = 2; |
| 395 descriptor->register_params_ = registers; |
| 396 descriptor->param_representations_ = representations; |
| 397 } |
| 398 { |
| 399 CallInterfaceDescriptor* descriptor = |
| 400 isolate->call_descriptor(Isolate::NamedCall); |
| 401 static Register registers[] = { cp, // context |
| 402 a2, // name |
| 403 }; |
| 404 static Representation representations[] = { |
| 405 Representation::Tagged(), // context |
| 406 Representation::Tagged(), // name |
| 407 }; |
| 408 descriptor->register_param_count_ = 2; |
| 409 descriptor->register_params_ = registers; |
| 410 descriptor->param_representations_ = representations; |
| 411 } |
| 412 } |
| 413 |
| 414 |
| 365 #define __ ACCESS_MASM(masm) | 415 #define __ ACCESS_MASM(masm) |
| 366 | 416 |
| 367 | 417 |
| 368 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 418 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
| 369 Label* slow, | 419 Label* slow, |
| 370 Condition cc); | 420 Condition cc); |
| 371 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 421 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
| 372 Register lhs, | 422 Register lhs, |
| 373 Register rhs, | 423 Register rhs, |
| 374 Label* rhs_not_nan, | 424 Label* rhs_not_nan, |
| (...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3355 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), | 3405 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), |
| 3356 masm->isolate()->heap()->undefined_value()); | 3406 masm->isolate()->heap()->undefined_value()); |
| 3357 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 3407 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
| 3358 __ sw(at, FieldMemOperand(a2, Cell::kValueOffset)); | 3408 __ sw(at, FieldMemOperand(a2, Cell::kValueOffset)); |
| 3359 } | 3409 } |
| 3360 // Check for function proxy. | 3410 // Check for function proxy. |
| 3361 __ Branch(&non_function, ne, a3, Operand(JS_FUNCTION_PROXY_TYPE)); | 3411 __ Branch(&non_function, ne, a3, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 3362 __ push(a1); // Put proxy as additional argument. | 3412 __ push(a1); // Put proxy as additional argument. |
| 3363 __ li(a0, Operand(argc_ + 1, RelocInfo::NONE32)); | 3413 __ li(a0, Operand(argc_ + 1, RelocInfo::NONE32)); |
| 3364 __ li(a2, Operand(0, RelocInfo::NONE32)); | 3414 __ li(a2, Operand(0, RelocInfo::NONE32)); |
| 3365 __ GetBuiltinEntry(a3, Builtins::CALL_FUNCTION_PROXY); | 3415 __ GetBuiltinFunction(a1, Builtins::CALL_FUNCTION_PROXY); |
| 3366 { | 3416 { |
| 3367 Handle<Code> adaptor = | 3417 Handle<Code> adaptor = |
| 3368 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); | 3418 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
| 3369 __ Jump(adaptor, RelocInfo::CODE_TARGET); | 3419 __ Jump(adaptor, RelocInfo::CODE_TARGET); |
| 3370 } | 3420 } |
| 3371 | 3421 |
| 3372 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead | 3422 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
| 3373 // of the original receiver from the call site). | 3423 // of the original receiver from the call site). |
| 3374 __ bind(&non_function); | 3424 __ bind(&non_function); |
| 3375 __ sw(a1, MemOperand(sp, argc_ * kPointerSize)); | 3425 __ sw(a1, MemOperand(sp, argc_ * kPointerSize)); |
| 3376 __ li(a0, Operand(argc_)); // Set up the number of arguments. | 3426 __ li(a0, Operand(argc_)); // Set up the number of arguments. |
| 3377 __ mov(a2, zero_reg); | 3427 __ mov(a2, zero_reg); |
| 3378 __ GetBuiltinEntry(a3, Builtins::CALL_NON_FUNCTION); | 3428 __ GetBuiltinFunction(a1, Builtins::CALL_NON_FUNCTION); |
| 3379 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3429 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
| 3380 RelocInfo::CODE_TARGET); | 3430 RelocInfo::CODE_TARGET); |
| 3381 } | 3431 } |
| 3382 | 3432 |
| 3383 | 3433 |
| 3384 void CallConstructStub::Generate(MacroAssembler* masm) { | 3434 void CallConstructStub::Generate(MacroAssembler* masm) { |
| 3385 // a0 : number of arguments | 3435 // a0 : number of arguments |
| 3386 // a1 : the function to call | 3436 // a1 : the function to call |
| 3387 // a2 : cache cell for call target | 3437 // a2 : cache cell for call target |
| 3388 Label slow, non_function_call; | 3438 Label slow, non_function_call; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3404 SharedFunctionInfo::kConstructStubOffset)); | 3454 SharedFunctionInfo::kConstructStubOffset)); |
| 3405 __ Addu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3455 __ Addu(at, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 3406 __ Jump(at); | 3456 __ Jump(at); |
| 3407 | 3457 |
| 3408 // a0: number of arguments | 3458 // a0: number of arguments |
| 3409 // a1: called object | 3459 // a1: called object |
| 3410 // a3: object type | 3460 // a3: object type |
| 3411 Label do_call; | 3461 Label do_call; |
| 3412 __ bind(&slow); | 3462 __ bind(&slow); |
| 3413 __ Branch(&non_function_call, ne, a3, Operand(JS_FUNCTION_PROXY_TYPE)); | 3463 __ Branch(&non_function_call, ne, a3, Operand(JS_FUNCTION_PROXY_TYPE)); |
| 3414 __ GetBuiltinEntry(a3, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); | 3464 __ GetBuiltinFunction(a1, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); |
| 3415 __ jmp(&do_call); | 3465 __ jmp(&do_call); |
| 3416 | 3466 |
| 3417 __ bind(&non_function_call); | 3467 __ bind(&non_function_call); |
| 3418 __ GetBuiltinEntry(a3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); | 3468 __ GetBuiltinFunction(a1, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
| 3419 __ bind(&do_call); | 3469 __ bind(&do_call); |
| 3420 // Set expected number of arguments to zero (not changing r0). | 3470 // Set expected number of arguments to zero (not changing r0). |
| 3421 __ li(a2, Operand(0, RelocInfo::NONE32)); | 3471 __ li(a2, Operand(0, RelocInfo::NONE32)); |
| 3422 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3472 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
| 3423 RelocInfo::CODE_TARGET); | 3473 RelocInfo::CODE_TARGET); |
| 3424 } | 3474 } |
| 3425 | 3475 |
| 3426 | 3476 |
| 3427 // StringCharCodeAtGenerator. | 3477 // StringCharCodeAtGenerator. |
| 3428 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { | 3478 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { |
| (...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5970 __ bind(&fast_elements_case); | 6020 __ bind(&fast_elements_case); |
| 5971 GenerateCase(masm, FAST_ELEMENTS); | 6021 GenerateCase(masm, FAST_ELEMENTS); |
| 5972 } | 6022 } |
| 5973 | 6023 |
| 5974 | 6024 |
| 5975 #undef __ | 6025 #undef __ |
| 5976 | 6026 |
| 5977 } } // namespace v8::internal | 6027 } } // namespace v8::internal |
| 5978 | 6028 |
| 5979 #endif // V8_TARGET_ARCH_MIPS | 6029 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |