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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // information. However the GraphBuilder expects it to be on the instruction | 300 // information. However the GraphBuilder expects it to be on the instruction |
301 // corresponding to the TestContext, therefore we have to store it here and | 301 // corresponding to the TestContext, therefore we have to store it here and |
302 // not on the operand. | 302 // not on the operand. |
303 set_to_boolean_types(oracle->ToBooleanTypes(expression()->test_id())); | 303 set_to_boolean_types(oracle->ToBooleanTypes(expression()->test_id())); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 bool UnaryOperation::ResultOverwriteAllowed() { | 307 bool UnaryOperation::ResultOverwriteAllowed() { |
308 switch (op_) { | 308 switch (op_) { |
309 case Token::BIT_NOT: | 309 case Token::BIT_NOT: |
310 case Token::SUB: | |
311 return true; | 310 return true; |
312 default: | 311 default: |
313 return false; | 312 return false; |
314 } | 313 } |
315 } | 314 } |
316 | 315 |
317 | 316 |
318 void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { | 317 void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { |
319 // TODO(olivf) If this Operation is used in a test context, then the right | 318 // TODO(olivf) If this Operation is used in a test context, then the right |
320 // hand side has a ToBoolean stub and we want to collect the type information. | 319 // hand side has a ToBoolean stub and we want to collect the type information. |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); | 1199 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); |
1201 str = arr; | 1200 str = arr; |
1202 } else { | 1201 } else { |
1203 str = DoubleToCString(value_->Number(), buffer); | 1202 str = DoubleToCString(value_->Number(), buffer); |
1204 } | 1203 } |
1205 return factory->NewStringFromAscii(CStrVector(str)); | 1204 return factory->NewStringFromAscii(CStrVector(str)); |
1206 } | 1205 } |
1207 | 1206 |
1208 | 1207 |
1209 } } // namespace v8::internal | 1208 } } // namespace v8::internal |
OLD | NEW |