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