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

Side by Side Diff: src/compiler.h

Issue 12049012: Avoid handle dereference during graph optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 11 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/arm/lithium-codegen-arm.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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 Scope* global_scope() const { return global_scope_; } 72 Scope* global_scope() const { return global_scope_; }
73 Handle<Code> code() const { return code_; } 73 Handle<Code> code() const { return code_; }
74 Handle<JSFunction> closure() const { return closure_; } 74 Handle<JSFunction> closure() const { return closure_; }
75 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } 75 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
76 Handle<Script> script() const { return script_; } 76 Handle<Script> script() const { return script_; }
77 HydrogenCodeStub* code_stub() {return code_stub_; } 77 HydrogenCodeStub* code_stub() {return code_stub_; }
78 v8::Extension* extension() const { return extension_; } 78 v8::Extension* extension() const { return extension_; }
79 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } 79 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; }
80 Handle<Context> context() const { return context_; } 80 Handle<Context> context() const { return context_; }
81 BailoutId osr_ast_id() const { return osr_ast_id_; } 81 BailoutId osr_ast_id() const { return osr_ast_id_; }
82 int opt_count() const { return opt_count_; }
82 int num_parameters() const; 83 int num_parameters() const;
83 int num_heap_slots() const; 84 int num_heap_slots() const;
84 Code::Flags flags() const; 85 Code::Flags flags() const;
85 86
86 void MarkAsEval() { 87 void MarkAsEval() {
87 ASSERT(!is_lazy()); 88 ASSERT(!is_lazy());
88 flags_ |= IsEval::encode(true); 89 flags_ |= IsEval::encode(true);
89 } 90 }
90 void MarkAsGlobal() { 91 void MarkAsGlobal() {
91 ASSERT(!is_lazy()); 92 ASSERT(!is_lazy());
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 if (!object->is_null()) { 320 if (!object->is_null()) {
320 Handle<T> handle(*(*object)); 321 Handle<T> handle(*(*object));
321 *object = handle; 322 *object = handle;
322 } 323 }
323 } 324 }
324 325
325 const char* bailout_reason_; 326 const char* bailout_reason_;
326 327
327 int prologue_offset_; 328 int prologue_offset_;
328 329
330 // A copy of shared_info()->opt_count() to avoid handle deref
331 // during graph optimization.
332 int opt_count_;
333
329 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); 334 DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
330 }; 335 };
331 336
332 337
333 // Exactly like a CompilationInfo, except also creates and enters a 338 // Exactly like a CompilationInfo, except also creates and enters a
334 // Zone on construction and deallocates it on exit. 339 // Zone on construction and deallocates it on exit.
335 class CompilationInfoWithZone: public CompilationInfo { 340 class CompilationInfoWithZone: public CompilationInfo {
336 public: 341 public:
337 INLINE(void* operator new(size_t size)) { return Malloced::New(size); } 342 INLINE(void* operator new(size_t size)) { return Malloced::New(size); }
338 343
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 520
516 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, 521 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
517 CompilationInfo* info, 522 CompilationInfo* info,
518 Handle<SharedFunctionInfo> shared); 523 Handle<SharedFunctionInfo> shared);
519 }; 524 };
520 525
521 526
522 } } // namespace v8::internal 527 } } // namespace v8::internal
523 528
524 #endif // V8_COMPILER_H_ 529 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698