OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 | 64 |
65 CodeGenerator* CodeGeneratorScope::top_ = NULL; | 65 CodeGenerator* CodeGeneratorScope::top_ = NULL; |
66 | 66 |
67 | 67 |
68 void CodeGenerator::ProcessDeferred() { | 68 void CodeGenerator::ProcessDeferred() { |
69 while (!deferred_.is_empty()) { | 69 while (!deferred_.is_empty()) { |
70 DeferredCode* code = deferred_.RemoveLast(); | 70 DeferredCode* code = deferred_.RemoveLast(); |
71 ASSERT(masm_ == code->masm()); | 71 ASSERT(masm_ == code->masm()); |
72 // Record position of deferred code stub. | 72 // Record position of deferred code stub. |
73 masm_->RecordStatementPosition(code->statement_position()); | 73 masm_->positions_recorder()->RecordStatementPosition( |
| 74 code->statement_position()); |
74 if (code->position() != RelocInfo::kNoPosition) { | 75 if (code->position() != RelocInfo::kNoPosition) { |
75 masm_->RecordPosition(code->position()); | 76 masm_->positions_recorder()->RecordPosition(code->position()); |
76 } | 77 } |
77 // Generate the code. | 78 // Generate the code. |
78 Comment cmnt(masm_, code->comment()); | 79 Comment cmnt(masm_, code->comment()); |
79 masm_->bind(code->entry_label()); | 80 masm_->bind(code->entry_label()); |
80 if (code->AutoSaveAndRestore()) { | 81 if (code->AutoSaveAndRestore()) { |
81 code->SaveRegisters(); | 82 code->SaveRegisters(); |
82 } | 83 } |
83 code->Generate(); | 84 code->Generate(); |
84 if (code->AutoSaveAndRestore()) { | 85 if (code->AutoSaveAndRestore()) { |
85 code->RestoreRegisters(); | 86 code->RestoreRegisters(); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 } | 396 } |
396 | 397 |
397 return DONT_KNOW; | 398 return DONT_KNOW; |
398 } | 399 } |
399 | 400 |
400 | 401 |
401 bool CodeGenerator::RecordPositions(MacroAssembler* masm, | 402 bool CodeGenerator::RecordPositions(MacroAssembler* masm, |
402 int pos, | 403 int pos, |
403 bool right_here) { | 404 bool right_here) { |
404 if (pos != RelocInfo::kNoPosition) { | 405 if (pos != RelocInfo::kNoPosition) { |
405 masm->RecordStatementPosition(pos); | 406 masm->positions_recorder()->RecordStatementPosition(pos); |
406 masm->RecordPosition(pos); | 407 masm->positions_recorder()->RecordPosition(pos); |
407 if (right_here) { | 408 if (right_here) { |
408 return masm->WriteRecordedPositions(); | 409 return masm->positions_recorder()->WriteRecordedPositions(); |
409 } | 410 } |
410 } | 411 } |
411 return false; | 412 return false; |
412 } | 413 } |
413 | 414 |
414 | 415 |
415 void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) { | 416 void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) { |
416 if (FLAG_debug_info) RecordPositions(masm(), fun->start_position(), false); | 417 if (FLAG_debug_info) RecordPositions(masm(), fun->start_position(), false); |
417 } | 418 } |
418 | 419 |
419 | 420 |
420 void CodeGenerator::CodeForReturnPosition(FunctionLiteral* fun) { | 421 void CodeGenerator::CodeForReturnPosition(FunctionLiteral* fun) { |
421 if (FLAG_debug_info) RecordPositions(masm(), fun->end_position() - 1, false); | 422 if (FLAG_debug_info) RecordPositions(masm(), fun->end_position() - 1, false); |
422 } | 423 } |
423 | 424 |
424 | 425 |
425 void CodeGenerator::CodeForStatementPosition(Statement* stmt) { | 426 void CodeGenerator::CodeForStatementPosition(Statement* stmt) { |
426 if (FLAG_debug_info) RecordPositions(masm(), stmt->statement_pos(), false); | 427 if (FLAG_debug_info) RecordPositions(masm(), stmt->statement_pos(), false); |
427 } | 428 } |
428 | 429 |
429 | 430 |
430 void CodeGenerator::CodeForDoWhileConditionPosition(DoWhileStatement* stmt) { | 431 void CodeGenerator::CodeForDoWhileConditionPosition(DoWhileStatement* stmt) { |
431 if (FLAG_debug_info) | 432 if (FLAG_debug_info) |
432 RecordPositions(masm(), stmt->condition_position(), false); | 433 RecordPositions(masm(), stmt->condition_position(), false); |
433 } | 434 } |
434 | 435 |
435 | 436 |
436 void CodeGenerator::CodeForSourcePosition(int pos) { | 437 void CodeGenerator::CodeForSourcePosition(int pos) { |
437 if (FLAG_debug_info && pos != RelocInfo::kNoPosition) { | 438 if (FLAG_debug_info && pos != RelocInfo::kNoPosition) { |
438 masm()->RecordPosition(pos); | 439 masm()->positions_recorder()->RecordPosition(pos); |
439 } | 440 } |
440 } | 441 } |
441 | 442 |
442 | 443 |
443 const char* GenericUnaryOpStub::GetName() { | 444 const char* GenericUnaryOpStub::GetName() { |
444 switch (op_) { | 445 switch (op_) { |
445 case Token::SUB: | 446 case Token::SUB: |
446 if (negative_zero_ == kStrictNegativeZero) { | 447 if (negative_zero_ == kStrictNegativeZero) { |
447 return overwrite_ == UNARY_OVERWRITE | 448 return overwrite_ == UNARY_OVERWRITE |
448 ? "GenericUnaryOpStub_SUB_Overwrite_Strict0" | 449 ? "GenericUnaryOpStub_SUB_Overwrite_Strict0" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } | 492 } |
492 } | 493 } |
493 | 494 |
494 | 495 |
495 void ApiGetterEntryStub::SetCustomCache(Code* value) { | 496 void ApiGetterEntryStub::SetCustomCache(Code* value) { |
496 info()->set_load_stub_cache(value); | 497 info()->set_load_stub_cache(value); |
497 } | 498 } |
498 | 499 |
499 | 500 |
500 } } // namespace v8::internal | 501 } } // namespace v8::internal |
OLD | NEW |