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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::kNewClosureFromStubFailure)->entry; |
49 } | 49 } |
50 | 50 |
51 | 51 |
| 52 void FastNewContextStub::InitializeInterfaceDescriptor( |
| 53 Isolate* isolate, |
| 54 CodeStubInterfaceDescriptor* descriptor) { |
| 55 static Register registers[] = { r1 }; |
| 56 descriptor->register_param_count_ = 1; |
| 57 descriptor->register_params_ = registers; |
| 58 descriptor->deoptimization_handler_ = NULL; |
| 59 } |
| 60 |
| 61 |
52 void ToNumberStub::InitializeInterfaceDescriptor( | 62 void ToNumberStub::InitializeInterfaceDescriptor( |
53 Isolate* isolate, | 63 Isolate* isolate, |
54 CodeStubInterfaceDescriptor* descriptor) { | 64 CodeStubInterfaceDescriptor* descriptor) { |
55 static Register registers[] = { r0 }; | 65 static Register registers[] = { r0 }; |
56 descriptor->register_param_count_ = 1; | 66 descriptor->register_param_count_ = 1; |
57 descriptor->register_params_ = registers; | 67 descriptor->register_params_ = registers; |
58 descriptor->deoptimization_handler_ = NULL; | 68 descriptor->deoptimization_handler_ = NULL; |
59 } | 69 } |
60 | 70 |
61 | 71 |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 __ push(descriptor->register_params_[i]); | 464 __ push(descriptor->register_params_[i]); |
455 } | 465 } |
456 ExternalReference miss = descriptor->miss_handler(); | 466 ExternalReference miss = descriptor->miss_handler(); |
457 __ CallExternalReference(miss, descriptor->register_param_count_); | 467 __ CallExternalReference(miss, descriptor->register_param_count_); |
458 } | 468 } |
459 | 469 |
460 __ Ret(); | 470 __ Ret(); |
461 } | 471 } |
462 | 472 |
463 | 473 |
464 void FastNewContextStub::Generate(MacroAssembler* masm) { | |
465 // Try to allocate the context in new space. | |
466 Label gc; | |
467 int length = slots_ + Context::MIN_CONTEXT_SLOTS; | |
468 | |
469 // Attempt to allocate the context in new space. | |
470 __ Allocate(FixedArray::SizeFor(length), r0, r1, r2, &gc, TAG_OBJECT); | |
471 | |
472 // Load the function from the stack. | |
473 __ ldr(r3, MemOperand(sp, 0)); | |
474 | |
475 // Set up the object header. | |
476 __ LoadRoot(r1, Heap::kFunctionContextMapRootIndex); | |
477 __ mov(r2, Operand(Smi::FromInt(length))); | |
478 __ str(r2, FieldMemOperand(r0, FixedArray::kLengthOffset)); | |
479 __ str(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); | |
480 | |
481 // Set up the fixed slots, copy the global object from the previous context. | |
482 __ ldr(r2, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | |
483 __ mov(r1, Operand(Smi::FromInt(0))); | |
484 __ str(r3, MemOperand(r0, Context::SlotOffset(Context::CLOSURE_INDEX))); | |
485 __ str(cp, MemOperand(r0, Context::SlotOffset(Context::PREVIOUS_INDEX))); | |
486 __ str(r1, MemOperand(r0, Context::SlotOffset(Context::EXTENSION_INDEX))); | |
487 __ str(r2, MemOperand(r0, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | |
488 | |
489 // Initialize the rest of the slots to undefined. | |
490 __ LoadRoot(r1, Heap::kUndefinedValueRootIndex); | |
491 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) { | |
492 __ str(r1, MemOperand(r0, Context::SlotOffset(i))); | |
493 } | |
494 | |
495 // Remove the on-stack argument and return. | |
496 __ mov(cp, r0); | |
497 __ pop(); | |
498 __ Ret(); | |
499 | |
500 // Need to collect. Call into runtime system. | |
501 __ bind(&gc); | |
502 __ TailCallRuntime(Runtime::kNewFunctionContext, 1, 1); | |
503 } | |
504 | |
505 | |
506 void FastNewBlockContextStub::Generate(MacroAssembler* masm) { | 474 void FastNewBlockContextStub::Generate(MacroAssembler* masm) { |
507 // Stack layout on entry: | 475 // Stack layout on entry: |
508 // | 476 // |
509 // [sp]: function. | 477 // [sp]: function. |
510 // [sp + kPointerSize]: serialized scope info | 478 // [sp + kPointerSize]: serialized scope info |
511 | 479 |
512 // Try to allocate the context in new space. | 480 // Try to allocate the context in new space. |
513 Label gc; | 481 Label gc; |
514 int length = slots_ + Context::MIN_CONTEXT_SLOTS; | 482 int length = slots_ + Context::MIN_CONTEXT_SLOTS; |
515 __ Allocate(FixedArray::SizeFor(length), r0, r1, r2, &gc, TAG_OBJECT); | 483 __ Allocate(FixedArray::SizeFor(length), r0, r1, r2, &gc, TAG_OBJECT); |
(...skipping 5014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5530 __ bind(&fast_elements_case); | 5498 __ bind(&fast_elements_case); |
5531 GenerateCase(masm, FAST_ELEMENTS); | 5499 GenerateCase(masm, FAST_ELEMENTS); |
5532 } | 5500 } |
5533 | 5501 |
5534 | 5502 |
5535 #undef __ | 5503 #undef __ |
5536 | 5504 |
5537 } } // namespace v8::internal | 5505 } } // namespace v8::internal |
5538 | 5506 |
5539 #endif // V8_TARGET_ARCH_ARM | 5507 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |