| 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 27 matching lines...) Expand all Loading... |
| 38 namespace internal { | 38 namespace internal { |
| 39 | 39 |
| 40 | 40 |
| 41 void FastNewClosureStub::InitializeInterfaceDescriptor( | 41 void FastNewClosureStub::InitializeInterfaceDescriptor( |
| 42 Isolate* isolate, | 42 Isolate* isolate, |
| 43 CodeStubInterfaceDescriptor* descriptor) { | 43 CodeStubInterfaceDescriptor* descriptor) { |
| 44 static Register registers[] = { r2 }; | 44 static Register registers[] = { r2 }; |
| 45 descriptor->register_param_count_ = 1; | 45 descriptor->register_param_count_ = 1; |
| 46 descriptor->register_params_ = registers; | 46 descriptor->register_params_ = registers; |
| 47 descriptor->deoptimization_handler_ = | 47 descriptor->deoptimization_handler_ = |
| 48 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry; | 48 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; |
| 49 } | 49 } |
| 50 | 50 |
| 51 | 51 |
| 52 void FastNewContextStub::InitializeInterfaceDescriptor( | 52 void FastNewContextStub::InitializeInterfaceDescriptor( |
| 53 Isolate* isolate, | 53 Isolate* isolate, |
| 54 CodeStubInterfaceDescriptor* descriptor) { | 54 CodeStubInterfaceDescriptor* descriptor) { |
| 55 static Register registers[] = { r1 }; | 55 static Register registers[] = { r1 }; |
| 56 descriptor->register_param_count_ = 1; | 56 descriptor->register_param_count_ = 1; |
| 57 descriptor->register_params_ = registers; | 57 descriptor->register_params_ = registers; |
| 58 descriptor->deoptimization_handler_ = NULL; | 58 descriptor->deoptimization_handler_ = NULL; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| 83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 83 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 84 Isolate* isolate, | 84 Isolate* isolate, |
| 85 CodeStubInterfaceDescriptor* descriptor) { | 85 CodeStubInterfaceDescriptor* descriptor) { |
| 86 static Register registers[] = { r3, r2, r1 }; | 86 static Register registers[] = { r3, r2, r1 }; |
| 87 descriptor->register_param_count_ = 3; | 87 descriptor->register_param_count_ = 3; |
| 88 descriptor->register_params_ = registers; | 88 descriptor->register_params_ = registers; |
| 89 descriptor->deoptimization_handler_ = | 89 descriptor->deoptimization_handler_ = |
| 90 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry; | 90 Runtime::FunctionForId( |
| 91 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; |
| 91 } | 92 } |
| 92 | 93 |
| 93 | 94 |
| 94 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 95 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 95 Isolate* isolate, | 96 Isolate* isolate, |
| 96 CodeStubInterfaceDescriptor* descriptor) { | 97 CodeStubInterfaceDescriptor* descriptor) { |
| 97 static Register registers[] = { r3, r2, r1, r0 }; | 98 static Register registers[] = { r3, r2, r1, r0 }; |
| 98 descriptor->register_param_count_ = 4; | 99 descriptor->register_param_count_ = 4; |
| 99 descriptor->register_params_ = registers; | 100 descriptor->register_params_ = registers; |
| 100 descriptor->deoptimization_handler_ = | 101 descriptor->deoptimization_handler_ = |
| 101 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; | 102 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; |
| 102 } | 103 } |
| 103 | 104 |
| 104 | 105 |
| 105 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 106 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
| 106 Isolate* isolate, | 107 Isolate* isolate, |
| 107 CodeStubInterfaceDescriptor* descriptor) { | 108 CodeStubInterfaceDescriptor* descriptor) { |
| 108 static Register registers[] = { r2, r3 }; | 109 static Register registers[] = { r2, r3 }; |
| 109 descriptor->register_param_count_ = 2; | 110 descriptor->register_param_count_ = 2; |
| 110 descriptor->register_params_ = registers; | 111 descriptor->register_params_ = registers; |
| 111 descriptor->deoptimization_handler_ = NULL; | 112 descriptor->deoptimization_handler_ = NULL; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // stack param count needs (constructor pointer, and single argument) | 240 // stack param count needs (constructor pointer, and single argument) |
| 240 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 241 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 241 descriptor->stack_parameter_count_ = r0; | 242 descriptor->stack_parameter_count_ = r0; |
| 242 descriptor->register_param_count_ = 3; | 243 descriptor->register_param_count_ = 3; |
| 243 descriptor->register_params_ = registers_variable_args; | 244 descriptor->register_params_ = registers_variable_args; |
| 244 } | 245 } |
| 245 | 246 |
| 246 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 247 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 247 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 248 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 248 descriptor->deoptimization_handler_ = | 249 descriptor->deoptimization_handler_ = |
| 249 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; | 250 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; |
| 250 } | 251 } |
| 251 | 252 |
| 252 | 253 |
| 253 static void InitializeInternalArrayConstructorDescriptor( | 254 static void InitializeInternalArrayConstructorDescriptor( |
| 254 Isolate* isolate, | 255 Isolate* isolate, |
| 255 CodeStubInterfaceDescriptor* descriptor, | 256 CodeStubInterfaceDescriptor* descriptor, |
| 256 int constant_stack_parameter_count) { | 257 int constant_stack_parameter_count) { |
| 257 // register state | 258 // register state |
| 258 // r0 -- number of arguments | 259 // r0 -- number of arguments |
| 259 // r1 -- constructor function | 260 // r1 -- constructor function |
| 260 static Register registers_variable_args[] = { r1, r0 }; | 261 static Register registers_variable_args[] = { r1, r0 }; |
| 261 static Register registers_no_args[] = { r1 }; | 262 static Register registers_no_args[] = { r1 }; |
| 262 | 263 |
| 263 if (constant_stack_parameter_count == 0) { | 264 if (constant_stack_parameter_count == 0) { |
| 264 descriptor->register_param_count_ = 1; | 265 descriptor->register_param_count_ = 1; |
| 265 descriptor->register_params_ = registers_no_args; | 266 descriptor->register_params_ = registers_no_args; |
| 266 } else { | 267 } else { |
| 267 // stack param count needs (constructor pointer, and single argument) | 268 // stack param count needs (constructor pointer, and single argument) |
| 268 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 269 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
| 269 descriptor->stack_parameter_count_ = r0; | 270 descriptor->stack_parameter_count_ = r0; |
| 270 descriptor->register_param_count_ = 2; | 271 descriptor->register_param_count_ = 2; |
| 271 descriptor->register_params_ = registers_variable_args; | 272 descriptor->register_params_ = registers_variable_args; |
| 272 } | 273 } |
| 273 | 274 |
| 274 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 275 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
| 275 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 276 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
| 276 descriptor->deoptimization_handler_ = | 277 descriptor->deoptimization_handler_ = |
| 277 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; | 278 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; |
| 278 } | 279 } |
| 279 | 280 |
| 280 | 281 |
| 281 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 282 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
| 282 Isolate* isolate, | 283 Isolate* isolate, |
| 283 CodeStubInterfaceDescriptor* descriptor) { | 284 CodeStubInterfaceDescriptor* descriptor) { |
| 284 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 285 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); |
| 285 } | 286 } |
| 286 | 287 |
| 287 | 288 |
| (...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2141 __ b(ne, &runtime); | 2142 __ b(ne, &runtime); |
| 2142 | 2143 |
| 2143 // Patch the arguments.length and the parameters pointer in the current frame. | 2144 // Patch the arguments.length and the parameters pointer in the current frame. |
| 2144 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2145 __ ldr(r2, MemOperand(r3, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 2145 __ str(r2, MemOperand(sp, 0 * kPointerSize)); | 2146 __ str(r2, MemOperand(sp, 0 * kPointerSize)); |
| 2146 __ add(r3, r3, Operand(r2, LSL, 1)); | 2147 __ add(r3, r3, Operand(r2, LSL, 1)); |
| 2147 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); | 2148 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); |
| 2148 __ str(r3, MemOperand(sp, 1 * kPointerSize)); | 2149 __ str(r3, MemOperand(sp, 1 * kPointerSize)); |
| 2149 | 2150 |
| 2150 __ bind(&runtime); | 2151 __ bind(&runtime); |
| 2151 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 2152 __ TailCallRuntime(Runtime::kHiddenNewArgumentsFast, 3, 1); |
| 2152 } | 2153 } |
| 2153 | 2154 |
| 2154 | 2155 |
| 2155 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 2156 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
| 2156 // Stack layout: | 2157 // Stack layout: |
| 2157 // sp[0] : number of parameters (tagged) | 2158 // sp[0] : number of parameters (tagged) |
| 2158 // sp[4] : address of receiver argument | 2159 // sp[4] : address of receiver argument |
| 2159 // sp[8] : function | 2160 // sp[8] : function |
| 2160 // Registers used over whole function: | 2161 // Registers used over whole function: |
| 2161 // r6 : allocated object (tagged) | 2162 // r6 : allocated object (tagged) |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2345 | 2346 |
| 2346 // Return and remove the on-stack parameters. | 2347 // Return and remove the on-stack parameters. |
| 2347 __ add(sp, sp, Operand(3 * kPointerSize)); | 2348 __ add(sp, sp, Operand(3 * kPointerSize)); |
| 2348 __ Ret(); | 2349 __ Ret(); |
| 2349 | 2350 |
| 2350 // Do the runtime call to allocate the arguments object. | 2351 // Do the runtime call to allocate the arguments object. |
| 2351 // r0 = address of new object (tagged) | 2352 // r0 = address of new object (tagged) |
| 2352 // r2 = argument count (tagged) | 2353 // r2 = argument count (tagged) |
| 2353 __ bind(&runtime); | 2354 __ bind(&runtime); |
| 2354 __ str(r2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count. | 2355 __ str(r2, MemOperand(sp, 0 * kPointerSize)); // Patch argument count. |
| 2355 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 2356 __ TailCallRuntime(Runtime::kHiddenNewArgumentsFast, 3, 1); |
| 2356 } | 2357 } |
| 2357 | 2358 |
| 2358 | 2359 |
| 2359 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { | 2360 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { |
| 2360 // sp[0] : number of parameters | 2361 // sp[0] : number of parameters |
| 2361 // sp[4] : receiver displacement | 2362 // sp[4] : receiver displacement |
| 2362 // sp[8] : function | 2363 // sp[8] : function |
| 2363 // Check if the calling frame is an arguments adaptor frame. | 2364 // Check if the calling frame is an arguments adaptor frame. |
| 2364 Label adaptor_frame, try_allocate, runtime; | 2365 Label adaptor_frame, try_allocate, runtime; |
| 2365 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2366 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2439 __ cmp(r1, Operand::Zero()); | 2440 __ cmp(r1, Operand::Zero()); |
| 2440 __ b(ne, &loop); | 2441 __ b(ne, &loop); |
| 2441 | 2442 |
| 2442 // Return and remove the on-stack parameters. | 2443 // Return and remove the on-stack parameters. |
| 2443 __ bind(&done); | 2444 __ bind(&done); |
| 2444 __ add(sp, sp, Operand(3 * kPointerSize)); | 2445 __ add(sp, sp, Operand(3 * kPointerSize)); |
| 2445 __ Ret(); | 2446 __ Ret(); |
| 2446 | 2447 |
| 2447 // Do the runtime call to allocate the arguments object. | 2448 // Do the runtime call to allocate the arguments object. |
| 2448 __ bind(&runtime); | 2449 __ bind(&runtime); |
| 2449 __ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1); | 2450 __ TailCallRuntime(Runtime::kHiddenNewStrictArgumentsFast, 3, 1); |
| 2450 } | 2451 } |
| 2451 | 2452 |
| 2452 | 2453 |
| 2453 void RegExpExecStub::Generate(MacroAssembler* masm) { | 2454 void RegExpExecStub::Generate(MacroAssembler* masm) { |
| 2454 // Just jump directly to runtime if native RegExp is not selected at compile | 2455 // Just jump directly to runtime if native RegExp is not selected at compile |
| 2455 // time or if regexp entry in generated code is turned off runtime switch or | 2456 // time or if regexp entry in generated code is turned off runtime switch or |
| 2456 // at compilation. | 2457 // at compilation. |
| 2457 #ifdef V8_INTERPRETED_REGEXP | 2458 #ifdef V8_INTERPRETED_REGEXP |
| 2458 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); | 2459 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); |
| 2459 #else // V8_INTERPRETED_REGEXP | 2460 #else // V8_INTERPRETED_REGEXP |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3196 index_not_number_, | 3197 index_not_number_, |
| 3197 DONT_DO_SMI_CHECK); | 3198 DONT_DO_SMI_CHECK); |
| 3198 call_helper.BeforeCall(masm); | 3199 call_helper.BeforeCall(masm); |
| 3199 __ push(object_); | 3200 __ push(object_); |
| 3200 __ push(index_); // Consumed by runtime conversion function. | 3201 __ push(index_); // Consumed by runtime conversion function. |
| 3201 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 3202 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
| 3202 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 3203 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
| 3203 } else { | 3204 } else { |
| 3204 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 3205 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
| 3205 // NumberToSmi discards numbers that are not exact integers. | 3206 // NumberToSmi discards numbers that are not exact integers. |
| 3206 __ CallRuntime(Runtime::kNumberToSmi, 1); | 3207 __ CallRuntime(Runtime::kHiddenNumberToSmi, 1); |
| 3207 } | 3208 } |
| 3208 // Save the conversion result before the pop instructions below | 3209 // Save the conversion result before the pop instructions below |
| 3209 // have a chance to overwrite it. | 3210 // have a chance to overwrite it. |
| 3210 __ Move(index_, r0); | 3211 __ Move(index_, r0); |
| 3211 __ pop(object_); | 3212 __ pop(object_); |
| 3212 // Reload the instance type. | 3213 // Reload the instance type. |
| 3213 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); | 3214 __ ldr(result_, FieldMemOperand(object_, HeapObject::kMapOffset)); |
| 3214 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); | 3215 __ ldrb(result_, FieldMemOperand(result_, Map::kInstanceTypeOffset)); |
| 3215 call_helper.AfterCall(masm); | 3216 call_helper.AfterCall(masm); |
| 3216 // If index is still not a smi, it must be out of range. | 3217 // If index is still not a smi, it must be out of range. |
| (...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5452 MemOperand(fp, 6 * kPointerSize), | 5453 MemOperand(fp, 6 * kPointerSize), |
| 5453 NULL); | 5454 NULL); |
| 5454 } | 5455 } |
| 5455 | 5456 |
| 5456 | 5457 |
| 5457 #undef __ | 5458 #undef __ |
| 5458 | 5459 |
| 5459 } } // namespace v8::internal | 5460 } } // namespace v8::internal |
| 5460 | 5461 |
| 5461 #endif // V8_TARGET_ARCH_ARM | 5462 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |