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 static PlatformCallInterfaceDescriptor defaultDescriptor = | |
Toon Verwaest
2014/01/03 07:14:07
Only use camel-case if the first letter is upperca
| |
355 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | |
356 | |
357 static PlatformCallInterfaceDescriptor noInlineDescriptor = | |
358 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | |
359 | |
360 { | |
361 CallInterfaceDescriptor* descriptor = | |
362 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | |
363 static Register registers[] = { r1, // JSFunction | |
364 cp, // context | |
365 r5, // call kind | |
366 r0, // actual number of arguments | |
367 r2, // expected number of arguments | |
368 }; | |
369 static Representation representations[] = { | |
370 Representation::Tagged(), // JSFunction | |
371 Representation::Tagged(), // context | |
372 Representation::Smi(), // call kind | |
373 Representation::Integer32(), // actual number of arguments | |
374 Representation::Integer32(), // expected number of arguments | |
375 }; | |
376 descriptor->register_param_count_ = 5; | |
377 descriptor->register_params_ = registers; | |
378 descriptor->param_representations_ = representations; | |
379 descriptor->platform_specific_descriptor_ = &defaultDescriptor; | |
380 } | |
381 { | |
382 CallInterfaceDescriptor* descriptor = | |
383 isolate->call_descriptor(Isolate::KeyedCall); | |
384 static Register registers[] = { cp, // context | |
385 r2, // key | |
386 }; | |
387 static Representation representations[] = { | |
388 Representation::Tagged(), // context | |
389 Representation::Tagged(), // key | |
390 }; | |
391 descriptor->register_param_count_ = 2; | |
392 descriptor->register_params_ = registers; | |
393 descriptor->param_representations_ = representations; | |
394 descriptor->platform_specific_descriptor_ = &noInlineDescriptor; | |
395 } | |
396 { | |
397 CallInterfaceDescriptor* descriptor = | |
398 isolate->call_descriptor(Isolate::NamedCall); | |
399 static Register registers[] = { cp, // context | |
400 r2, // name | |
401 }; | |
402 static Representation representations[] = { | |
403 Representation::Tagged(), // context | |
404 Representation::Tagged(), // name | |
405 }; | |
406 descriptor->register_param_count_ = 2; | |
407 descriptor->register_params_ = registers; | |
408 descriptor->param_representations_ = representations; | |
409 descriptor->platform_specific_descriptor_ = &noInlineDescriptor; | |
410 } | |
411 } | |
412 | |
413 | |
353 #define __ ACCESS_MASM(masm) | 414 #define __ ACCESS_MASM(masm) |
354 | 415 |
355 | 416 |
356 static void EmitIdenticalObjectComparison(MacroAssembler* masm, | 417 static void EmitIdenticalObjectComparison(MacroAssembler* masm, |
357 Label* slow, | 418 Label* slow, |
358 Condition cond); | 419 Condition cond); |
359 static void EmitSmiNonsmiComparison(MacroAssembler* masm, | 420 static void EmitSmiNonsmiComparison(MacroAssembler* masm, |
360 Register lhs, | 421 Register lhs, |
361 Register rhs, | 422 Register rhs, |
362 Label* lhs_not_nan, | 423 Label* lhs_not_nan, |
(...skipping 2863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3226 masm->isolate()->heap()->undefined_value()); | 3287 masm->isolate()->heap()->undefined_value()); |
3227 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 3288 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
3228 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset)); | 3289 __ str(ip, FieldMemOperand(r2, Cell::kValueOffset)); |
3229 } | 3290 } |
3230 // Check for function proxy. | 3291 // Check for function proxy. |
3231 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); | 3292 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); |
3232 __ b(ne, &non_function); | 3293 __ b(ne, &non_function); |
3233 __ push(r1); // put proxy as additional argument | 3294 __ push(r1); // put proxy as additional argument |
3234 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32)); | 3295 __ mov(r0, Operand(argc_ + 1, RelocInfo::NONE32)); |
3235 __ mov(r2, Operand::Zero()); | 3296 __ mov(r2, Operand::Zero()); |
3236 __ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY); | 3297 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY); |
3237 __ SetCallKind(r5, CALL_AS_METHOD); | 3298 __ SetCallKind(r5, CALL_AS_METHOD); |
3238 { | 3299 { |
3239 Handle<Code> adaptor = | 3300 Handle<Code> adaptor = |
3240 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); | 3301 masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
3241 __ Jump(adaptor, RelocInfo::CODE_TARGET); | 3302 __ Jump(adaptor, RelocInfo::CODE_TARGET); |
3242 } | 3303 } |
3243 | 3304 |
3244 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead | 3305 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
3245 // of the original receiver from the call site). | 3306 // of the original receiver from the call site). |
3246 __ bind(&non_function); | 3307 __ bind(&non_function); |
3247 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); | 3308 __ str(r1, MemOperand(sp, argc_ * kPointerSize)); |
3248 __ mov(r0, Operand(argc_)); // Set up the number of arguments. | 3309 __ mov(r0, Operand(argc_)); // Set up the number of arguments. |
3249 __ mov(r2, Operand::Zero()); | 3310 __ mov(r2, Operand::Zero()); |
3250 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 3311 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION); |
3251 __ SetCallKind(r5, CALL_AS_METHOD); | 3312 __ SetCallKind(r5, CALL_AS_METHOD); |
3252 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3313 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
3253 RelocInfo::CODE_TARGET); | 3314 RelocInfo::CODE_TARGET); |
3254 } | 3315 } |
3255 | 3316 |
3256 | 3317 |
3257 void CallConstructStub::Generate(MacroAssembler* masm) { | 3318 void CallConstructStub::Generate(MacroAssembler* masm) { |
3258 // r0 : number of arguments | 3319 // r0 : number of arguments |
3259 // r1 : the function to call | 3320 // r1 : the function to call |
3260 // r2 : cache cell for call target | 3321 // r2 : cache cell for call target |
(...skipping 16 matching lines...) Expand all Loading... | |
3277 SharedFunctionInfo::kConstructStubOffset)); | 3338 SharedFunctionInfo::kConstructStubOffset)); |
3278 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3339 __ add(pc, jmp_reg, Operand(Code::kHeaderSize - kHeapObjectTag)); |
3279 | 3340 |
3280 // r0: number of arguments | 3341 // r0: number of arguments |
3281 // r1: called object | 3342 // r1: called object |
3282 // r3: object type | 3343 // r3: object type |
3283 Label do_call; | 3344 Label do_call; |
3284 __ bind(&slow); | 3345 __ bind(&slow); |
3285 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); | 3346 __ cmp(r3, Operand(JS_FUNCTION_PROXY_TYPE)); |
3286 __ b(ne, &non_function_call); | 3347 __ b(ne, &non_function_call); |
3287 __ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); | 3348 __ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); |
3288 __ jmp(&do_call); | 3349 __ jmp(&do_call); |
3289 | 3350 |
3290 __ bind(&non_function_call); | 3351 __ bind(&non_function_call); |
3291 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); | 3352 __ GetBuiltinFunction(r1, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
3292 __ bind(&do_call); | 3353 __ bind(&do_call); |
3293 // Set expected number of arguments to zero (not changing r0). | 3354 // Set expected number of arguments to zero (not changing r0). |
3294 __ mov(r2, Operand::Zero()); | 3355 __ mov(r2, Operand::Zero()); |
3295 __ SetCallKind(r5, CALL_AS_METHOD); | 3356 __ SetCallKind(r5, CALL_AS_METHOD); |
3296 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 3357 __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
3297 RelocInfo::CODE_TARGET); | 3358 RelocInfo::CODE_TARGET); |
3298 } | 3359 } |
3299 | 3360 |
3300 | 3361 |
3301 // StringCharCodeAtGenerator | 3362 // StringCharCodeAtGenerator |
(...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5805 __ bind(&fast_elements_case); | 5866 __ bind(&fast_elements_case); |
5806 GenerateCase(masm, FAST_ELEMENTS); | 5867 GenerateCase(masm, FAST_ELEMENTS); |
5807 } | 5868 } |
5808 | 5869 |
5809 | 5870 |
5810 #undef __ | 5871 #undef __ |
5811 | 5872 |
5812 } } // namespace v8::internal | 5873 } } // namespace v8::internal |
5813 | 5874 |
5814 #endif // V8_TARGET_ARCH_ARM | 5875 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |