| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 | 282 |
| 283 | 283 |
| 284 void LCallGlobal::PrintDataTo(StringStream* stream) const { | 284 void LCallGlobal::PrintDataTo(StringStream* stream) const { |
| 285 SmartPointer<char> name_string = name()->ToCString(); | 285 SmartPointer<char> name_string = name()->ToCString(); |
| 286 stream->Add("%s #%d / ", *name_string, arity()); | 286 stream->Add("%s #%d / ", *name_string, arity()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 | 289 |
| 290 void LCallKnownGlobal::PrintDataTo(StringStream* stream) const { | 290 void LCallKnownGlobal::PrintDataTo(StringStream* stream) const { |
| 291 stream->Add("#%d / ", arity()); | 291 LUnaryOperation::PrintDataTo(stream); |
| 292 stream->Add(" #%d / ", arity()); |
| 292 } | 293 } |
| 293 | 294 |
| 294 | 295 |
| 295 void LCallNew::PrintDataTo(StringStream* stream) const { | 296 void LCallNew::PrintDataTo(StringStream* stream) const { |
| 296 LUnaryOperation::PrintDataTo(stream); | 297 LUnaryOperation::PrintDataTo(stream); |
| 297 stream->Add(" #%d / ", arity()); | 298 stream->Add(" #%d / ", arity()); |
| 298 } | 299 } |
| 299 | 300 |
| 300 | 301 |
| 301 void LClassOfTest::PrintDataTo(StringStream* stream) const { | 302 void LClassOfTest::PrintDataTo(StringStream* stream) const { |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 } | 1347 } |
| 1347 | 1348 |
| 1348 | 1349 |
| 1349 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { | 1350 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { |
| 1350 return DefineAsRegister(new LGlobalReceiver); | 1351 return DefineAsRegister(new LGlobalReceiver); |
| 1351 } | 1352 } |
| 1352 | 1353 |
| 1353 | 1354 |
| 1354 LInstruction* LChunkBuilder::DoCallConstantFunction( | 1355 LInstruction* LChunkBuilder::DoCallConstantFunction( |
| 1355 HCallConstantFunction* instr) { | 1356 HCallConstantFunction* instr) { |
| 1356 argument_count_ -= instr->argument_count(); | 1357 DecrementArgumentCount(instr->argument_count()); |
| 1357 return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr); | 1358 return MarkAsCall(DefineFixed(new LCallConstantFunction, r0), instr); |
| 1358 } | 1359 } |
| 1359 | 1360 |
| 1360 | 1361 |
| 1361 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1362 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1362 BuiltinFunctionId op = instr->op(); | 1363 BuiltinFunctionId op = instr->op(); |
| 1363 LOperand* input = UseRegisterAtStart(instr->value()); | 1364 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1364 LInstruction* result = new LUnaryMathOperation(input); | 1365 LInstruction* result = new LUnaryMathOperation(input); |
| 1365 switch (op) { | 1366 switch (op) { |
| 1366 case kMathAbs: | 1367 case kMathAbs: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1377 return NULL; | 1378 return NULL; |
| 1378 default: | 1379 default: |
| 1379 UNREACHABLE(); | 1380 UNREACHABLE(); |
| 1380 return NULL; | 1381 return NULL; |
| 1381 } | 1382 } |
| 1382 } | 1383 } |
| 1383 | 1384 |
| 1384 | 1385 |
| 1385 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { | 1386 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { |
| 1386 ASSERT(instr->key()->representation().IsTagged()); | 1387 ASSERT(instr->key()->representation().IsTagged()); |
| 1387 argument_count_ -= instr->argument_count(); | 1388 DecrementArgumentCount(instr->argument_count()); |
| 1388 UseFixed(instr->key(), r2); | 1389 UseFixed(instr->key(), r2); |
| 1389 return MarkAsCall(DefineFixed(new LCallKeyed, r0), instr); | 1390 return MarkAsCall(DefineFixed(new LCallKeyed, r0), instr); |
| 1390 } | 1391 } |
| 1391 | 1392 |
| 1392 | 1393 |
| 1393 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { | 1394 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { |
| 1394 argument_count_ -= instr->argument_count(); | 1395 DecrementArgumentCount(instr->argument_count()); |
| 1395 return MarkAsCall(DefineFixed(new LCallNamed, r0), instr); | 1396 return MarkAsCall(DefineFixed(new LCallNamed, r0), instr); |
| 1396 } | 1397 } |
| 1397 | 1398 |
| 1398 | 1399 |
| 1399 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) { | 1400 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) { |
| 1400 argument_count_ -= instr->argument_count(); | 1401 DecrementArgumentCount(instr->argument_count()); |
| 1401 return MarkAsCall(DefineFixed(new LCallGlobal, r0), instr); | 1402 return MarkAsCall(DefineFixed(new LCallGlobal, r0), instr); |
| 1402 } | 1403 } |
| 1403 | 1404 |
| 1404 | 1405 |
| 1405 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) { | 1406 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) { |
| 1406 argument_count_ -= instr->argument_count(); | 1407 LOperand* receiver = UseFixed(instr->receiver(), r0); |
| 1408 DecrementArgumentCount(instr->argument_count()); |
| 1407 return MarkAsCall(DefineFixed(new LCallKnownGlobal, r0), instr); | 1409 return MarkAsCall(DefineFixed(new LCallKnownGlobal, r0), instr); |
| 1408 } | 1410 } |
| 1409 | 1411 |
| 1410 | 1412 |
| 1411 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { | 1413 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { |
| 1412 LOperand* constructor = UseFixed(instr->constructor(), r1); | 1414 LOperand* constructor = UseFixed(instr->constructor(), r1); |
| 1413 argument_count_ -= instr->argument_count(); | 1415 DecrementArgumentCount(instr->argument_count()); |
| 1414 LInstruction* result = new LCallNew(constructor); | 1416 LInstruction* result = new LCallNew(constructor); |
| 1415 return MarkAsCall(DefineFixed(result, r0), instr); | 1417 return MarkAsCall(DefineFixed(result, r0), instr); |
| 1416 } | 1418 } |
| 1417 | 1419 |
| 1418 | 1420 |
| 1419 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 1421 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
| 1420 argument_count_ -= instr->argument_count(); | 1422 DecrementArgumentCount(instr->argument_count()); |
| 1421 return MarkAsCall(DefineFixed(new LCallFunction, r0), instr); | 1423 return MarkAsCall(DefineFixed(new LCallFunction, r0), instr); |
| 1422 } | 1424 } |
| 1423 | 1425 |
| 1424 | 1426 |
| 1425 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 1427 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
| 1426 argument_count_ -= instr->argument_count(); | 1428 DecrementArgumentCount(instr->argument_count()); |
| 1427 return MarkAsCall(DefineFixed(new LCallRuntime, r0), instr); | 1429 return MarkAsCall(DefineFixed(new LCallRuntime, r0), instr); |
| 1428 } | 1430 } |
| 1429 | 1431 |
| 1430 | 1432 |
| 1431 LInstruction* LChunkBuilder::DoShr(HShr* instr) { | 1433 LInstruction* LChunkBuilder::DoShr(HShr* instr) { |
| 1432 return DoShift(Token::SHR, instr); | 1434 return DoShift(Token::SHR, instr); |
| 1433 } | 1435 } |
| 1434 | 1436 |
| 1435 | 1437 |
| 1436 LInstruction* LChunkBuilder::DoSar(HSar* instr) { | 1438 LInstruction* LChunkBuilder::DoSar(HSar* instr) { |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1993 } | 1995 } |
| 1994 | 1996 |
| 1995 | 1997 |
| 1996 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 1998 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 1997 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. | 1999 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
| 1998 return DefineAsSpilled(new LUnknownOSRValue, spill_index); | 2000 return DefineAsSpilled(new LUnknownOSRValue, spill_index); |
| 1999 } | 2001 } |
| 2000 | 2002 |
| 2001 | 2003 |
| 2002 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2004 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
| 2003 argument_count_ -= instr->argument_count(); | 2005 DecrementArgumentCount(instr->argument_count()); |
| 2004 return MarkAsCall(DefineFixed(new LCallStub, r0), instr); | 2006 return MarkAsCall(DefineFixed(new LCallStub, r0), instr); |
| 2005 } | 2007 } |
| 2006 | 2008 |
| 2007 | 2009 |
| 2008 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { | 2010 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
| 2009 // There are no real uses of the arguments object (we bail out in all other | 2011 // There are no real uses of the arguments object (we bail out in all other |
| 2010 // cases). | 2012 // cases). |
| 2011 return NULL; | 2013 return NULL; |
| 2012 } | 2014 } |
| 2013 | 2015 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 return MarkAsCall(new LStackCheck, instr); | 2076 return MarkAsCall(new LStackCheck, instr); |
| 2075 } | 2077 } |
| 2076 | 2078 |
| 2077 | 2079 |
| 2078 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2080 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
| 2079 HEnvironment* outer = current_block_->last_environment(); | 2081 HEnvironment* outer = current_block_->last_environment(); |
| 2080 HConstant* undefined = graph()->GetConstantUndefined(); | 2082 HConstant* undefined = graph()->GetConstantUndefined(); |
| 2081 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2083 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
| 2082 instr->function(), | 2084 instr->function(), |
| 2083 false, | 2085 false, |
| 2084 undefined); | 2086 undefined, |
| 2087 NULL); |
| 2085 current_block_->UpdateEnvironment(inner); | 2088 current_block_->UpdateEnvironment(inner); |
| 2086 chunk_->AddInlinedClosure(instr->closure()); | 2089 chunk_->AddInlinedClosure(instr->closure()); |
| 2087 return NULL; | 2090 return NULL; |
| 2088 } | 2091 } |
| 2089 | 2092 |
| 2090 | 2093 |
| 2091 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2094 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2092 HEnvironment* outer = current_block_->last_environment()->outer(); | 2095 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2093 current_block_->UpdateEnvironment(outer); | 2096 current_block_->UpdateEnvironment(outer); |
| 2094 return NULL; | 2097 return NULL; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2106 void LPointerMap::PrintTo(StringStream* stream) const { | 2109 void LPointerMap::PrintTo(StringStream* stream) const { |
| 2107 stream->Add("{"); | 2110 stream->Add("{"); |
| 2108 for (int i = 0; i < pointer_operands_.length(); ++i) { | 2111 for (int i = 0; i < pointer_operands_.length(); ++i) { |
| 2109 if (i != 0) stream->Add(";"); | 2112 if (i != 0) stream->Add(";"); |
| 2110 pointer_operands_[i]->PrintTo(stream); | 2113 pointer_operands_[i]->PrintTo(stream); |
| 2111 } | 2114 } |
| 2112 stream->Add("} @%d", position()); | 2115 stream->Add("} @%d", position()); |
| 2113 } | 2116 } |
| 2114 | 2117 |
| 2115 } } // namespace v8::internal | 2118 } } // namespace v8::internal |
| OLD | NEW |