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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 | 83 |
84 void LCodeGen::FinishCode(Handle<Code> code) { | 84 void LCodeGen::FinishCode(Handle<Code> code) { |
85 ASSERT(is_done()); | 85 ASSERT(is_done()); |
86 code->set_stack_slots(GetStackSlotCount()); | 86 code->set_stack_slots(GetStackSlotCount()); |
87 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 87 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
88 PopulateDeoptimizationData(code); | 88 PopulateDeoptimizationData(code); |
89 } | 89 } |
90 | 90 |
91 | 91 |
92 void LCodeGen::Abort(const char* format, ...) { | 92 void LChunkBuilder::Abort(const char* reason) { |
93 if (FLAG_trace_bailout) { | 93 info()->set_bailout_reason(reason); |
94 SmartArrayPointer<char> name( | |
95 info()->shared_info()->DebugName()->ToCString()); | |
96 PrintF("Aborting LCodeGen in @\"%s\": ", *name); | |
97 va_list arguments; | |
98 va_start(arguments, format); | |
99 OS::VPrint(format, arguments); | |
100 va_end(arguments); | |
101 PrintF("\n"); | |
102 } | |
103 status_ = ABORTED; | 94 status_ = ABORTED; |
104 } | 95 } |
105 | 96 |
106 | 97 |
107 void LCodeGen::Comment(const char* format, ...) { | 98 void LCodeGen::Comment(const char* format, ...) { |
108 if (!FLAG_code_comments) return; | 99 if (!FLAG_code_comments) return; |
109 char buffer[4 * KB]; | 100 char buffer[4 * KB]; |
110 StringBuilder builder(buffer, ARRAY_SIZE(buffer)); | 101 StringBuilder builder(buffer, ARRAY_SIZE(buffer)); |
111 va_list arguments; | 102 va_list arguments; |
112 va_start(arguments, format); | 103 va_start(arguments, format); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // Deferred code is the last part of the instruction sequence. Mark | 245 // Deferred code is the last part of the instruction sequence. Mark |
255 // the generated code as done unless we bailed out. | 246 // the generated code as done unless we bailed out. |
256 if (!is_aborted()) status_ = DONE; | 247 if (!is_aborted()) status_ = DONE; |
257 return !is_aborted(); | 248 return !is_aborted(); |
258 } | 249 } |
259 | 250 |
260 | 251 |
261 bool LCodeGen::GenerateDeoptJumpTable() { | 252 bool LCodeGen::GenerateDeoptJumpTable() { |
262 // TODO(plind): not clear that this will have advantage for MIPS. | 253 // TODO(plind): not clear that this will have advantage for MIPS. |
263 // Skipping it for now. Raised issue #100 for this. | 254 // Skipping it for now. Raised issue #100 for this. |
264 Abort("Unimplemented: %s", "GenerateDeoptJumpTable"); | 255 Abort("Unimplemented: GenerateDeoptJumpTable"); |
265 return false; | 256 return false; |
266 } | 257 } |
267 | 258 |
268 | 259 |
269 bool LCodeGen::GenerateSafepointTable() { | 260 bool LCodeGen::GenerateSafepointTable() { |
270 ASSERT(is_done()); | 261 ASSERT(is_done()); |
271 safepoints_.Emit(masm(), GetStackSlotCount()); | 262 safepoints_.Emit(masm(), GetStackSlotCount()); |
272 return !is_aborted(); | 263 return !is_aborted(); |
273 } | 264 } |
274 | 265 |
(...skipping 5077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5352 __ Subu(scratch, result, scratch); | 5343 __ Subu(scratch, result, scratch); |
5353 __ lw(result, FieldMemOperand(scratch, | 5344 __ lw(result, FieldMemOperand(scratch, |
5354 FixedArray::kHeaderSize - kPointerSize)); | 5345 FixedArray::kHeaderSize - kPointerSize)); |
5355 __ bind(&done); | 5346 __ bind(&done); |
5356 } | 5347 } |
5357 | 5348 |
5358 | 5349 |
5359 #undef __ | 5350 #undef __ |
5360 | 5351 |
5361 } } // namespace v8::internal | 5352 } } // namespace v8::internal |
OLD | NEW |