OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3588 frame_->SpillAll(); | 3588 frame_->SpillAll(); |
3589 frame_->CallRuntime(Runtime::kDebugBreak, 0); | 3589 frame_->CallRuntime(Runtime::kDebugBreak, 0); |
3590 // Ignore the return value. | 3590 // Ignore the return value. |
3591 #endif | 3591 #endif |
3592 } | 3592 } |
3593 | 3593 |
3594 | 3594 |
3595 void CodeGenerator::InstantiateBoilerplate(Handle<JSFunction> boilerplate) { | 3595 void CodeGenerator::InstantiateBoilerplate(Handle<JSFunction> boilerplate) { |
3596 ASSERT(boilerplate->IsBoilerplate()); | 3596 ASSERT(boilerplate->IsBoilerplate()); |
3597 | 3597 |
3598 // Use the fast case closure allocation code that allocated in new | 3598 // Use the fast case closure allocation code that allocates in new |
3599 // space for nested functions that don't need literals cloning. | 3599 // space for nested functions that don't need literals cloning. |
3600 if (scope()->is_function_scope() && boilerplate->NumberOfLiterals() == 0) { | 3600 if (scope()->is_function_scope() && boilerplate->NumberOfLiterals() == 0) { |
3601 FastNewClosureStub stub; | 3601 FastNewClosureStub stub; |
3602 frame_->Push(boilerplate); | 3602 frame_->Push(boilerplate); |
3603 Result answer = frame_->CallStub(&stub, 1); | 3603 Result answer = frame_->CallStub(&stub, 1); |
3604 frame_->Push(&answer); | 3604 frame_->Push(&answer); |
3605 } else { | 3605 } else { |
3606 // Call the runtime to instantiate the function boilerplate | 3606 // Call the runtime to instantiate the function boilerplate |
3607 // object. The inevitable call will sync frame elements to memory | 3607 // object. The inevitable call will sync frame elements to memory |
3608 // anyway, so we do it eagerly to allow us to push the arguments | 3608 // anyway, so we do it eagerly to allow us to push the arguments |
(...skipping 4902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8511 __ add(Operand(dest), Immediate(2)); | 8511 __ add(Operand(dest), Immediate(2)); |
8512 } | 8512 } |
8513 __ sub(Operand(count), Immediate(1)); | 8513 __ sub(Operand(count), Immediate(1)); |
8514 __ j(not_zero, &loop); | 8514 __ j(not_zero, &loop); |
8515 } | 8515 } |
8516 | 8516 |
8517 | 8517 |
8518 #undef __ | 8518 #undef __ |
8519 | 8519 |
8520 } } // namespace v8::internal | 8520 } } // namespace v8::internal |
OLD | NEW |