| 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 28 matching lines...) Expand all Loading... |
| 39 namespace internal { | 39 namespace internal { |
| 40 | 40 |
| 41 | 41 |
| 42 void FastNewClosureStub::InitializeInterfaceDescriptor( | 42 void FastNewClosureStub::InitializeInterfaceDescriptor( |
| 43 Isolate* isolate, | 43 Isolate* isolate, |
| 44 CodeStubInterfaceDescriptor* descriptor) { | 44 CodeStubInterfaceDescriptor* descriptor) { |
| 45 static Register registers[] = { a2 }; | 45 static Register registers[] = { a2 }; |
| 46 descriptor->register_param_count_ = 1; | 46 descriptor->register_param_count_ = 1; |
| 47 descriptor->register_params_ = registers; | 47 descriptor->register_params_ = registers; |
| 48 descriptor->deoptimization_handler_ = | 48 descriptor->deoptimization_handler_ = |
| 49 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry; | 49 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; |
| 50 } | 50 } |
| 51 | 51 |
| 52 | 52 |
| 53 void FastNewContextStub::InitializeInterfaceDescriptor( | 53 void FastNewContextStub::InitializeInterfaceDescriptor( |
| 54 Isolate* isolate, | 54 Isolate* isolate, |
| 55 CodeStubInterfaceDescriptor* descriptor) { | 55 CodeStubInterfaceDescriptor* descriptor) { |
| 56 static Register registers[] = { a1 }; | 56 static Register registers[] = { a1 }; |
| 57 descriptor->register_param_count_ = 1; | 57 descriptor->register_param_count_ = 1; |
| 58 descriptor->register_params_ = registers; | 58 descriptor->register_params_ = registers; |
| 59 descriptor->deoptimization_handler_ = NULL; | 59 descriptor->deoptimization_handler_ = NULL; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 84 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 85 Isolate* isolate, | 85 Isolate* isolate, |
| 86 CodeStubInterfaceDescriptor* descriptor) { | 86 CodeStubInterfaceDescriptor* descriptor) { |
| 87 static Register registers[] = { a3, a2, a1 }; | 87 static Register registers[] = { a3, a2, a1 }; |
| 88 descriptor->register_param_count_ = 3; | 88 descriptor->register_param_count_ = 3; |
| 89 descriptor->register_params_ = registers; | 89 descriptor->register_params_ = registers; |
| 90 descriptor->deoptimization_handler_ = | 90 descriptor->deoptimization_handler_ = |
| 91 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry; | 91 Runtime::FunctionForId( |
| 92 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; |
| 92 } | 93 } |
| 93 | 94 |
| 94 | 95 |
| 95 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 96 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 96 Isolate* isolate, | 97 Isolate* isolate, |
| 97 CodeStubInterfaceDescriptor* descriptor) { | 98 CodeStubInterfaceDescriptor* descriptor) { |
| 98 static Register registers[] = { a3, a2, a1, a0 }; | 99 static Register registers[] = { a3, a2, a1, a0 }; |
| 99 descriptor->register_param_count_ = 4; | 100 descriptor->register_param_count_ = 4; |
| 100 descriptor->register_params_ = registers; | 101 descriptor->register_params_ = registers; |
| 101 descriptor->deoptimization_handler_ = | 102 descriptor->deoptimization_handler_ = |
| 102 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; | 103 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; |
| 103 } | 104 } |
| 104 | 105 |
| 105 | 106 |
| 106 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 107 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
| 107 Isolate* isolate, | 108 Isolate* isolate, |
| 108 CodeStubInterfaceDescriptor* descriptor) { | 109 CodeStubInterfaceDescriptor* descriptor) { |
| 109 static Register registers[] = { a2, a3 }; | 110 static Register registers[] = { a2, a3 }; |
| 110 descriptor->register_param_count_ = 2; | 111 descriptor->register_param_count_ = 2; |
| 111 descriptor->register_params_ = registers; | 112 descriptor->register_params_ = registers; |
| 112 descriptor->deoptimization_handler_ = NULL; | 113 descriptor->deoptimization_handler_ = NULL; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 // stack param count needs (constructor pointer, and single argument) | 241 // stack param count needs (constructor pointer, and single argument) |
| 241 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 242 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 242 descriptor->stack_parameter_count_ = a0; | 243 descriptor->stack_parameter_count_ = a0; |
| 243 descriptor->register_param_count_ = 3; | 244 descriptor->register_param_count_ = 3; |
| 244 descriptor->register_params_ = registers_variable_args; | 245 descriptor->register_params_ = registers_variable_args; |
| 245 } | 246 } |
| 246 | 247 |
| 247 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 248 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 248 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 249 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 249 descriptor->deoptimization_handler_ = | 250 descriptor->deoptimization_handler_ = |
| 250 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; | 251 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; |
| 251 } | 252 } |
| 252 | 253 |
| 253 | 254 |
| 254 static void InitializeInternalArrayConstructorDescriptor( | 255 static void InitializeInternalArrayConstructorDescriptor( |
| 255 Isolate* isolate, | 256 Isolate* isolate, |
| 256 CodeStubInterfaceDescriptor* descriptor, | 257 CodeStubInterfaceDescriptor* descriptor, |
| 257 int constant_stack_parameter_count) { | 258 int constant_stack_parameter_count) { |
| 258 // register state | 259 // register state |
| 259 // a0 -- number of arguments | 260 // a0 -- number of arguments |
| 260 // a1 -- constructor function | 261 // a1 -- constructor function |
| 261 static Register registers_variable_args[] = { a1, a0 }; | 262 static Register registers_variable_args[] = { a1, a0 }; |
| 262 static Register registers_no_args[] = { a1 }; | 263 static Register registers_no_args[] = { a1 }; |
| 263 | 264 |
| 264 if (constant_stack_parameter_count == 0) { | 265 if (constant_stack_parameter_count == 0) { |
| 265 descriptor->register_param_count_ = 1; | 266 descriptor->register_param_count_ = 1; |
| 266 descriptor->register_params_ = registers_no_args; | 267 descriptor->register_params_ = registers_no_args; |
| 267 } else { | 268 } else { |
| 268 // stack param count needs (constructor pointer, and single argument) | 269 // stack param count needs (constructor pointer, and single argument) |
| 269 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 270 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 270 descriptor->stack_parameter_count_ = a0; | 271 descriptor->stack_parameter_count_ = a0; |
| 271 descriptor->register_param_count_ = 2; | 272 descriptor->register_param_count_ = 2; |
| 272 descriptor->register_params_ = registers_variable_args; | 273 descriptor->register_params_ = registers_variable_args; |
| 273 } | 274 } |
| 274 | 275 |
| 275 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 276 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 276 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 277 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 277 descriptor->deoptimization_handler_ = | 278 descriptor->deoptimization_handler_ = |
| 278 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; | 279 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; |
| 279 } | 280 } |
| 280 | 281 |
| 281 | 282 |
| 282 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 283 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 283 Isolate* isolate, | 284 Isolate* isolate, |
| 284 CodeStubInterfaceDescriptor* descriptor) { | 285 CodeStubInterfaceDescriptor* descriptor) { |
| 285 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 286 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); |
| 286 } | 287 } |
| 287 | 288 |
| 288 | 289 |
| (...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2256 | 2257 |
| 2257 // Patch the arguments.length and the parameters pointer in the current frame. | 2258 // Patch the arguments.length and the parameters pointer in the current frame. |
| 2258 __ lw(a2, MemOperand(a3, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2259 __ lw(a2, MemOperand(a3, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 2259 __ sw(a2, MemOperand(sp, 0 * kPointerSize)); | 2260 __ sw(a2, MemOperand(sp, 0 * kPointerSize)); |
| 2260 __ sll(t3, a2, 1); | 2261 __ sll(t3, a2, 1); |
| 2261 __ Addu(a3, a3, Operand(t3)); | 2262 __ Addu(a3, a3, Operand(t3)); |
| 2262 __ addiu(a3, a3, StandardFrameConstants::kCallerSPOffset); | 2263 __ addiu(a3, a3, StandardFrameConstants::kCallerSPOffset); |
| 2263 __ sw(a3, MemOperand(sp, 1 * kPointerSize)); | 2264 __ sw(a3, MemOperand(sp, 1 * kPointerSize)); |
| 2264 | 2265 |
| 2265 __ bind(&runtime); | 2266 __ bind(&runtime); |
| 2266 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 2267 __ TailCallRuntime(Runtime::kHiddenNewArgumentsFast, 3, 1); |
| 2267 } | 2268 } |
| 2268 | 2269 |
| 2269 | 2270 |
| 2270 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 2271 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
| 2271 // Stack layout: | 2272 // Stack layout: |
| 2272 // sp[0] : number of parameters (tagged) | 2273 // sp[0] : number of parameters (tagged) |
| 2273 // sp[4] : address of receiver argument | 2274 // sp[4] : address of receiver argument |
| 2274 // sp[8] : function | 2275 // sp[8] : function |
| 2275 // Registers used over whole function: | 2276 // Registers used over whole function: |
| 2276 // t2 : allocated object (tagged) | 2277 // t2 : allocated object (tagged) |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2475 __ bind(&arguments_test); | 2476 __ bind(&arguments_test); |
| 2476 __ Branch(&arguments_loop, lt, t5, Operand(a2)); | 2477 __ Branch(&arguments_loop, lt, t5, Operand(a2)); |
| 2477 | 2478 |
| 2478 // Return and remove the on-stack parameters. | 2479 // Return and remove the on-stack parameters. |
| 2479 __ DropAndRet(3); | 2480 __ DropAndRet(3); |
| 2480 | 2481 |
| 2481 // Do the runtime call to allocate the arguments object. | 2482 // Do the runtime call to allocate the arguments object. |
| 2482 // a2 = argument count (tagged) | 2483 // a2 = argument count (tagged) |
| 2483 __ bind(&runtime); | 2484 __ bind(&runtime); |
| 2484 __ sw(a2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count. | 2485 __ sw(a2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count. |
| 2485 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 2486 __ TailCallRuntime(Runtime::kHiddenNewArgumentsFast, 3, 1); |
| 2486 } | 2487 } |
| 2487 | 2488 |
| 2488 | 2489 |
| 2489 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { | 2490 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { |
| 2490 // sp[0] : number of parameters | 2491 // sp[0] : number of parameters |
| 2491 // sp[4] : receiver displacement | 2492 // sp[4] : receiver displacement |
| 2492 // sp[8] : function | 2493 // sp[8] : function |
| 2493 // Check if the calling frame is an arguments adaptor frame. | 2494 // Check if the calling frame is an arguments adaptor frame. |
| 2494 Label adaptor_frame, try_allocate, runtime; | 2495 Label adaptor_frame, try_allocate, runtime; |
| 2495 __ lw(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2496 __ lw(a2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2573 __ Addu(t0, t0, Operand(kPointerSize)); | 2574 __ Addu(t0, t0, Operand(kPointerSize)); |
| 2574 __ Subu(a1, a1, Operand(1)); | 2575 __ Subu(a1, a1, Operand(1)); |
| 2575 __ Branch(&loop, ne, a1, Operand(zero_reg)); | 2576 __ Branch(&loop, ne, a1, Operand(zero_reg)); |
| 2576 | 2577 |
| 2577 // Return and remove the on-stack parameters. | 2578 // Return and remove the on-stack parameters. |
| 2578 __ bind(&done); | 2579 __ bind(&done); |
| 2579 __ DropAndRet(3); | 2580 __ DropAndRet(3); |
| 2580 | 2581 |
| 2581 // Do the runtime call to allocate the arguments object. | 2582 // Do the runtime call to allocate the arguments object. |
| 2582 __ bind(&runtime); | 2583 __ bind(&runtime); |
| 2583 __ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1); | 2584 __ TailCallRuntime(Runtime::kHiddenNewStrictArgumentsFast, 3, 1); |
| 2584 } | 2585 } |
| 2585 | 2586 |
| 2586 | 2587 |
| 2587 void RegExpExecStub::Generate(MacroAssembler* masm) { | 2588 void RegExpExecStub::Generate(MacroAssembler* masm) { |
| 2588 // Just jump directly to runtime if native RegExp is not selected at compile | 2589 // Just jump directly to runtime if native RegExp is not selected at compile |
| 2589 // time or if regexp entry in generated code is turned off runtime switch or | 2590 // time or if regexp entry in generated code is turned off runtime switch or |
| 2590 // at compilation. | 2591 // at compilation. |
| 2591 #ifdef V8_INTERPRETED_REGEXP | 2592 #ifdef V8_INTERPRETED_REGEXP |
| 2592 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); | 2593 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); |
| 2593 #else // V8_INTERPRETED_REGEXP | 2594 #else // V8_INTERPRETED_REGEXP |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3357 index_not_number_, | 3358 index_not_number_, |
| 3358 DONT_DO_SMI_CHECK); | 3359 DONT_DO_SMI_CHECK); |
| 3359 call_helper.BeforeCall(masm); | 3360 call_helper.BeforeCall(masm); |
| 3360 // Consumed by runtime conversion function: | 3361 // Consumed by runtime conversion function: |
| 3361 __ Push(object_, index_); | 3362 __ Push(object_, index_); |
| 3362 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 3363 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
| 3363 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 3364 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
| 3364 } else { | 3365 } else { |
| 3365 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 3366 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
| 3366 // NumberToSmi discards numbers that are not exact integers. | 3367 // NumberToSmi discards numbers that are not exact integers. |
| 3367 __ CallRuntime(Runtime::kNumberToSmi, 1); | 3368 __ CallRuntime(Runtime::kHiddenNumberToSmi, 1); |
| 3368 } | 3369 } |
| 3369 | 3370 |
| 3370 // Save the conversion result before the pop instructions below | 3371 // Save the conversion result before the pop instructions below |
| 3371 // have a chance to overwrite it. | 3372 // have a chance to overwrite it. |
| 3372 | 3373 |
| 3373 __ Move(index_, v0); | 3374 __ Move(index_, v0); |
| 3374 __ pop(object_); | 3375 __ pop(object_); |
| 3375 // Reload the instance type. | 3376 // Reload the instance type. |
| 3376 __ lw(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 3377 __ lw(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
| 3377 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 3378 __ lbu(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
| (...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5637 MemOperand(fp, 6 * kPointerSize), | 5638 MemOperand(fp, 6 * kPointerSize), |
| 5638 NULL); | 5639 NULL); |
| 5639 } | 5640 } |
| 5640 | 5641 |
| 5641 | 5642 |
| 5642 #undef __ | 5643 #undef __ |
| 5643 | 5644 |
| 5644 } } // namespace v8::internal | 5645 } } // namespace v8::internal |
| 5645 | 5646 |
| 5646 #endif // V8_TARGET_ARCH_MIPS | 5647 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |