Revision: 4366
Author: [email protected]
Date: Thu Apr  8 11:07:46 2010
Log: Revert r4358.

[email protected]

Review URL: http://codereview.chromium.org/1549029
http://code.google.com/p/v8/source/detail?r=4366

Modified:
 /branches/bleeding_edge/src/liveedit.cc

=======================================
--- /branches/bleeding_edge/src/liveedit.cc     Thu Apr  8 05:37:10 2010
+++ /branches/bleeding_edge/src/liveedit.cc     Thu Apr  8 11:07:46 2010
@@ -445,13 +445,6 @@

   visitor.Replace(substitution);
 }
-
-
-// Check whether the code is natural function code (not a lazy-compile stub
-// code).
-static bool IsJSFunctionCode(Code* code) {
-  return code->kind() == Code::FUNCTION;
-}


 void LiveEdit::ReplaceFunctionCode(Handle<JSArray> new_compile_info_array,
@@ -463,30 +456,15 @@

   Handle<SharedFunctionInfo> shared_info = shared_info_wrapper.GetInfo();

-
-  if (IsJSFunctionCode(shared_info->code())) {
-    ReplaceCodeObject(shared_info->code(),
-                      *(compile_info_wrapper.GetFunctionCode()));
-  }
-
-  if (shared_info->debug_info()->IsDebugInfo()) {
- Handle<DebugInfo> debug_info(DebugInfo::cast(shared_info->debug_info()));
-    Handle<Code> new_original_code =
-        Factory::CopyCode(compile_info_wrapper.GetFunctionCode());
-    debug_info->set_original_code(*new_original_code);
-  }
+  ReplaceCodeObject(shared_info->code(),
+                       *(compile_info_wrapper.GetFunctionCode()));

   shared_info->set_start_position(compile_info_wrapper.GetStartPosition());
   shared_info->set_end_position(compile_info_wrapper.GetEndPosition());
-
-  shared_info->set_construct_stub(
-      Builtins::builtin(Builtins::JSConstructStubGeneric));
-  // update breakpoints
+  // update breakpoints, original code, constructor stub
 }


-// TODO(635): Eval caches its scripts (same text -- same compiled info).
-// Make sure we clear such caches.
 void LiveEdit::RelinkFunctionToScript(Handle<JSArray> shared_info_array,
                                       Handle<Script> script_handle) {
   SharedInfoWrapper shared_info_wrapper(shared_info_array);
@@ -673,18 +651,15 @@
       TranslatePosition(info->function_token_position(),
       position_change_array));

-  if (IsJSFunctionCode(info->code())) {
-    // Patch relocation info section of the code.
- Handle<Code> patched_code = PatchPositionsInCode(Handle<Code>(info->code()), - position_change_array);
-    if (*patched_code != info->code()) {
-      // Replace all references to the code across the heap. In particular,
- // some stubs may refer to this code and this code may be being executed - // on stack (it is safe to substitute the code object on stack, because
-      // we only change the structure of rinfo and leave instructions
-      // untouched).
-      ReplaceCodeObject(info->code(), *patched_code);
-    }
+  // Patch relocation info section of the code.
+ Handle<Code> patched_code = PatchPositionsInCode(Handle<Code>(info->code()),
+                                                   position_change_array);
+  if (*patched_code != info->code()) {
+    // Replace all references to the code across the heap. In particular,
+ // some stubs may refer to this code and this code may be being executed
+    // on stack (it is safe to substitute the code object on stack, because
+ // we only change the structure of rinfo and leave instructions untouched).
+    ReplaceCodeObject(info->code(), *patched_code);
   }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

To unsubscribe, reply using "remove me" as the subject.

Reply via email to