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 2650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2661 | 2661 |
2662 void FullCodeGenerator::EmitLog(ZoneList<Expression*>* args) { | 2662 void FullCodeGenerator::EmitLog(ZoneList<Expression*>* args) { |
2663 // Conditionally generate a log call. | 2663 // Conditionally generate a log call. |
2664 // Args: | 2664 // Args: |
2665 // 0 (literal string): The type of logging (corresponds to the flags). | 2665 // 0 (literal string): The type of logging (corresponds to the flags). |
2666 // This is used to determine whether or not to generate the log call. | 2666 // This is used to determine whether or not to generate the log call. |
2667 // 1 (string): Format string. Access the string at argument index 2 | 2667 // 1 (string): Format string. Access the string at argument index 2 |
2668 // with '%2s' (see Logger::LogRuntime for all the formats). | 2668 // with '%2s' (see Logger::LogRuntime for all the formats). |
2669 // 2 (array): Arguments to the format string. | 2669 // 2 (array): Arguments to the format string. |
2670 ASSERT_EQ(args->length(), 3); | 2670 ASSERT_EQ(args->length(), 3); |
2671 #ifdef ENABLE_LOGGING_AND_PROFILING | |
2672 if (CodeGenerator::ShouldGenerateLog(args->at(0))) { | 2671 if (CodeGenerator::ShouldGenerateLog(args->at(0))) { |
2673 VisitForStackValue(args->at(1)); | 2672 VisitForStackValue(args->at(1)); |
2674 VisitForStackValue(args->at(2)); | 2673 VisitForStackValue(args->at(2)); |
2675 __ CallRuntime(Runtime::kLog, 2); | 2674 __ CallRuntime(Runtime::kLog, 2); |
2676 } | 2675 } |
2677 #endif | |
2678 // Finally, we're expected to leave a value on the top of the stack. | 2676 // Finally, we're expected to leave a value on the top of the stack. |
2679 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 2677 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
2680 context()->Plug(rax); | 2678 context()->Plug(rax); |
2681 } | 2679 } |
2682 | 2680 |
2683 | 2681 |
2684 void FullCodeGenerator::EmitRandomHeapNumber(ZoneList<Expression*>* args) { | 2682 void FullCodeGenerator::EmitRandomHeapNumber(ZoneList<Expression*>* args) { |
2685 ASSERT(args->length() == 0); | 2683 ASSERT(args->length() == 0); |
2686 | 2684 |
2687 Label slow_allocate_heapnumber; | 2685 Label slow_allocate_heapnumber; |
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4233 __ jmp(rdx); | 4231 __ jmp(rdx); |
4234 } | 4232 } |
4235 | 4233 |
4236 | 4234 |
4237 #undef __ | 4235 #undef __ |
4238 | 4236 |
4239 | 4237 |
4240 } } // namespace v8::internal | 4238 } } // namespace v8::internal |
4241 | 4239 |
4242 #endif // V8_TARGET_ARCH_X64 | 4240 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |