| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 context); | 199 context); |
| 200 | 200 |
| 201 bool pending_exceptions; | 201 bool pending_exceptions; |
| 202 Handle<Object> result = | 202 Handle<Object> result = |
| 203 Execution::Call(test_function, | 203 Execution::Call(test_function, |
| 204 Handle<Object>::cast(test_function), | 204 Handle<Object>::cast(test_function), |
| 205 0, | 205 0, |
| 206 NULL, | 206 NULL, |
| 207 &pending_exceptions); | 207 &pending_exceptions); |
| 208 // Function compiles and runs, but returns a JSFunction object. | 208 // Function compiles and runs, but returns a JSFunction object. |
| 209 CHECK(result->IsSmi()); | 209 #ifdef DEBUG |
| 210 CHECK_EQ(47, Smi::cast(*result)->value()); | 210 PrintF("Result of test function: "); |
| 211 result->Print(); |
| 212 #endif |
| 211 } | 213 } |
| 212 | 214 |
| 213 | 215 |
| 214 void CodeGenerator::GenCode(FunctionLiteral* function) { | 216 void CodeGenerator::GenCode(FunctionLiteral* function) { |
| 215 // Record the position for debugging purposes. | 217 // Record the position for debugging purposes. |
| 216 CodeForFunctionPosition(function); | 218 CodeForFunctionPosition(function); |
| 217 ZoneList<Statement*>* body = function->body(); | 219 ZoneList<Statement*>* body = function->body(); |
| 218 | 220 |
| 219 // Initialize state. | 221 // Initialize state. |
| 220 ASSERT(scope_ == NULL); | 222 ASSERT(scope_ == NULL); |
| (...skipping 4195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4416 break; | 4418 break; |
| 4417 default: | 4419 default: |
| 4418 UNREACHABLE(); | 4420 UNREACHABLE(); |
| 4419 } | 4421 } |
| 4420 } | 4422 } |
| 4421 | 4423 |
| 4422 | 4424 |
| 4423 #undef __ | 4425 #undef __ |
| 4424 | 4426 |
| 4425 } } // namespace v8::internal | 4427 } } // namespace v8::internal |
| OLD | NEW |