Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: src/compiler.cc

Issue 119108: Add more debugging information to scripts compiled through eval (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
===================================================================
--- src/compiler.cc (revision 2090)
+++ src/compiler.cc (working copy)
@@ -110,7 +110,22 @@
ASSERT(!i::Top::global_context().is_null());
script->set_context_data((*i::Top::global_context())->data());
+
#ifdef ENABLE_DEBUGGER_SUPPORT
+ if (is_eval || is_json) {
+ script->set_compilation_type(
+ is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) :
+ Smi::FromInt(Script::COMPILATION_TYPE_EVAL));
+ // For eval scripts add information on the function from which eval was
+ // called.
+ if (is_eval) {
+ JavaScriptFrameIterator it;
+ script->set_eval_from_function(it.frame()->function());
+ int offset = it.frame()->pc() - it.frame()->code()->instruction_start();
+ script->set_eval_from_instructions_offset(Smi::FromInt(offset));
+ }
+ }
+
// Notify debugger
Debugger::OnBeforeCompile(script);
#endif
« no previous file with comments | « src/bootstrapper.cc ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698