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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 namespace internal { | 43 namespace internal { |
44 | 44 |
45 | 45 |
46 void FastNewClosureStub::InitializeInterfaceDescriptor( | 46 void FastNewClosureStub::InitializeInterfaceDescriptor( |
47 Isolate* isolate, | 47 Isolate* isolate, |
48 CodeStubInterfaceDescriptor* descriptor) { | 48 CodeStubInterfaceDescriptor* descriptor) { |
49 static Register registers[] = { ebx }; | 49 static Register registers[] = { ebx }; |
50 descriptor->register_param_count_ = 1; | 50 descriptor->register_param_count_ = 1; |
51 descriptor->register_params_ = registers; | 51 descriptor->register_params_ = registers; |
52 descriptor->deoptimization_handler_ = | 52 descriptor->deoptimization_handler_ = |
53 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry; | 53 Runtime::FunctionForId(Runtime::kHiddenNewClosureFromStubFailure)->entry; |
54 } | 54 } |
55 | 55 |
56 | 56 |
57 void FastNewContextStub::InitializeInterfaceDescriptor( | 57 void FastNewContextStub::InitializeInterfaceDescriptor( |
58 Isolate* isolate, | 58 Isolate* isolate, |
59 CodeStubInterfaceDescriptor* descriptor) { | 59 CodeStubInterfaceDescriptor* descriptor) { |
60 static Register registers[] = { edi }; | 60 static Register registers[] = { edi }; |
61 descriptor->register_param_count_ = 1; | 61 descriptor->register_param_count_ = 1; |
62 descriptor->register_params_ = registers; | 62 descriptor->register_params_ = registers; |
63 descriptor->deoptimization_handler_ = NULL; | 63 descriptor->deoptimization_handler_ = NULL; |
(...skipping 21 matching lines...) Expand all Loading... |
85 } | 85 } |
86 | 86 |
87 | 87 |
88 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 88 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
89 Isolate* isolate, | 89 Isolate* isolate, |
90 CodeStubInterfaceDescriptor* descriptor) { | 90 CodeStubInterfaceDescriptor* descriptor) { |
91 static Register registers[] = { eax, ebx, ecx }; | 91 static Register registers[] = { eax, ebx, ecx }; |
92 descriptor->register_param_count_ = 3; | 92 descriptor->register_param_count_ = 3; |
93 descriptor->register_params_ = registers; | 93 descriptor->register_params_ = registers; |
94 descriptor->deoptimization_handler_ = | 94 descriptor->deoptimization_handler_ = |
95 Runtime::FunctionForId(Runtime::kCreateArrayLiteralStubBailout)->entry; | 95 Runtime::FunctionForId( |
| 96 Runtime::kHiddenCreateArrayLiteralStubBailout)->entry; |
96 } | 97 } |
97 | 98 |
98 | 99 |
99 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 100 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
100 Isolate* isolate, | 101 Isolate* isolate, |
101 CodeStubInterfaceDescriptor* descriptor) { | 102 CodeStubInterfaceDescriptor* descriptor) { |
102 static Register registers[] = { eax, ebx, ecx, edx }; | 103 static Register registers[] = { eax, ebx, ecx, edx }; |
103 descriptor->register_param_count_ = 4; | 104 descriptor->register_param_count_ = 4; |
104 descriptor->register_params_ = registers; | 105 descriptor->register_params_ = registers; |
105 descriptor->deoptimization_handler_ = | 106 descriptor->deoptimization_handler_ = |
106 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; | 107 Runtime::FunctionForId(Runtime::kHiddenCreateObjectLiteral)->entry; |
107 } | 108 } |
108 | 109 |
109 | 110 |
110 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 111 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
111 Isolate* isolate, | 112 Isolate* isolate, |
112 CodeStubInterfaceDescriptor* descriptor) { | 113 CodeStubInterfaceDescriptor* descriptor) { |
113 static Register registers[] = { ebx, edx }; | 114 static Register registers[] = { ebx, edx }; |
114 descriptor->register_param_count_ = 2; | 115 descriptor->register_param_count_ = 2; |
115 descriptor->register_params_ = registers; | 116 descriptor->register_params_ = registers; |
116 descriptor->deoptimization_handler_ = NULL; | 117 descriptor->deoptimization_handler_ = NULL; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // stack param count needs (constructor pointer, and single argument) | 231 // stack param count needs (constructor pointer, and single argument) |
231 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 232 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
232 descriptor->stack_parameter_count_ = eax; | 233 descriptor->stack_parameter_count_ = eax; |
233 descriptor->register_param_count_ = 3; | 234 descriptor->register_param_count_ = 3; |
234 descriptor->register_params_ = registers_variable_args; | 235 descriptor->register_params_ = registers_variable_args; |
235 } | 236 } |
236 | 237 |
237 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 238 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
238 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 239 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
239 descriptor->deoptimization_handler_ = | 240 descriptor->deoptimization_handler_ = |
240 Runtime::FunctionForId(Runtime::kArrayConstructor)->entry; | 241 Runtime::FunctionForId(Runtime::kHiddenArrayConstructor)->entry; |
241 } | 242 } |
242 | 243 |
243 | 244 |
244 static void InitializeInternalArrayConstructorDescriptor( | 245 static void InitializeInternalArrayConstructorDescriptor( |
245 Isolate* isolate, | 246 Isolate* isolate, |
246 CodeStubInterfaceDescriptor* descriptor, | 247 CodeStubInterfaceDescriptor* descriptor, |
247 int constant_stack_parameter_count) { | 248 int constant_stack_parameter_count) { |
248 // register state | 249 // register state |
249 // eax -- number of arguments | 250 // eax -- number of arguments |
250 // edi -- constructor function | 251 // edi -- constructor function |
251 static Register registers_variable_args[] = { edi, eax }; | 252 static Register registers_variable_args[] = { edi, eax }; |
252 static Register registers_no_args[] = { edi }; | 253 static Register registers_no_args[] = { edi }; |
253 | 254 |
254 if (constant_stack_parameter_count == 0) { | 255 if (constant_stack_parameter_count == 0) { |
255 descriptor->register_param_count_ = 1; | 256 descriptor->register_param_count_ = 1; |
256 descriptor->register_params_ = registers_no_args; | 257 descriptor->register_params_ = registers_no_args; |
257 } else { | 258 } else { |
258 // stack param count needs (constructor pointer, and single argument) | 259 // stack param count needs (constructor pointer, and single argument) |
259 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; | 260 descriptor->handler_arguments_mode_ = PASS_ARGUMENTS; |
260 descriptor->stack_parameter_count_ = eax; | 261 descriptor->stack_parameter_count_ = eax; |
261 descriptor->register_param_count_ = 2; | 262 descriptor->register_param_count_ = 2; |
262 descriptor->register_params_ = registers_variable_args; | 263 descriptor->register_params_ = registers_variable_args; |
263 } | 264 } |
264 | 265 |
265 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; | 266 descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count; |
266 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; | 267 descriptor->function_mode_ = JS_FUNCTION_STUB_MODE; |
267 descriptor->deoptimization_handler_ = | 268 descriptor->deoptimization_handler_ = |
268 Runtime::FunctionForId(Runtime::kInternalArrayConstructor)->entry; | 269 Runtime::FunctionForId(Runtime::kHiddenInternalArrayConstructor)->entry; |
269 } | 270 } |
270 | 271 |
271 | 272 |
272 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( | 273 void ArrayNoArgumentConstructorStub::InitializeInterfaceDescriptor( |
273 Isolate* isolate, | 274 Isolate* isolate, |
274 CodeStubInterfaceDescriptor* descriptor) { | 275 CodeStubInterfaceDescriptor* descriptor) { |
275 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); | 276 InitializeArrayConstructorDescriptor(isolate, descriptor, 0); |
276 } | 277 } |
277 | 278 |
278 | 279 |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 __ j(not_equal, &runtime, Label::kNear); | 1140 __ j(not_equal, &runtime, Label::kNear); |
1140 | 1141 |
1141 // Patch the arguments.length and the parameters pointer. | 1142 // Patch the arguments.length and the parameters pointer. |
1142 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1143 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
1143 __ mov(Operand(esp, 1 * kPointerSize), ecx); | 1144 __ mov(Operand(esp, 1 * kPointerSize), ecx); |
1144 __ lea(edx, Operand(edx, ecx, times_2, | 1145 __ lea(edx, Operand(edx, ecx, times_2, |
1145 StandardFrameConstants::kCallerSPOffset)); | 1146 StandardFrameConstants::kCallerSPOffset)); |
1146 __ mov(Operand(esp, 2 * kPointerSize), edx); | 1147 __ mov(Operand(esp, 2 * kPointerSize), edx); |
1147 | 1148 |
1148 __ bind(&runtime); | 1149 __ bind(&runtime); |
1149 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 1150 __ TailCallRuntime(Runtime::kHiddenNewArgumentsFast, 3, 1); |
1150 } | 1151 } |
1151 | 1152 |
1152 | 1153 |
1153 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { | 1154 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
1154 Isolate* isolate = masm->isolate(); | 1155 Isolate* isolate = masm->isolate(); |
1155 | 1156 |
1156 // esp[0] : return address | 1157 // esp[0] : return address |
1157 // esp[4] : number of parameters (tagged) | 1158 // esp[4] : number of parameters (tagged) |
1158 // esp[8] : receiver displacement | 1159 // esp[8] : receiver displacement |
1159 // esp[12] : function | 1160 // esp[12] : function |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 __ pop(eax); // Address of arguments object. | 1365 __ pop(eax); // Address of arguments object. |
1365 __ pop(ebx); // Parameter count. | 1366 __ pop(ebx); // Parameter count. |
1366 | 1367 |
1367 // Return and remove the on-stack parameters. | 1368 // Return and remove the on-stack parameters. |
1368 __ ret(3 * kPointerSize); | 1369 __ ret(3 * kPointerSize); |
1369 | 1370 |
1370 // Do the runtime call to allocate the arguments object. | 1371 // Do the runtime call to allocate the arguments object. |
1371 __ bind(&runtime); | 1372 __ bind(&runtime); |
1372 __ pop(eax); // Remove saved parameter count. | 1373 __ pop(eax); // Remove saved parameter count. |
1373 __ mov(Operand(esp, 1 * kPointerSize), ecx); // Patch argument count. | 1374 __ mov(Operand(esp, 1 * kPointerSize), ecx); // Patch argument count. |
1374 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 1375 __ TailCallRuntime(Runtime::kHiddenNewArgumentsFast, 3, 1); |
1375 } | 1376 } |
1376 | 1377 |
1377 | 1378 |
1378 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { | 1379 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { |
1379 Isolate* isolate = masm->isolate(); | 1380 Isolate* isolate = masm->isolate(); |
1380 | 1381 |
1381 // esp[0] : return address | 1382 // esp[0] : return address |
1382 // esp[4] : number of parameters | 1383 // esp[4] : number of parameters |
1383 // esp[8] : receiver displacement | 1384 // esp[8] : receiver displacement |
1384 // esp[12] : function | 1385 // esp[12] : function |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 __ sub(edx, Immediate(kPointerSize)); | 1464 __ sub(edx, Immediate(kPointerSize)); |
1464 __ dec(ecx); | 1465 __ dec(ecx); |
1465 __ j(not_zero, &loop); | 1466 __ j(not_zero, &loop); |
1466 | 1467 |
1467 // Return and remove the on-stack parameters. | 1468 // Return and remove the on-stack parameters. |
1468 __ bind(&done); | 1469 __ bind(&done); |
1469 __ ret(3 * kPointerSize); | 1470 __ ret(3 * kPointerSize); |
1470 | 1471 |
1471 // Do the runtime call to allocate the arguments object. | 1472 // Do the runtime call to allocate the arguments object. |
1472 __ bind(&runtime); | 1473 __ bind(&runtime); |
1473 __ TailCallRuntime(Runtime::kNewStrictArgumentsFast, 3, 1); | 1474 __ TailCallRuntime(Runtime::kHiddenNewStrictArgumentsFast, 3, 1); |
1474 } | 1475 } |
1475 | 1476 |
1476 | 1477 |
1477 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1478 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1478 // Just jump directly to runtime if native RegExp is not selected at compile | 1479 // Just jump directly to runtime if native RegExp is not selected at compile |
1479 // time or if regexp entry in generated code is turned off runtime switch or | 1480 // time or if regexp entry in generated code is turned off runtime switch or |
1480 // at compilation. | 1481 // at compilation. |
1481 #ifdef V8_INTERPRETED_REGEXP | 1482 #ifdef V8_INTERPRETED_REGEXP |
1482 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); | 1483 __ TailCallRuntime(Runtime::kHiddenRegExpExec, 4, 1); |
1483 #else // V8_INTERPRETED_REGEXP | 1484 #else // V8_INTERPRETED_REGEXP |
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3122 index_not_number_, | 3123 index_not_number_, |
3123 DONT_DO_SMI_CHECK); | 3124 DONT_DO_SMI_CHECK); |
3124 call_helper.BeforeCall(masm); | 3125 call_helper.BeforeCall(masm); |
3125 __ push(object_); | 3126 __ push(object_); |
3126 __ push(index_); // Consumed by runtime conversion function. | 3127 __ push(index_); // Consumed by runtime conversion function. |
3127 if (index_flags_ == STRING_INDEX_IS_NUMBER) { | 3128 if (index_flags_ == STRING_INDEX_IS_NUMBER) { |
3128 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); | 3129 __ CallRuntime(Runtime::kNumberToIntegerMapMinusZero, 1); |
3129 } else { | 3130 } else { |
3130 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); | 3131 ASSERT(index_flags_ == STRING_INDEX_IS_ARRAY_INDEX); |
3131 // NumberToSmi discards numbers that are not exact integers. | 3132 // NumberToSmi discards numbers that are not exact integers. |
3132 __ CallRuntime(Runtime::kNumberToSmi, 1); | 3133 __ CallRuntime(Runtime::kHiddenNumberToSmi, 1); |
3133 } | 3134 } |
3134 if (!index_.is(eax)) { | 3135 if (!index_.is(eax)) { |
3135 // Save the conversion result before the pop instructions below | 3136 // Save the conversion result before the pop instructions below |
3136 // have a chance to overwrite it. | 3137 // have a chance to overwrite it. |
3137 __ mov(index_, eax); | 3138 __ mov(index_, eax); |
3138 } | 3139 } |
3139 __ pop(object_); | 3140 __ pop(object_); |
3140 // Reload the instance type. | 3141 // Reload the instance type. |
3141 __ mov(result_, FieldOperand(object_, HeapObject::kMapOffset)); | 3142 __ mov(result_, FieldOperand(object_, HeapObject::kMapOffset)); |
3142 __ movzx_b(result_, FieldOperand(result_, Map::kInstanceTypeOffset)); | 3143 __ movzx_b(result_, FieldOperand(result_, Map::kInstanceTypeOffset)); |
(...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5355 Operand(ebp, 7 * kPointerSize), | 5356 Operand(ebp, 7 * kPointerSize), |
5356 NULL); | 5357 NULL); |
5357 } | 5358 } |
5358 | 5359 |
5359 | 5360 |
5360 #undef __ | 5361 #undef __ |
5361 | 5362 |
5362 } } // namespace v8::internal | 5363 } } // namespace v8::internal |
5363 | 5364 |
5364 #endif // V8_TARGET_ARCH_IA32 | 5365 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |