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

Unified Diff: src/compiler.cc

Issue 2918001: Move serialized scope info from Code object to SharedFunctionInfo. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 5 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/codegen.cc ('k') | src/contexts.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 5039)
+++ src/compiler.cc (working copy)
@@ -40,6 +40,7 @@
#include "oprofile-agent.h"
#include "rewriter.h"
#include "scopes.h"
+#include "scopeinfo.h"
namespace v8 {
namespace internal {
@@ -156,7 +157,12 @@
#ifdef ENABLE_DEBUGGER_SUPPORT
Handle<Code> MakeCodeForLiveEdit(CompilationInfo* info) {
Handle<Context> context = Handle<Context>::null();
- return MakeCode(context, info);
+ Handle<Code> code = MakeCode(context, info);
+ if (!info->shared_info().is_null()) {
+ info->shared_info()->set_scope_info(
+ *ScopeInfo<>::CreateHeapObject(info->scope()));
+ }
+ return code;
}
#endif
@@ -252,9 +258,11 @@
// Allocate function.
Handle<SharedFunctionInfo> result =
- Factory::NewSharedFunctionInfo(lit->name(),
- lit->materialized_literal_count(),
- code);
+ Factory::NewSharedFunctionInfo(
+ lit->name(),
+ lit->materialized_literal_count(),
+ code,
+ ScopeInfo<>::CreateHeapObject(info.scope()));
ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position());
Compiler::SetFunctionInfo(result, lit, true, script);
@@ -445,8 +453,9 @@
info->script(),
code);
- // Update the shared function info with the compiled code.
+ // Update the shared function info with the compiled code and the scope info.
shared->set_code(*code);
+ shared->set_scope_info(*ScopeInfo<>::CreateHeapObject(info->scope()));
// Set the expected number of properties for instances.
SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
@@ -481,6 +490,8 @@
bool allow_lazy = literal->AllowsLazyCompilation() &&
!LiveEditFunctionTracker::IsActive();
+ Handle<Object> scope_info(ScopeInfo<>::EmptyHeapObject());
+
// Generate code
Handle<Code> code;
if (FLAG_lazy && allow_lazy) {
@@ -562,13 +573,15 @@
literal->start_position(),
script,
code);
+ scope_info = ScopeInfo<>::CreateHeapObject(info.scope());
}
// Create a shared function info object.
Handle<SharedFunctionInfo> result =
Factory::NewSharedFunctionInfo(literal->name(),
literal->materialized_literal_count(),
- code);
+ code,
+ scope_info);
SetFunctionInfo(result, literal, false, script);
// Set the expected number of properties for instances and return
« no previous file with comments | « src/codegen.cc ('k') | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698