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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 | 191 |
192 void LGoto::PrintDataTo(StringStream* stream) { | 192 void LGoto::PrintDataTo(StringStream* stream) { |
193 stream->Add("B%d", block_id()); | 193 stream->Add("B%d", block_id()); |
194 } | 194 } |
195 | 195 |
196 | 196 |
197 void LBranch::PrintDataTo(StringStream* stream) { | 197 void LBranch::PrintDataTo(StringStream* stream) { |
198 stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); | 198 stream->Add("B%d | B%d on ", true_block_id(), false_block_id()); |
199 InputAt(0)->PrintTo(stream); | 199 value()->PrintTo(stream); |
200 } | 200 } |
201 | 201 |
202 | 202 |
203 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { | 203 void LCmpIDAndBranch::PrintDataTo(StringStream* stream) { |
204 stream->Add("if "); | 204 stream->Add("if "); |
205 InputAt(0)->PrintTo(stream); | 205 left()->PrintTo(stream); |
206 stream->Add(" %s ", Token::String(op())); | 206 stream->Add(" %s ", Token::String(op())); |
207 InputAt(1)->PrintTo(stream); | 207 right()->PrintTo(stream); |
208 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 208 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
209 } | 209 } |
210 | 210 |
211 | 211 |
212 void LIsNilAndBranch::PrintDataTo(StringStream* stream) { | 212 void LIsNilAndBranch::PrintDataTo(StringStream* stream) { |
213 stream->Add("if "); | 213 stream->Add("if "); |
214 InputAt(0)->PrintTo(stream); | 214 value()->PrintTo(stream); |
215 stream->Add(kind() == kStrictEquality ? " === " : " == "); | 215 stream->Add(kind() == kStrictEquality ? " === " : " == "); |
216 stream->Add(nil() == kNullValue ? "null" : "undefined"); | 216 stream->Add(nil() == kNullValue ? "null" : "undefined"); |
217 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); | 217 stream->Add(" then B%d else B%d", true_block_id(), false_block_id()); |
218 } | 218 } |
219 | 219 |
220 | 220 |
221 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { | 221 void LIsObjectAndBranch::PrintDataTo(StringStream* stream) { |
222 stream->Add("if is_object("); | 222 stream->Add("if is_object("); |
223 InputAt(0)->PrintTo(stream); | 223 value()->PrintTo(stream); |
224 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 224 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
225 } | 225 } |
226 | 226 |
227 | 227 |
228 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { | 228 void LIsStringAndBranch::PrintDataTo(StringStream* stream) { |
229 stream->Add("if is_string("); | 229 stream->Add("if is_string("); |
230 InputAt(0)->PrintTo(stream); | 230 value()->PrintTo(stream); |
231 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 231 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
232 } | 232 } |
233 | 233 |
234 | 234 |
235 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) { | 235 void LIsSmiAndBranch::PrintDataTo(StringStream* stream) { |
236 stream->Add("if is_smi("); | 236 stream->Add("if is_smi("); |
237 InputAt(0)->PrintTo(stream); | 237 value()->PrintTo(stream); |
238 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 238 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
239 } | 239 } |
240 | 240 |
241 | 241 |
242 void LIsUndetectableAndBranch::PrintDataTo(StringStream* stream) { | 242 void LIsUndetectableAndBranch::PrintDataTo(StringStream* stream) { |
243 stream->Add("if is_undetectable("); | 243 stream->Add("if is_undetectable("); |
244 InputAt(0)->PrintTo(stream); | 244 value()->PrintTo(stream); |
245 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 245 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
246 } | 246 } |
247 | 247 |
248 | 248 |
249 void LStringCompareAndBranch::PrintDataTo(StringStream* stream) { | 249 void LStringCompareAndBranch::PrintDataTo(StringStream* stream) { |
250 stream->Add("if string_compare("); | 250 stream->Add("if string_compare("); |
251 InputAt(1)->PrintTo(stream); | 251 left()->PrintTo(stream); |
252 InputAt(2)->PrintTo(stream); | 252 right()->PrintTo(stream); |
253 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 253 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
254 } | 254 } |
255 | 255 |
256 | 256 |
257 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) { | 257 void LHasInstanceTypeAndBranch::PrintDataTo(StringStream* stream) { |
258 stream->Add("if has_instance_type("); | 258 stream->Add("if has_instance_type("); |
259 InputAt(0)->PrintTo(stream); | 259 value()->PrintTo(stream); |
260 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 260 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
261 } | 261 } |
262 | 262 |
263 | 263 |
264 void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) { | 264 void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) { |
265 stream->Add("if has_cached_array_index("); | 265 stream->Add("if has_cached_array_index("); |
266 InputAt(0)->PrintTo(stream); | 266 value()->PrintTo(stream); |
267 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); | 267 stream->Add(") then B%d else B%d", true_block_id(), false_block_id()); |
268 } | 268 } |
269 | 269 |
270 | 270 |
271 void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) { | 271 void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) { |
272 stream->Add("if class_of_test("); | 272 stream->Add("if class_of_test("); |
273 InputAt(0)->PrintTo(stream); | 273 value()->PrintTo(stream); |
274 stream->Add(", \"%o\") then B%d else B%d", | 274 stream->Add(", \"%o\") then B%d else B%d", |
275 *hydrogen()->class_name(), | 275 *hydrogen()->class_name(), |
276 true_block_id(), | 276 true_block_id(), |
277 false_block_id()); | 277 false_block_id()); |
278 } | 278 } |
279 | 279 |
280 | 280 |
281 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { | 281 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { |
282 stream->Add("if typeof "); | 282 stream->Add("if typeof "); |
283 InputAt(0)->PrintTo(stream); | 283 value()->PrintTo(stream); |
284 stream->Add(" == \"%s\" then B%d else B%d", | 284 stream->Add(" == \"%s\" then B%d else B%d", |
285 *hydrogen()->type_literal()->ToCString(), | 285 *hydrogen()->type_literal()->ToCString(), |
286 true_block_id(), false_block_id()); | 286 true_block_id(), false_block_id()); |
287 } | 287 } |
288 | 288 |
289 | 289 |
290 void LCallConstantFunction::PrintDataTo(StringStream* stream) { | 290 void LCallConstantFunction::PrintDataTo(StringStream* stream) { |
291 stream->Add("#%d / ", arity()); | 291 stream->Add("#%d / ", arity()); |
292 } | 292 } |
293 | 293 |
294 | 294 |
295 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { | 295 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { |
296 stream->Add("/%s ", hydrogen()->OpName()); | 296 stream->Add("/%s ", hydrogen()->OpName()); |
297 InputAt(0)->PrintTo(stream); | 297 value()->PrintTo(stream); |
298 } | 298 } |
299 | 299 |
300 | 300 |
301 void LMathPowHalf::PrintDataTo(StringStream* stream) { | 301 void LMathPowHalf::PrintDataTo(StringStream* stream) { |
302 stream->Add("/pow_half "); | 302 stream->Add("/pow_half "); |
303 InputAt(0)->PrintTo(stream); | 303 value()->PrintTo(stream); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 void LLoadContextSlot::PrintDataTo(StringStream* stream) { | 307 void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
308 InputAt(0)->PrintTo(stream); | 308 context()->PrintTo(stream); |
309 stream->Add("[%d]", slot_index()); | 309 stream->Add("[%d]", slot_index()); |
310 } | 310 } |
311 | 311 |
312 | 312 |
313 void LStoreContextSlot::PrintDataTo(StringStream* stream) { | 313 void LStoreContextSlot::PrintDataTo(StringStream* stream) { |
314 InputAt(0)->PrintTo(stream); | 314 context()->PrintTo(stream); |
315 stream->Add("[%d] <- ", slot_index()); | 315 stream->Add("[%d] <- ", slot_index()); |
316 InputAt(1)->PrintTo(stream); | 316 value()->PrintTo(stream); |
317 } | 317 } |
318 | 318 |
319 | 319 |
320 void LInvokeFunction::PrintDataTo(StringStream* stream) { | 320 void LInvokeFunction::PrintDataTo(StringStream* stream) { |
321 stream->Add("= "); | 321 stream->Add("= "); |
322 InputAt(0)->PrintTo(stream); | 322 context()->PrintTo(stream); |
323 stream->Add(" "); | 323 stream->Add(" "); |
324 InputAt(1)->PrintTo(stream); | 324 function()->PrintTo(stream); |
325 stream->Add(" #%d / ", arity()); | 325 stream->Add(" #%d / ", arity()); |
326 } | 326 } |
327 | 327 |
328 | 328 |
329 void LCallKeyed::PrintDataTo(StringStream* stream) { | 329 void LCallKeyed::PrintDataTo(StringStream* stream) { |
330 stream->Add("[ecx] #%d / ", arity()); | 330 stream->Add("[ecx] #%d / ", arity()); |
331 } | 331 } |
332 | 332 |
333 | 333 |
334 void LCallNamed::PrintDataTo(StringStream* stream) { | 334 void LCallNamed::PrintDataTo(StringStream* stream) { |
335 SmartArrayPointer<char> name_string = name()->ToCString(); | 335 SmartArrayPointer<char> name_string = name()->ToCString(); |
336 stream->Add("%s #%d / ", *name_string, arity()); | 336 stream->Add("%s #%d / ", *name_string, arity()); |
337 } | 337 } |
338 | 338 |
339 | 339 |
340 void LCallGlobal::PrintDataTo(StringStream* stream) { | 340 void LCallGlobal::PrintDataTo(StringStream* stream) { |
341 SmartArrayPointer<char> name_string = name()->ToCString(); | 341 SmartArrayPointer<char> name_string = name()->ToCString(); |
342 stream->Add("%s #%d / ", *name_string, arity()); | 342 stream->Add("%s #%d / ", *name_string, arity()); |
343 } | 343 } |
344 | 344 |
345 | 345 |
346 void LCallKnownGlobal::PrintDataTo(StringStream* stream) { | 346 void LCallKnownGlobal::PrintDataTo(StringStream* stream) { |
347 stream->Add("#%d / ", arity()); | 347 stream->Add("#%d / ", arity()); |
348 } | 348 } |
349 | 349 |
350 | 350 |
351 void LCallNew::PrintDataTo(StringStream* stream) { | 351 void LCallNew::PrintDataTo(StringStream* stream) { |
352 stream->Add("= "); | 352 stream->Add("= "); |
353 InputAt(0)->PrintTo(stream); | 353 context()->PrintTo(stream); |
| 354 stream->Add(" "); |
| 355 constructor()->PrintTo(stream); |
354 stream->Add(" #%d / ", arity()); | 356 stream->Add(" #%d / ", arity()); |
355 } | 357 } |
356 | 358 |
357 | 359 |
358 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { | 360 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { |
359 arguments()->PrintTo(stream); | 361 arguments()->PrintTo(stream); |
360 | 362 |
361 stream->Add(" length "); | 363 stream->Add(" length "); |
362 length()->PrintTo(stream); | 364 length()->PrintTo(stream); |
363 | 365 |
(...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2432 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2431 LOperand* object = UseRegister(instr->object()); | 2433 LOperand* object = UseRegister(instr->object()); |
2432 LOperand* index = UseTempRegister(instr->index()); | 2434 LOperand* index = UseTempRegister(instr->index()); |
2433 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2435 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2434 } | 2436 } |
2435 | 2437 |
2436 | 2438 |
2437 } } // namespace v8::internal | 2439 } } // namespace v8::internal |
2438 | 2440 |
2439 #endif // V8_TARGET_ARCH_IA32 | 2441 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |