| 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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 } | 1348 } |
| 1348 | 1349 |
| 1349 | 1350 |
| 1350 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { | 1351 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { |
| 1351 return DefineAsRegister(new LGlobalReceiver); | 1352 return DefineAsRegister(new LGlobalReceiver); |
| 1352 } | 1353 } |
| 1353 | 1354 |
| 1354 | 1355 |
| 1355 LInstruction* LChunkBuilder::DoCallConstantFunction( | 1356 LInstruction* LChunkBuilder::DoCallConstantFunction( |
| 1356 HCallConstantFunction* instr) { | 1357 HCallConstantFunction* instr) { |
| 1357 argument_count_ -= instr->argument_count(); | 1358 DecrementArgumentCount(instr->argument_count()); |
| 1358 return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr); | 1359 return MarkAsCall(DefineFixed(new LCallConstantFunction, eax), instr); |
| 1359 } | 1360 } |
| 1360 | 1361 |
| 1361 | 1362 |
| 1362 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1363 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1363 BuiltinFunctionId op = instr->op(); | 1364 BuiltinFunctionId op = instr->op(); |
| 1364 if (op == kMathLog) { | 1365 if (op == kMathLog) { |
| 1365 LOperand* input = UseFixedDouble(instr->value(), xmm1); | 1366 LOperand* input = UseFixedDouble(instr->value(), xmm1); |
| 1366 LInstruction* result = new LUnaryMathOperation(input); | 1367 LInstruction* result = new LUnaryMathOperation(input); |
| 1367 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | 1368 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1382 default: | 1383 default: |
| 1383 UNREACHABLE(); | 1384 UNREACHABLE(); |
| 1384 return NULL; | 1385 return NULL; |
| 1385 } | 1386 } |
| 1386 } | 1387 } |
| 1387 } | 1388 } |
| 1388 | 1389 |
| 1389 | 1390 |
| 1390 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { | 1391 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { |
| 1391 ASSERT(instr->key()->representation().IsTagged()); | 1392 ASSERT(instr->key()->representation().IsTagged()); |
| 1392 argument_count_ -= instr->argument_count(); | 1393 DecrementArgumentCount(instr->argument_count()); |
| 1393 UseFixed(instr->key(), ecx); | 1394 UseFixed(instr->key(), ecx); |
| 1394 return MarkAsCall(DefineFixed(new LCallKeyed, eax), instr); | 1395 return MarkAsCall(DefineFixed(new LCallKeyed, eax), instr); |
| 1395 } | 1396 } |
| 1396 | 1397 |
| 1397 | 1398 |
| 1398 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { | 1399 LInstruction* LChunkBuilder::DoCallNamed(HCallNamed* instr) { |
| 1399 argument_count_ -= instr->argument_count(); | 1400 DecrementArgumentCount(instr->argument_count()); |
| 1400 return MarkAsCall(DefineFixed(new LCallNamed, eax), instr); | 1401 return MarkAsCall(DefineFixed(new LCallNamed, eax), instr); |
| 1401 } | 1402 } |
| 1402 | 1403 |
| 1403 | 1404 |
| 1404 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) { | 1405 LInstruction* LChunkBuilder::DoCallGlobal(HCallGlobal* instr) { |
| 1405 argument_count_ -= instr->argument_count(); | 1406 DecrementArgumentCount(instr->argument_count()); |
| 1406 return MarkAsCall(DefineFixed(new LCallGlobal, eax), instr); | 1407 return MarkAsCall(DefineFixed(new LCallGlobal, eax), instr); |
| 1407 } | 1408 } |
| 1408 | 1409 |
| 1409 | 1410 |
| 1410 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) { | 1411 LInstruction* LChunkBuilder::DoCallKnownGlobal(HCallKnownGlobal* instr) { |
| 1411 argument_count_ -= instr->argument_count(); | 1412 LOperand* receiver = UseFixed(instr->receiver(), eax); |
| 1412 return MarkAsCall(DefineFixed(new LCallKnownGlobal, eax), instr); | 1413 DecrementArgumentCount(instr->argument_count()); |
| 1414 return MarkAsCall(DefineFixed(new LCallKnownGlobal(receiver), eax), instr); |
| 1413 } | 1415 } |
| 1414 | 1416 |
| 1415 | 1417 |
| 1416 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { | 1418 LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) { |
| 1417 LOperand* constructor = UseFixed(instr->constructor(), edi); | 1419 LOperand* constructor = UseFixed(instr->constructor(), edi); |
| 1418 argument_count_ -= instr->argument_count(); | 1420 DecrementArgumentCount(instr->argument_count()); |
| 1419 LInstruction* result = new LCallNew(constructor); | 1421 LInstruction* result = new LCallNew(constructor); |
| 1420 return MarkAsCall(DefineFixed(result, eax), instr); | 1422 return MarkAsCall(DefineFixed(result, eax), instr); |
| 1421 } | 1423 } |
| 1422 | 1424 |
| 1423 | 1425 |
| 1424 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { | 1426 LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
| 1425 argument_count_ -= instr->argument_count(); | 1427 DecrementArgumentCount(instr->argument_count()); |
| 1426 return MarkAsCall(DefineFixed(new LCallFunction, eax), instr); | 1428 return MarkAsCall(DefineFixed(new LCallFunction, eax), instr); |
| 1427 } | 1429 } |
| 1428 | 1430 |
| 1429 | 1431 |
| 1430 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { | 1432 LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
| 1431 argument_count_ -= instr->argument_count(); | 1433 DecrementArgumentCount(instr->argument_count()); |
| 1432 return MarkAsCall(DefineFixed(new LCallRuntime, eax), instr); | 1434 return MarkAsCall(DefineFixed(new LCallRuntime, eax), instr); |
| 1433 } | 1435 } |
| 1434 | 1436 |
| 1435 | 1437 |
| 1436 LInstruction* LChunkBuilder::DoShr(HShr* instr) { | 1438 LInstruction* LChunkBuilder::DoShr(HShr* instr) { |
| 1437 return DoShift(Token::SHR, instr); | 1439 return DoShift(Token::SHR, instr); |
| 1438 } | 1440 } |
| 1439 | 1441 |
| 1440 | 1442 |
| 1441 LInstruction* LChunkBuilder::DoSar(HSar* instr) { | 1443 LInstruction* LChunkBuilder::DoSar(HSar* instr) { |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 } | 2008 } |
| 2007 | 2009 |
| 2008 | 2010 |
| 2009 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { | 2011 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { |
| 2010 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. | 2012 int spill_index = chunk()->GetNextSpillIndex(false); // Not double-width. |
| 2011 return DefineAsSpilled(new LUnknownOSRValue, spill_index); | 2013 return DefineAsSpilled(new LUnknownOSRValue, spill_index); |
| 2012 } | 2014 } |
| 2013 | 2015 |
| 2014 | 2016 |
| 2015 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2017 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
| 2016 argument_count_ -= instr->argument_count(); | 2018 DecrementArgumentCount(instr->argument_count()); |
| 2017 return MarkAsCall(DefineFixed(new LCallStub, eax), instr); | 2019 return MarkAsCall(DefineFixed(new LCallStub, eax), instr); |
| 2018 } | 2020 } |
| 2019 | 2021 |
| 2020 | 2022 |
| 2021 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { | 2023 LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) { |
| 2022 // There are no real uses of the arguments object (we bail out in all other | 2024 // There are no real uses of the arguments object (we bail out in all other |
| 2023 // cases). | 2025 // cases). |
| 2024 return NULL; | 2026 return NULL; |
| 2025 } | 2027 } |
| 2026 | 2028 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2087 return MarkAsCall(new LStackCheck, instr); | 2089 return MarkAsCall(new LStackCheck, instr); |
| 2088 } | 2090 } |
| 2089 | 2091 |
| 2090 | 2092 |
| 2091 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2093 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
| 2092 HEnvironment* outer = current_block_->last_environment(); | 2094 HEnvironment* outer = current_block_->last_environment(); |
| 2093 HConstant* undefined = graph()->GetConstantUndefined(); | 2095 HConstant* undefined = graph()->GetConstantUndefined(); |
| 2094 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2096 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
| 2095 instr->function(), | 2097 instr->function(), |
| 2096 false, | 2098 false, |
| 2097 undefined); | 2099 undefined, |
| 2100 NULL); |
| 2098 current_block_->UpdateEnvironment(inner); | 2101 current_block_->UpdateEnvironment(inner); |
| 2099 chunk_->AddInlinedClosure(instr->closure()); | 2102 chunk_->AddInlinedClosure(instr->closure()); |
| 2100 return NULL; | 2103 return NULL; |
| 2101 } | 2104 } |
| 2102 | 2105 |
| 2103 | 2106 |
| 2104 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2107 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 2105 HEnvironment* outer = current_block_->last_environment()->outer(); | 2108 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 2106 current_block_->UpdateEnvironment(outer); | 2109 current_block_->UpdateEnvironment(outer); |
| 2107 return NULL; | 2110 return NULL; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2119 void LPointerMap::PrintTo(StringStream* stream) const { | 2122 void LPointerMap::PrintTo(StringStream* stream) const { |
| 2120 stream->Add("{"); | 2123 stream->Add("{"); |
| 2121 for (int i = 0; i < pointer_operands_.length(); ++i) { | 2124 for (int i = 0; i < pointer_operands_.length(); ++i) { |
| 2122 if (i != 0) stream->Add(";"); | 2125 if (i != 0) stream->Add(";"); |
| 2123 pointer_operands_[i]->PrintTo(stream); | 2126 pointer_operands_[i]->PrintTo(stream); |
| 2124 } | 2127 } |
| 2125 stream->Add("} @%d", position()); | 2128 stream->Add("} @%d", position()); |
| 2126 } | 2129 } |
| 2127 | 2130 |
| 2128 } } // namespace v8::internal | 2131 } } // namespace v8::internal |
| OLD | NEW |