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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/bootstrapper.cc ('k') | src/d8.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 v8::Extension* extension, 103 v8::Extension* extension,
104 ScriptDataImpl* pre_data) { 104 ScriptDataImpl* pre_data) {
105 CompilationZoneScope zone_scope(DELETE_ON_EXIT); 105 CompilationZoneScope zone_scope(DELETE_ON_EXIT);
106 106
107 // Make sure we have an initial stack limit. 107 // Make sure we have an initial stack limit.
108 StackGuard guard; 108 StackGuard guard;
109 PostponeInterruptsScope postpone; 109 PostponeInterruptsScope postpone;
110 110
111 ASSERT(!i::Top::global_context().is_null()); 111 ASSERT(!i::Top::global_context().is_null());
112 script->set_context_data((*i::Top::global_context())->data()); 112 script->set_context_data((*i::Top::global_context())->data());
113
113 #ifdef ENABLE_DEBUGGER_SUPPORT 114 #ifdef ENABLE_DEBUGGER_SUPPORT
115 if (is_eval || is_json) {
116 script->set_compilation_type(
117 is_json ? Smi::FromInt(Script::COMPILATION_TYPE_JSON) :
118 Smi::FromInt(Script::COMPILATION_TYPE_EVAL));
119 // For eval scripts add information on the function from which eval was
120 // called.
121 if (is_eval) {
122 JavaScriptFrameIterator it;
123 script->set_eval_from_function(it.frame()->function());
124 int offset = it.frame()->pc() - it.frame()->code()->instruction_start();
125 script->set_eval_from_instructions_offset(Smi::FromInt(offset));
126 }
127 }
128
114 // Notify debugger 129 // Notify debugger
115 Debugger::OnBeforeCompile(script); 130 Debugger::OnBeforeCompile(script);
116 #endif 131 #endif
117 132
118 // Only allow non-global compiles for eval. 133 // Only allow non-global compiles for eval.
119 ASSERT(is_eval || is_global); 134 ASSERT(is_eval || is_global);
120 135
121 // Build AST. 136 // Build AST.
122 FunctionLiteral* lit = MakeAST(is_global, script, extension, pre_data); 137 FunctionLiteral* lit = MakeAST(is_global, script, extension, pre_data);
123 138
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // Set the expected number of properties for instances. 400 // Set the expected number of properties for instances.
386 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); 401 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
387 402
388 // Check the function has compiled code. 403 // Check the function has compiled code.
389 ASSERT(shared->is_compiled()); 404 ASSERT(shared->is_compiled());
390 return true; 405 return true;
391 } 406 }
392 407
393 408
394 } } // namespace v8::internal 409 } } // namespace v8::internal
OLDNEW
« 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