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

Side by Side Diff: src/compiler.cc

Issue 314603004: Parser: Delay internalizing strings and values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 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/compiler.h ('k') | src/func-name-inferrer.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 20 matching lines...) Expand all
31 namespace internal { 31 namespace internal {
32 32
33 33
34 CompilationInfo::CompilationInfo(Handle<Script> script, 34 CompilationInfo::CompilationInfo(Handle<Script> script,
35 Zone* zone) 35 Zone* zone)
36 : flags_(StrictModeField::encode(SLOPPY)), 36 : flags_(StrictModeField::encode(SLOPPY)),
37 script_(script), 37 script_(script),
38 osr_ast_id_(BailoutId::None()), 38 osr_ast_id_(BailoutId::None()),
39 parameter_count_(0), 39 parameter_count_(0),
40 this_has_uses_(true), 40 this_has_uses_(true),
41 optimization_id_(-1) { 41 optimization_id_(-1),
42 ast_value_factory_(NULL) {
42 Initialize(script->GetIsolate(), BASE, zone); 43 Initialize(script->GetIsolate(), BASE, zone);
43 } 44 }
44 45
45 46
46 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, 47 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info,
47 Zone* zone) 48 Zone* zone)
48 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), 49 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)),
49 shared_info_(shared_info), 50 shared_info_(shared_info),
50 script_(Handle<Script>(Script::cast(shared_info->script()))), 51 script_(Handle<Script>(Script::cast(shared_info->script()))),
51 osr_ast_id_(BailoutId::None()), 52 osr_ast_id_(BailoutId::None()),
52 parameter_count_(0), 53 parameter_count_(0),
53 this_has_uses_(true), 54 this_has_uses_(true),
54 optimization_id_(-1) { 55 optimization_id_(-1),
56 ast_value_factory_(NULL) {
55 Initialize(script_->GetIsolate(), BASE, zone); 57 Initialize(script_->GetIsolate(), BASE, zone);
56 } 58 }
57 59
58 60
59 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, 61 CompilationInfo::CompilationInfo(Handle<JSFunction> closure,
60 Zone* zone) 62 Zone* zone)
61 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), 63 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)),
62 closure_(closure), 64 closure_(closure),
63 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), 65 shared_info_(Handle<SharedFunctionInfo>(closure->shared())),
64 script_(Handle<Script>(Script::cast(shared_info_->script()))), 66 script_(Handle<Script>(Script::cast(shared_info_->script()))),
65 context_(closure->context()), 67 context_(closure->context()),
66 osr_ast_id_(BailoutId::None()), 68 osr_ast_id_(BailoutId::None()),
67 parameter_count_(0), 69 parameter_count_(0),
68 this_has_uses_(true), 70 this_has_uses_(true),
69 optimization_id_(-1) { 71 optimization_id_(-1),
72 ast_value_factory_(NULL) {
70 Initialize(script_->GetIsolate(), BASE, zone); 73 Initialize(script_->GetIsolate(), BASE, zone);
71 } 74 }
72 75
73 76
74 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, 77 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub,
75 Isolate* isolate, 78 Isolate* isolate,
76 Zone* zone) 79 Zone* zone)
77 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), 80 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)),
78 osr_ast_id_(BailoutId::None()), 81 osr_ast_id_(BailoutId::None()),
79 parameter_count_(0), 82 parameter_count_(0),
80 this_has_uses_(true), 83 this_has_uses_(true),
81 optimization_id_(-1) { 84 optimization_id_(-1),
85 ast_value_factory_(NULL) {
82 Initialize(isolate, STUB, zone); 86 Initialize(isolate, STUB, zone);
83 code_stub_ = stub; 87 code_stub_ = stub;
84 } 88 }
85 89
86 90
87 void CompilationInfo::Initialize(Isolate* isolate, 91 void CompilationInfo::Initialize(Isolate* isolate,
88 Mode mode, 92 Mode mode,
89 Zone* zone) { 93 Zone* zone) {
90 isolate_ = isolate; 94 isolate_ = isolate;
91 function_ = NULL; 95 function_ = NULL;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // passed in shared info, rather than creating a new one. 128 // passed in shared info, rather than creating a new one.
125 feedback_vector_ = Handle<FixedArray>(shared_info()->feedback_vector(), 129 feedback_vector_ = Handle<FixedArray>(shared_info()->feedback_vector(),
126 isolate); 130 isolate);
127 } 131 }
128 } 132 }
129 133
130 134
131 CompilationInfo::~CompilationInfo() { 135 CompilationInfo::~CompilationInfo() {
132 delete deferred_handles_; 136 delete deferred_handles_;
133 delete no_frame_ranges_; 137 delete no_frame_ranges_;
138 delete ast_value_factory_;
134 #ifdef DEBUG 139 #ifdef DEBUG
135 // Check that no dependent maps have been added or added dependent maps have 140 // Check that no dependent maps have been added or added dependent maps have
136 // been rolled back or committed. 141 // been rolled back or committed.
137 for (int i = 0; i < DependentCode::kGroupCount; i++) { 142 for (int i = 0; i < DependentCode::kGroupCount; i++) {
138 ASSERT_EQ(NULL, dependencies_[i]); 143 ASSERT_EQ(NULL, dependencies_[i]);
139 } 144 }
140 #endif // DEBUG 145 #endif // DEBUG
141 } 146 }
142 147
143 148
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 AllowHandleDereference allow_deref; 1301 AllowHandleDereference allow_deref;
1297 bool tracing_on = info()->IsStub() 1302 bool tracing_on = info()->IsStub()
1298 ? FLAG_trace_hydrogen_stubs 1303 ? FLAG_trace_hydrogen_stubs
1299 : (FLAG_trace_hydrogen && 1304 : (FLAG_trace_hydrogen &&
1300 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); 1305 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1301 return (tracing_on && 1306 return (tracing_on &&
1302 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1307 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1303 } 1308 }
1304 1309
1305 } } // namespace v8::internal 1310 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/func-name-inferrer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698