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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 | 285 |
286 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { | 286 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { |
287 stream->Add("if typeof "); | 287 stream->Add("if typeof "); |
288 value()->PrintTo(stream); | 288 value()->PrintTo(stream); |
289 stream->Add(" == \"%s\" then B%d else B%d", | 289 stream->Add(" == \"%s\" then B%d else B%d", |
290 *hydrogen()->type_literal()->ToCString(), | 290 *hydrogen()->type_literal()->ToCString(), |
291 true_block_id(), false_block_id()); | 291 true_block_id(), false_block_id()); |
292 } | 292 } |
293 | 293 |
294 | 294 |
295 void LSubAllocatedObject::PrintDataTo(StringStream* stream) { | |
296 stream->Add(" = "); | |
297 base_object()->PrintTo(stream); | |
298 stream->Add("+%d", offset()); | |
Hannes Payer (out of office)
2013/03/13 08:48:39
do you need a blank before +?
mvstanton
2013/03/13 10:14:40
I'll do a blank before and after the plus, that wa
| |
299 } | |
300 | |
301 | |
295 void LCallConstantFunction::PrintDataTo(StringStream* stream) { | 302 void LCallConstantFunction::PrintDataTo(StringStream* stream) { |
296 stream->Add("#%d / ", arity()); | 303 stream->Add("#%d / ", arity()); |
297 } | 304 } |
298 | 305 |
299 | 306 |
300 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { | 307 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { |
301 stream->Add("/%s ", hydrogen()->OpName()); | 308 stream->Add("/%s ", hydrogen()->OpName()); |
302 value()->PrintTo(stream); | 309 value()->PrintTo(stream); |
303 } | 310 } |
304 | 311 |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1074 } | 1081 } |
1075 | 1082 |
1076 | 1083 |
1077 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { | 1084 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { |
1078 ++argument_count_; | 1085 ++argument_count_; |
1079 LOperand* argument = UseAny(instr->argument()); | 1086 LOperand* argument = UseAny(instr->argument()); |
1080 return new(zone()) LPushArgument(argument); | 1087 return new(zone()) LPushArgument(argument); |
1081 } | 1088 } |
1082 | 1089 |
1083 | 1090 |
1091 LInstruction* LChunkBuilder::DoSubAllocatedObject( | |
1092 HSubAllocatedObject* sub_object) { | |
1093 bool zero_offset = sub_object->offset() == 0; | |
Hannes Payer (out of office)
2013/03/13 08:48:39
remove this and just just do return sub_object->of
Michael Starzinger
2013/03/13 09:12:35
Does this actually happen in practice? If not I wo
mvstanton
2013/03/13 10:14:40
good point, thanks. done.
mvstanton
2013/03/13 10:14:40
I got rid of zero_offset, per Michael's advice.
| |
1094 LOperand* base_object = UseRegister(sub_object->base_object()); | |
Michael Starzinger
2013/03/13 09:12:35
The base register and the result register can be t
mvstanton
2013/03/13 10:14:40
Done.
| |
1095 LSubAllocatedObject* result = | |
1096 new(zone()) LSubAllocatedObject(base_object); | |
1097 return zero_offset ? DefineSameAsFirst(result) : DefineAsRegister(result); | |
1098 } | |
1099 | |
1100 | |
1084 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { | 1101 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { |
1085 return instr->HasNoUses() | 1102 return instr->HasNoUses() |
1086 ? NULL | 1103 ? NULL |
1087 : DefineAsRegister(new(zone()) LThisFunction); | 1104 : DefineAsRegister(new(zone()) LThisFunction); |
1088 } | 1105 } |
1089 | 1106 |
1090 | 1107 |
1091 LInstruction* LChunkBuilder::DoContext(HContext* instr) { | 1108 LInstruction* LChunkBuilder::DoContext(HContext* instr) { |
1092 if (instr->HasNoUses()) return NULL; | 1109 if (instr->HasNoUses()) return NULL; |
1093 | 1110 |
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2596 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2613 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2597 LOperand* object = UseRegister(instr->object()); | 2614 LOperand* object = UseRegister(instr->object()); |
2598 LOperand* index = UseTempRegister(instr->index()); | 2615 LOperand* index = UseTempRegister(instr->index()); |
2599 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2616 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2600 } | 2617 } |
2601 | 2618 |
2602 | 2619 |
2603 } } // namespace v8::internal | 2620 } } // namespace v8::internal |
2604 | 2621 |
2605 #endif // V8_TARGET_ARCH_IA32 | 2622 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |