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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 // TODO(635): support extensions. | 401 // TODO(635): support extensions. |
402 Extension* extension = NULL; | 402 Extension* extension = NULL; |
403 | 403 |
404 PostponeInterruptsScope postpone; | 404 PostponeInterruptsScope postpone; |
405 | 405 |
406 // Only allow non-global compiles for eval. | 406 // Only allow non-global compiles for eval. |
407 ASSERT(is_eval || is_global); | 407 ASSERT(is_eval || is_global); |
408 | 408 |
409 // Build AST. | 409 // Build AST. |
410 ScriptDataImpl* pre_data = NULL; | 410 ScriptDataImpl* pre_data = NULL; |
| 411 EagerCompilationInfo info(script, is_eval); |
411 FunctionLiteral* lit = MakeAST(is_global, script, extension, pre_data); | 412 FunctionLiteral* lit = MakeAST(is_global, script, extension, pre_data); |
412 | 413 |
413 // Check for parse errors. | 414 // Check for parse errors. |
414 if (lit == NULL) { | 415 if (lit == NULL) { |
415 ASSERT(Top::has_pending_exception()); | 416 ASSERT(Top::has_pending_exception()); |
416 return; | 417 return; |
417 } | 418 } |
| 419 info.set_function(lit); |
418 | 420 |
419 // Compile the code. | 421 // Compile the code. |
420 CompilationInfo info(lit, script, is_eval); | |
421 | |
422 LiveEditFunctionTracker tracker(lit); | 422 LiveEditFunctionTracker tracker(lit); |
423 Handle<Code> code = MakeCodeForLiveEdit(&info); | 423 Handle<Code> code = MakeCodeForLiveEdit(&info); |
424 | 424 |
425 // Check for stack-overflow exceptions. | 425 // Check for stack-overflow exceptions. |
426 if (code.is_null()) { | 426 if (code.is_null()) { |
427 Top::StackOverflow(); | 427 Top::StackOverflow(); |
428 return; | 428 return; |
429 } | 429 } |
430 tracker.RecordRootFunctionInfo(code); | 430 tracker.RecordRootFunctionInfo(code); |
431 } | 431 } |
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1476 | 1476 |
1477 bool LiveEditFunctionTracker::IsActive() { | 1477 bool LiveEditFunctionTracker::IsActive() { |
1478 return false; | 1478 return false; |
1479 } | 1479 } |
1480 | 1480 |
1481 #endif // ENABLE_DEBUGGER_SUPPORT | 1481 #endif // ENABLE_DEBUGGER_SUPPORT |
1482 | 1482 |
1483 | 1483 |
1484 | 1484 |
1485 } } // namespace v8::internal | 1485 } } // namespace v8::internal |
OLD | NEW |