Version 2.1.8
Added fine-grained garbage collection callbacks to the API.
Performance improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@4238 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/debug.cc b/src/debug.cc
index 2a7a9c8..e5d42b9 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -685,29 +685,26 @@
// Compile the script.
bool allow_natives_syntax = FLAG_allow_natives_syntax;
FLAG_allow_natives_syntax = true;
- Handle<JSFunction> boilerplate;
- boilerplate = Compiler::Compile(source_code,
- script_name,
- 0,
- 0,
- NULL,
- NULL,
- Handle<String>::null(),
- NATIVES_CODE);
+ Handle<SharedFunctionInfo> function_info;
+ function_info = Compiler::Compile(source_code,
+ script_name,
+ 0, 0, NULL, NULL,
+ Handle<String>::null(),
+ NATIVES_CODE);
FLAG_allow_natives_syntax = allow_natives_syntax;
// Silently ignore stack overflows during compilation.
- if (boilerplate.is_null()) {
+ if (function_info.is_null()) {
ASSERT(Top::has_pending_exception());
Top::clear_pending_exception();
return false;
}
- // Execute the boilerplate function in the debugger context.
+ // Execute the shared function in the debugger context.
Handle<Context> context = Top::global_context();
bool caught_exception = false;
Handle<JSFunction> function =
- Factory::NewFunctionFromBoilerplate(boilerplate, context);
+ Factory::NewFunctionFromSharedFunctionInfo(function_info, context);
Handle<Object> result =
Execution::TryCall(function, Handle<Object>(context->global()),
0, NULL, &caught_exception);
@@ -1685,7 +1682,7 @@
// Perform two GCs to get rid of all unreferenced scripts. The first GC gets
// rid of all the cached script wrappers and the second gets rid of the
- // scripts which is no longer referenced.
+ // scripts which are no longer referenced.
Heap::CollectAllGarbage(false);
Heap::CollectAllGarbage(false);
@@ -1999,7 +1996,7 @@
// If debugging there might be script break points registered for this
// script. Make sure that these break points are set.
- // Get the function UpdateScriptBreakPoints (defined in debug-delay.js).
+ // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js).
Handle<Object> update_script_break_points =
Handle<Object>(Debug::debug_context()->global()->GetProperty(
*Factory::LookupAsciiSymbol("UpdateScriptBreakPoints")));
@@ -2042,31 +2039,6 @@
}
-void Debugger::OnNewFunction(Handle<JSFunction> function) {
- return;
- HandleScope scope;
-
- // Bail out based on state or if there is no listener for this event
- if (Debug::InDebugger()) return;
- if (compiling_natives()) return;
- if (!Debugger::EventActive(v8::NewFunction)) return;
-
- // Enter the debugger.
- EnterDebugger debugger;
- if (debugger.FailedToEnter()) return;
-
- // Create the event object.
- bool caught_exception = false;
- Handle<Object> event_data = MakeNewFunctionEvent(function, &caught_exception);
- // Bail out and don't call debugger if exception.
- if (caught_exception) {
- return;
- }
- // Process debug event.
- ProcessDebugEvent(v8::NewFunction, Handle<JSObject>::cast(event_data), true);
-}
-
-
void Debugger::OnScriptCollected(int id) {
HandleScope scope;