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

Side by Side Diff: src/hydrogen.h

Issue 22339018: Deoptimization is easier to diagnose when there is a text reason. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 4 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/code-stubs-hydrogen.cc ('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 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>); 1263 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>);
1264 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); 1264 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL);
1265 HLoadNamedField* AddLoadFixedArrayLength(HValue *object); 1265 HLoadNamedField* AddLoadFixedArrayLength(HValue *object);
1266 1266
1267 HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin); 1267 HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin);
1268 1268
1269 HValue* TruncateToNumber(HValue* value, Handle<Type>* expected); 1269 HValue* TruncateToNumber(HValue* value, Handle<Type>* expected);
1270 1270
1271 void PushAndAdd(HInstruction* instr); 1271 void PushAndAdd(HInstruction* instr);
1272 1272
1273 void FinishExitWithHardDeoptimization(HBasicBlock* continuation); 1273 void FinishExitWithHardDeoptimization(const char* reason,
1274 HBasicBlock* continuation);
1274 1275
1275 void AddIncrementCounter(StatsCounter* counter, 1276 void AddIncrementCounter(StatsCounter* counter,
1276 HValue* context); 1277 HValue* context);
1277 1278
1278 class IfBuilder { 1279 class IfBuilder {
1279 public: 1280 public:
1280 explicit IfBuilder(HGraphBuilder* builder, 1281 explicit IfBuilder(HGraphBuilder* builder,
1281 int position = RelocInfo::kNoPosition); 1282 int position = RelocInfo::kNoPosition);
1282 IfBuilder(HGraphBuilder* builder, 1283 IfBuilder(HGraphBuilder* builder,
1283 HIfContinuation* continuation); 1284 HIfContinuation* continuation);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 1368
1368 void Or(); 1369 void Or();
1369 void And(); 1370 void And();
1370 1371
1371 void CaptureContinuation(HIfContinuation* continuation); 1372 void CaptureContinuation(HIfContinuation* continuation);
1372 1373
1373 void Then(); 1374 void Then();
1374 void Else(); 1375 void Else();
1375 void End(); 1376 void End();
1376 1377
1377 void Deopt(); 1378 void Deopt(const char* reason);
1378 void ElseDeopt() { 1379 void ElseDeopt(const char* reason) {
1379 Else(); 1380 Else();
1380 Deopt(); 1381 Deopt(reason);
1381 } 1382 }
1382 1383
1383 void Return(HValue* value); 1384 void Return(HValue* value);
1384 1385
1385 private: 1386 private:
1386 void AddCompare(HControlInstruction* compare); 1387 void AddCompare(HControlInstruction* compare);
1387 1388
1388 Zone* zone() { return builder_->zone(); } 1389 Zone* zone() { return builder_->zone(); }
1389 1390
1390 HGraphBuilder* builder_; 1391 HGraphBuilder* builder_;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 1576
1576 CompilationInfo* info_; 1577 CompilationInfo* info_;
1577 HGraph* graph_; 1578 HGraph* graph_;
1578 HBasicBlock* current_block_; 1579 HBasicBlock* current_block_;
1579 int no_side_effects_scope_count_; 1580 int no_side_effects_scope_count_;
1580 }; 1581 };
1581 1582
1582 1583
1583 template<> 1584 template<>
1584 inline HInstruction* HGraphBuilder::AddUncasted<HDeoptimize>( 1585 inline HInstruction* HGraphBuilder::AddUncasted<HDeoptimize>(
1585 Deoptimizer::BailoutType type) { 1586 const char* reason, Deoptimizer::BailoutType type) {
1586 if (type == Deoptimizer::SOFT) { 1587 if (type == Deoptimizer::SOFT) {
1587 isolate()->counters()->soft_deopts_requested()->Increment(); 1588 isolate()->counters()->soft_deopts_requested()->Increment();
1588 if (FLAG_always_opt) return NULL; 1589 if (FLAG_always_opt) return NULL;
1589 } 1590 }
1590 if (current_block()->IsDeoptimizing()) return NULL; 1591 if (current_block()->IsDeoptimizing()) return NULL;
1591 HDeoptimize* instr = New<HDeoptimize>(type); 1592 HDeoptimize* instr = New<HDeoptimize>(reason, type);
1592 AddInstruction(instr); 1593 AddInstruction(instr);
1593 if (type == Deoptimizer::SOFT) { 1594 if (type == Deoptimizer::SOFT) {
1594 isolate()->counters()->soft_deopts_inserted()->Increment(); 1595 isolate()->counters()->soft_deopts_inserted()->Increment();
1595 graph()->set_has_soft_deoptimize(true); 1596 graph()->set_has_soft_deoptimize(true);
1596 } 1597 }
1597 current_block()->MarkAsDeoptimizing(); 1598 current_block()->MarkAsDeoptimizing();
1598 return instr; 1599 return instr;
1599 } 1600 }
1600 1601
1601 1602
1602 template<> 1603 template<>
1603 inline HDeoptimize* HGraphBuilder::Add<HDeoptimize>( 1604 inline HDeoptimize* HGraphBuilder::Add<HDeoptimize>(
1604 Deoptimizer::BailoutType type) { 1605 const char* reason, Deoptimizer::BailoutType type) {
1605 return static_cast<HDeoptimize*>(AddUncasted<HDeoptimize>(type)); 1606 return static_cast<HDeoptimize*>(AddUncasted<HDeoptimize>(reason, type));
1606 } 1607 }
1607 1608
1608 1609
1609 template<> 1610 template<>
1610 inline HInstruction* HGraphBuilder::AddUncasted<HSimulate>( 1611 inline HInstruction* HGraphBuilder::AddUncasted<HSimulate>(
1611 BailoutId id, 1612 BailoutId id,
1612 RemovableSimulate removable) { 1613 RemovableSimulate removable) {
1613 HSimulate* instr = current_block()->CreateSimulate(id, removable); 1614 HSimulate* instr = current_block()->CreateSimulate(id, removable);
1614 AddInstruction(instr); 1615 AddInstruction(instr);
1615 return instr; 1616 return instr;
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 EmbeddedVector<char, 64> filename_; 2326 EmbeddedVector<char, 64> filename_;
2326 HeapStringAllocator string_allocator_; 2327 HeapStringAllocator string_allocator_;
2327 StringStream trace_; 2328 StringStream trace_;
2328 int indent_; 2329 int indent_;
2329 }; 2330 };
2330 2331
2331 2332
2332 } } // namespace v8::internal 2333 } } // namespace v8::internal
2333 2334
2334 #endif // V8_HYDROGEN_H_ 2335 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698