Chromium Code Reviews

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 6326003: X64 Crnakshaft: Added GeneratePrologue implementation. (Closed)
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 73 matching lines...)
84 // Copy the string before recording it in the assembler to avoid 84 // Copy the string before recording it in the assembler to avoid
85 // issues when the stack allocated buffer goes out of scope. 85 // issues when the stack allocated buffer goes out of scope.
86 size_t length = builder.position(); 86 size_t length = builder.position();
87 Vector<char> copy = Vector<char>::New(length + 1); 87 Vector<char> copy = Vector<char>::New(length + 1);
88 memcpy(copy.start(), builder.Finalize(), copy.length()); 88 memcpy(copy.start(), builder.Finalize(), copy.length());
89 masm()->RecordComment(copy.start()); 89 masm()->RecordComment(copy.start());
90 } 90 }
91 91
92 92
93 bool LCodeGen::GeneratePrologue() { 93 bool LCodeGen::GeneratePrologue() {
94 Abort("Unimplemented: %s", "GeneratePrologue"); 94 ASSERT(is_generating());
95 return false; 95
96 #ifdef DEBUG
97 if (strlen(FLAG_stop_at) > 0 &&
98 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
99 __ int3();
100 }
101 #endif
102
103 __ push(rbp); // Caller's frame pointer.
104 __ movq(rbp, rsp);
105 __ push(rsi); // Callee's context.
106 __ push(rdi); // Callee's JS function.
107
108 // Reserve space for the stack slots needed by the code.
109 int slots = StackSlotCount();
110 if (slots > 0) {
111 if (FLAG_debug_code) {
112 __ movl(rax, Immediate(slots));
113 Label loop;
114 __ bind(&loop);
115 __ push(Immediate(kSlotsZapValue));
116 __ decl(rax);
117 __ j(not_zero, &loop);
118 } else {
119 __ subq(rsp, Immediate(slots * kPointerSize));
120 }
121 }
122
123 // Trace the call.
124 if (FLAG_trace) {
125 __ CallRuntime(Runtime::kTraceEnter, 0);
126 }
127 return !is_aborted();
96 } 128 }
97 129
98 130
99 bool LCodeGen::GenerateBody() { 131 bool LCodeGen::GenerateBody() {
100 ASSERT(is_generating()); 132 ASSERT(is_generating());
101 bool emit_instructions = true; 133 bool emit_instructions = true;
102 for (current_instruction_ = 0; 134 for (current_instruction_ = 0;
103 !is_aborted() && current_instruction_ < instructions_->length(); 135 !is_aborted() && current_instruction_ < instructions_->length();
104 current_instruction_++) { 136 current_instruction_++) {
105 LInstruction* instr = instructions_->at(current_instruction_); 137 LInstruction* instr = instructions_->at(current_instruction_);
(...skipping 1061 matching lines...)
1167 1199
1168 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 1200 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
1169 Abort("Unimplemented: %s", "DoOsrEntry"); 1201 Abort("Unimplemented: %s", "DoOsrEntry");
1170 } 1202 }
1171 1203
1172 #undef __ 1204 #undef __
1173 1205
1174 } } // namespace v8::internal 1206 } } // namespace v8::internal
1175 1207
1176 #endif // V8_TARGET_ARCH_X64 1208 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/lithium-allocator.h ('k') | src/x64/lithium-x64.cc » ('j') | src/x64/lithium-x64.cc » ('J')

Powered by Google App Engine