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

Side by Side Diff: src/compiler.cc

Issue 17573003: Add phase zone to CompilationInfo and use it in GVN pass. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Created 7 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
« no previous file with comments | « src/compiler.h ('k') | src/hydrogen.cc » ('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 // 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "runtime-profiler.h" 46 #include "runtime-profiler.h"
47 #include "scanner-character-streams.h" 47 #include "scanner-character-streams.h"
48 #include "scopeinfo.h" 48 #include "scopeinfo.h"
49 #include "scopes.h" 49 #include "scopes.h"
50 #include "vm-state-inl.h" 50 #include "vm-state-inl.h"
51 51
52 namespace v8 { 52 namespace v8 {
53 namespace internal { 53 namespace internal {
54 54
55 55
56 CompilationInfo::CompilationInfo(Handle<Script> script, Zone* zone) 56 CompilationInfo::CompilationInfo(Handle<Script> script,
57 Zone* zone,
58 Zone* phase_zone)
57 : flags_(LanguageModeField::encode(CLASSIC_MODE)), 59 : flags_(LanguageModeField::encode(CLASSIC_MODE)),
58 script_(script), 60 script_(script),
59 osr_ast_id_(BailoutId::None()) { 61 osr_ast_id_(BailoutId::None()) {
60 Initialize(script->GetIsolate(), BASE, zone); 62 Initialize(script->GetIsolate(), BASE, zone, phase_zone);
61 } 63 }
62 64
63 65
64 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, 66 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info,
65 Zone* zone) 67 Zone* zone,
68 Zone* phase_zone)
66 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)), 69 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)),
67 shared_info_(shared_info), 70 shared_info_(shared_info),
68 script_(Handle<Script>(Script::cast(shared_info->script()))), 71 script_(Handle<Script>(Script::cast(shared_info->script()))),
69 osr_ast_id_(BailoutId::None()) { 72 osr_ast_id_(BailoutId::None()) {
70 Initialize(script_->GetIsolate(), BASE, zone); 73 Initialize(script_->GetIsolate(), BASE, zone, phase_zone);
71 } 74 }
72 75
73 76
74 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone) 77 CompilationInfo::CompilationInfo(Handle<JSFunction> closure,
78 Zone* zone,
79 Zone* phase_zone)
75 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)), 80 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)),
76 closure_(closure), 81 closure_(closure),
77 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), 82 shared_info_(Handle<SharedFunctionInfo>(closure->shared())),
78 script_(Handle<Script>(Script::cast(shared_info_->script()))), 83 script_(Handle<Script>(Script::cast(shared_info_->script()))),
79 context_(closure->context()), 84 context_(closure->context()),
80 osr_ast_id_(BailoutId::None()) { 85 osr_ast_id_(BailoutId::None()) {
81 Initialize(script_->GetIsolate(), BASE, zone); 86 Initialize(script_->GetIsolate(), BASE, zone, phase_zone);
82 } 87 }
83 88
84 89
85 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, 90 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub,
86 Isolate* isolate, Zone* zone) 91 Isolate* isolate,
92 Zone* zone,
93 Zone* phase_zone)
87 : flags_(LanguageModeField::encode(CLASSIC_MODE) | 94 : flags_(LanguageModeField::encode(CLASSIC_MODE) |
88 IsLazy::encode(true)), 95 IsLazy::encode(true)),
89 osr_ast_id_(BailoutId::None()) { 96 osr_ast_id_(BailoutId::None()) {
90 Initialize(isolate, STUB, zone); 97 Initialize(isolate, STUB, zone, phase_zone);
91 code_stub_ = stub; 98 code_stub_ = stub;
92 } 99 }
93 100
94 101
95 void CompilationInfo::Initialize(Isolate* isolate, Mode mode, Zone* zone) { 102 void CompilationInfo::Initialize(Isolate* isolate,
103 Mode mode,
104 Zone* zone,
105 Zone* phase_zone) {
96 isolate_ = isolate; 106 isolate_ = isolate;
97 function_ = NULL; 107 function_ = NULL;
98 scope_ = NULL; 108 scope_ = NULL;
99 global_scope_ = NULL; 109 global_scope_ = NULL;
100 extension_ = NULL; 110 extension_ = NULL;
101 pre_parse_data_ = NULL; 111 pre_parse_data_ = NULL;
102 zone_ = zone; 112 zone_ = zone;
113 phase_zone_ = phase_zone;
103 deferred_handles_ = NULL; 114 deferred_handles_ = NULL;
104 code_stub_ = NULL; 115 code_stub_ = NULL;
105 prologue_offset_ = kPrologueOffsetNotSet; 116 prologue_offset_ = kPrologueOffsetNotSet;
106 opt_count_ = shared_info().is_null() ? 0 : shared_info()->opt_count(); 117 opt_count_ = shared_info().is_null() ? 0 : shared_info()->opt_count();
107 no_frame_ranges_ = isolate->cpu_profiler()->is_profiling() 118 no_frame_ranges_ = isolate->cpu_profiler()->is_profiling()
108 ? new List<OffsetRange>(2) : NULL; 119 ? new List<OffsetRange>(2) : NULL;
109 for (int i = 0; i < DependentCode::kGroupCount; i++) { 120 for (int i = 0; i < DependentCode::kGroupCount; i++) {
110 dependent_maps_[i] = NULL; 121 dependent_maps_[i] = NULL;
111 } 122 }
112 if (mode == STUB) { 123 if (mode == STUB) {
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 } 1211 }
1201 } 1212 }
1202 1213
1203 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 1214 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
1204 Handle<Script>(info->script()), 1215 Handle<Script>(info->script()),
1205 Handle<Code>(info->code()), 1216 Handle<Code>(info->code()),
1206 info)); 1217 info));
1207 } 1218 }
1208 1219
1209 } } // namespace v8::internal 1220 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698