OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 #endif | 99 #endif |
100 }; | 100 }; |
101 | 101 |
102 | 102 |
103 // Generate code for a JS function. On entry to the function the receiver | 103 // Generate code for a JS function. On entry to the function the receiver |
104 // and arguments have been pushed on the stack left to right, with the | 104 // and arguments have been pushed on the stack left to right, with the |
105 // return address on top of them. The actual argument count matches the | 105 // return address on top of them. The actual argument count matches the |
106 // formal parameter count expected by the function. | 106 // formal parameter count expected by the function. |
107 // | 107 // |
108 // The live registers are: | 108 // The live registers are: |
109 // o rdi: the JS function object being called (ie, ourselves) | 109 // o rdi: the JS function object being called (i.e. ourselves) |
110 // o rsi: our context | 110 // o rsi: our context |
111 // o rbp: our caller's frame pointer | 111 // o rbp: our caller's frame pointer |
112 // o rsp: stack pointer (pointing to return address) | 112 // o rsp: stack pointer (pointing to return address) |
113 // | 113 // |
114 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 114 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
115 // frames-x64.h for its layout. | 115 // frames-x64.h for its layout. |
116 void FullCodeGenerator::Generate(CompilationInfo* info) { | 116 void FullCodeGenerator::Generate(CompilationInfo* info) { |
117 ASSERT(info_ == NULL); | 117 ASSERT(info_ == NULL); |
118 info_ = info; | 118 info_ = info; |
119 scope_ = info->scope(); | 119 scope_ = info->scope(); |
(...skipping 3403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3523 __ jmp(&done); | 3523 __ jmp(&done); |
3524 | 3524 |
3525 // Generic bailout code used from several places. | 3525 // Generic bailout code used from several places. |
3526 __ bind(&bailout); | 3526 __ bind(&bailout); |
3527 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 3527 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
3528 __ jmp(&return_result); | 3528 __ jmp(&return_result); |
3529 | 3529 |
3530 | 3530 |
3531 // One-character separator case | 3531 // One-character separator case |
3532 __ bind(&one_char_separator); | 3532 __ bind(&one_char_separator); |
3533 // Get the separator ascii character value. | 3533 // Get the separator ASCII character value. |
3534 // Register "string" holds the separator. | 3534 // Register "string" holds the separator. |
3535 __ movzxbl(scratch, FieldOperand(string, SeqAsciiString::kHeaderSize)); | 3535 __ movzxbl(scratch, FieldOperand(string, SeqAsciiString::kHeaderSize)); |
3536 __ Set(index, 0); | 3536 __ Set(index, 0); |
3537 // Jump into the loop after the code that copies the separator, so the first | 3537 // Jump into the loop after the code that copies the separator, so the first |
3538 // element is not preceded by a separator | 3538 // element is not preceded by a separator |
3539 __ jmp(&loop_2_entry); | 3539 __ jmp(&loop_2_entry); |
3540 // Loop condition: while (index < length). | 3540 // Loop condition: while (index < length). |
3541 __ bind(&loop_2); | 3541 __ bind(&loop_2); |
3542 // Each iteration of the loop concatenates one string to the result. | 3542 // Each iteration of the loop concatenates one string to the result. |
3543 // Live values in registers: | 3543 // Live values in registers: |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4346 *context_length = 0; | 4346 *context_length = 0; |
4347 return previous_; | 4347 return previous_; |
4348 } | 4348 } |
4349 | 4349 |
4350 | 4350 |
4351 #undef __ | 4351 #undef __ |
4352 | 4352 |
4353 } } // namespace v8::internal | 4353 } } // namespace v8::internal |
4354 | 4354 |
4355 #endif // V8_TARGET_ARCH_X64 | 4355 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |