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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 void UnaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { | 297 void UnaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { |
298 // TODO(olivf) If this Operation is used in a test context, then the | 298 // TODO(olivf) If this Operation is used in a test context, then the |
299 // expression has a ToBoolean stub and we want to collect the type | 299 // expression has a ToBoolean stub and we want to collect the type |
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() { | |
308 switch (op_) { | |
309 case Token::BIT_NOT: | |
310 return true; | |
311 default: | |
312 return false; | |
313 } | |
314 } | |
315 | |
316 | |
317 void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { | 307 void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { |
318 // TODO(olivf) If this Operation is used in a test context, then the right | 308 // TODO(olivf) If this Operation is used in a test context, then the right |
319 // hand side has a ToBoolean stub and we want to collect the type information. | 309 // hand side has a ToBoolean stub and we want to collect the type information. |
320 // However the GraphBuilder expects it to be on the instruction corresponding | 310 // However the GraphBuilder expects it to be on the instruction corresponding |
321 // to the TestContext, therefore we have to store it here and not on the | 311 // to the TestContext, therefore we have to store it here and not on the |
322 // right hand operand. | 312 // right hand operand. |
323 set_to_boolean_types(oracle->ToBooleanTypes(right()->test_id())); | 313 set_to_boolean_types(oracle->ToBooleanTypes(right()->test_id())); |
324 } | 314 } |
325 | 315 |
326 | 316 |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); | 1189 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); |
1200 str = arr; | 1190 str = arr; |
1201 } else { | 1191 } else { |
1202 str = DoubleToCString(value_->Number(), buffer); | 1192 str = DoubleToCString(value_->Number(), buffer); |
1203 } | 1193 } |
1204 return factory->NewStringFromAscii(CStrVector(str)); | 1194 return factory->NewStringFromAscii(CStrVector(str)); |
1205 } | 1195 } |
1206 | 1196 |
1207 | 1197 |
1208 } } // namespace v8::internal | 1198 } } // namespace v8::internal |
OLD | NEW |