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

Side by Side Diff: src/compiler.cc

Issue 111001: Added context information to scripts (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 Handle<Script> script, 97 Handle<Script> script,
98 Handle<Context> context, 98 Handle<Context> context,
99 v8::Extension* extension, 99 v8::Extension* extension,
100 ScriptDataImpl* pre_data) { 100 ScriptDataImpl* pre_data) {
101 ZoneScope zone_scope(DELETE_ON_EXIT); 101 ZoneScope zone_scope(DELETE_ON_EXIT);
102 102
103 // Make sure we have an initial stack limit. 103 // Make sure we have an initial stack limit.
104 StackGuard guard; 104 StackGuard guard;
105 PostponeInterruptsScope postpone; 105 PostponeInterruptsScope postpone;
106 106
107 ASSERT(!i::Top::global_context().is_null());
108 script->set_context_data((*i::Top::global_context())->data());
107 #ifdef ENABLE_DEBUGGER_SUPPORT 109 #ifdef ENABLE_DEBUGGER_SUPPORT
108 // Notify debugger 110 // Notify debugger
109 Debugger::OnBeforeCompile(script); 111 Debugger::OnBeforeCompile(script);
110 #endif 112 #endif
111 113
112 // Only allow non-global compiles for eval. 114 // Only allow non-global compiles for eval.
113 ASSERT(is_eval || is_global); 115 ASSERT(is_eval || is_global);
114 116
115 // Build AST. 117 // Build AST.
116 FunctionLiteral* lit = MakeAST(is_global, script, extension, pre_data); 118 FunctionLiteral* lit = MakeAST(is_global, script, extension, pre_data);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // Set the expected number of properties for instances. 383 // Set the expected number of properties for instances.
382 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); 384 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
383 385
384 // Check the function has compiled code. 386 // Check the function has compiled code.
385 ASSERT(shared->is_compiled()); 387 ASSERT(shared->is_compiled());
386 return true; 388 return true;
387 } 389 }
388 390
389 391
390 } } // namespace v8::internal 392 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/debug-delay.js » ('j') | src/mirror-delay.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698