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

Side by Side Diff: src/compiler.h

Issue 148573005: A64: Synchronize with r16249. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/codegen.cc ('k') | src/compiler.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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 return SupportsDeoptimization::decode(flags_); 228 return SupportsDeoptimization::decode(flags_);
229 } 229 }
230 void EnableDeoptimizationSupport() { 230 void EnableDeoptimizationSupport() {
231 ASSERT(IsOptimizable()); 231 ASSERT(IsOptimizable());
232 flags_ |= SupportsDeoptimization::encode(true); 232 flags_ |= SupportsDeoptimization::encode(true);
233 } 233 }
234 234
235 // Determines whether or not to insert a self-optimization header. 235 // Determines whether or not to insert a self-optimization header.
236 bool ShouldSelfOptimize(); 236 bool ShouldSelfOptimize();
237 237
238 // Disable all optimization attempts of this info for the rest of the 238 // Reset code to the unoptimized version when optimization is aborted.
239 // current compilation pipeline. 239 void AbortOptimization() {
240 void AbortOptimization(); 240 SetCode(handle(shared_info()->code()));
241 }
241 242
242 void set_deferred_handles(DeferredHandles* deferred_handles) { 243 void set_deferred_handles(DeferredHandles* deferred_handles) {
243 ASSERT(deferred_handles_ == NULL); 244 ASSERT(deferred_handles_ == NULL);
244 deferred_handles_ = deferred_handles; 245 deferred_handles_ = deferred_handles;
245 } 246 }
246 247
247 ZoneList<Handle<HeapObject> >* dependencies( 248 ZoneList<Handle<HeapObject> >* dependencies(
248 DependentCode::DependencyGroup group) { 249 DependentCode::DependencyGroup group) {
249 if (dependencies_[group] == NULL) { 250 if (dependencies_[group] == NULL) {
250 dependencies_[group] = new(zone_) ZoneList<Handle<HeapObject> >(2, zone_); 251 dependencies_[group] = new(zone_) ZoneList<Handle<HeapObject> >(2, zone_);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 292
292 Handle<Foreign> object_wrapper() { 293 Handle<Foreign> object_wrapper() {
293 if (object_wrapper_.is_null()) { 294 if (object_wrapper_.is_null()) {
294 object_wrapper_ = 295 object_wrapper_ =
295 isolate()->factory()->NewForeign(reinterpret_cast<Address>(this)); 296 isolate()->factory()->NewForeign(reinterpret_cast<Address>(this));
296 } 297 }
297 return object_wrapper_; 298 return object_wrapper_;
298 } 299 }
299 300
300 void AbortDueToDependencyChange() { 301 void AbortDueToDependencyChange() {
301 mode_ = DEPENDENCY_CHANGE_ABORT; 302 ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread());
303 abort_due_to_dependency_ = true;
302 } 304 }
303 305
304 bool HasAbortedDueToDependencyChange() { 306 bool HasAbortedDueToDependencyChange() {
305 return mode_ == DEPENDENCY_CHANGE_ABORT; 307 ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread());
308 return abort_due_to_dependency_;
306 } 309 }
307 310
308 protected: 311 protected:
309 CompilationInfo(Handle<Script> script, 312 CompilationInfo(Handle<Script> script,
310 Zone* zone); 313 Zone* zone);
311 CompilationInfo(Handle<SharedFunctionInfo> shared_info, 314 CompilationInfo(Handle<SharedFunctionInfo> shared_info,
312 Zone* zone); 315 Zone* zone);
313 CompilationInfo(HydrogenCodeStub* stub, 316 CompilationInfo(HydrogenCodeStub* stub,
314 Isolate* isolate, 317 Isolate* isolate,
315 Zone* zone); 318 Zone* zone);
316 319
317 private: 320 private:
318 Isolate* isolate_; 321 Isolate* isolate_;
319 322
320 // Compilation mode. 323 // Compilation mode.
321 // BASE is generated by the full codegen, optionally prepared for bailouts. 324 // BASE is generated by the full codegen, optionally prepared for bailouts.
322 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. 325 // OPTIMIZE is optimized code generated by the Hydrogen-based backend.
323 // NONOPT is generated by the full codegen and is not prepared for 326 // NONOPT is generated by the full codegen and is not prepared for
324 // recompilation/bailouts. These functions are never recompiled. 327 // recompilation/bailouts. These functions are never recompiled.
325 enum Mode { 328 enum Mode {
326 BASE, 329 BASE,
327 OPTIMIZE, 330 OPTIMIZE,
328 NONOPT, 331 NONOPT,
329 STUB, 332 STUB
330 DEPENDENCY_CHANGE_ABORT
331 }; 333 };
332 334
333 void Initialize(Isolate* isolate, Mode mode, Zone* zone); 335 void Initialize(Isolate* isolate, Mode mode, Zone* zone);
334 336
335 void SetMode(Mode mode) { 337 void SetMode(Mode mode) {
336 ASSERT(V8::UseCrankshaft()); 338 ASSERT(V8::UseCrankshaft());
337 mode_ = mode; 339 mode_ = mode;
338 } 340 }
339 341
340 // Flags using template class BitField<type, start, length>. All are 342 // Flags using template class BitField<type, start, length>. All are
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 ScriptDataImpl* pre_parse_data_; 396 ScriptDataImpl* pre_parse_data_;
395 397
396 // The context of the caller for eval code, and the global context for a 398 // The context of the caller for eval code, and the global context for a
397 // global script. Will be a null handle otherwise. 399 // global script. Will be a null handle otherwise.
398 Handle<Context> context_; 400 Handle<Context> context_;
399 401
400 // Compilation mode flag and whether deoptimization is allowed. 402 // Compilation mode flag and whether deoptimization is allowed.
401 Mode mode_; 403 Mode mode_;
402 BailoutId osr_ast_id_; 404 BailoutId osr_ast_id_;
403 405
406 // Flag whether compilation needs to be aborted due to dependency change.
407 bool abort_due_to_dependency_;
408
404 // The zone from which the compilation pipeline working on this 409 // The zone from which the compilation pipeline working on this
405 // CompilationInfo allocates. 410 // CompilationInfo allocates.
406 Zone* zone_; 411 Zone* zone_;
407 412
408 DeferredHandles* deferred_handles_; 413 DeferredHandles* deferred_handles_;
409 414
410 ZoneList<Handle<HeapObject> >* dependencies_[DependentCode::kGroupCount]; 415 ZoneList<Handle<HeapObject> >* dependencies_[DependentCode::kGroupCount];
411 416
412 template<typename T> 417 template<typename T>
413 void SaveHandle(Handle<T> *object) { 418 void SaveHandle(Handle<T> *object) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 unsigned info_zone_start_allocation_size_; 646 unsigned info_zone_start_allocation_size_;
642 int64_t start_ticks_; 647 int64_t start_ticks_;
643 648
644 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 649 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
645 }; 650 };
646 651
647 652
648 } } // namespace v8::internal 653 } } // namespace v8::internal
649 654
650 #endif // V8_COMPILER_H_ 655 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/codegen.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698