| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 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 23 matching lines...) Expand all Loading... |
| 34 #include "scopeinfo.h" | 34 #include "scopeinfo.h" |
| 35 #include "runtime.h" | 35 #include "runtime.h" |
| 36 #include "stub-cache.h" | 36 #include "stub-cache.h" |
| 37 | 37 |
| 38 namespace v8 { namespace internal { | 38 namespace v8 { namespace internal { |
| 39 | 39 |
| 40 DeferredCode::DeferredCode(CodeGenerator* generator) | 40 DeferredCode::DeferredCode(CodeGenerator* generator) |
| 41 : masm_(generator->masm()), | 41 : masm_(generator->masm()), |
| 42 generator_(generator), | 42 generator_(generator), |
| 43 enter_(generator), | 43 enter_(generator), |
| 44 exit_(generator), | 44 exit_(generator, JumpTarget::BIDIRECTIONAL), |
| 45 statement_position_(masm_->current_statement_position()), | 45 statement_position_(masm_->current_statement_position()), |
| 46 position_(masm_->current_position()) { | 46 position_(masm_->current_position()) { |
| 47 generator->AddDeferred(this); | 47 generator->AddDeferred(this); |
| 48 ASSERT(statement_position_ != RelocInfo::kNoPosition); | 48 ASSERT(statement_position_ != RelocInfo::kNoPosition); |
| 49 ASSERT(position_ != RelocInfo::kNoPosition); | 49 ASSERT(position_ != RelocInfo::kNoPosition); |
| 50 #ifdef DEBUG | 50 #ifdef DEBUG |
| 51 comment_ = ""; | 51 comment_ = ""; |
| 52 #endif | 52 #endif |
| 53 } | 53 } |
| 54 | 54 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 int default_index) { | 378 int default_index) { |
| 379 ZoneList<CaseClause*>* cases = node->cases(); | 379 ZoneList<CaseClause*>* cases = node->cases(); |
| 380 int length = cases->length(); | 380 int length = cases->length(); |
| 381 | 381 |
| 382 // JumpTarget pointer per number in range. | 382 // JumpTarget pointer per number in range. |
| 383 SmartPointer<JumpTarget*> case_targets(NewArray<JumpTarget*>(range)); | 383 SmartPointer<JumpTarget*> case_targets(NewArray<JumpTarget*>(range)); |
| 384 | 384 |
| 385 // JumpTarget per switch case. | 385 // JumpTarget per switch case. |
| 386 SmartPointer<JumpTarget> case_labels(NewArray<JumpTarget>(length)); | 386 SmartPointer<JumpTarget> case_labels(NewArray<JumpTarget>(length)); |
| 387 for (int i = 0; i < length; i++) { | 387 for (int i = 0; i < length; i++) { |
| 388 case_labels[i].set_code_generator(this); | 388 case_labels[i].Initialize(this); |
| 389 } | 389 } |
| 390 | 390 |
| 391 JumpTarget* fail_label = default_index >= 0 ? &(case_labels[default_index]) | 391 JumpTarget* fail_label = default_index >= 0 ? &(case_labels[default_index]) |
| 392 : node->break_target(); | 392 : node->break_target(); |
| 393 | 393 |
| 394 // Populate array of label pointers for each number in the range. | 394 // Populate array of label pointers for each number in the range. |
| 395 // Initally put the failure label everywhere. | 395 // Initally put the failure label everywhere. |
| 396 for (int i = 0; i < range; i++) { | 396 for (int i = 0; i < range; i++) { |
| 397 case_targets[i] = fail_label; | 397 case_targets[i] = fail_label; |
| 398 } | 398 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { | 527 void ArgumentsAccessStub::Generate(MacroAssembler* masm) { |
| 528 switch (type_) { | 528 switch (type_) { |
| 529 case READ_LENGTH: GenerateReadLength(masm); break; | 529 case READ_LENGTH: GenerateReadLength(masm); break; |
| 530 case READ_ELEMENT: GenerateReadElement(masm); break; | 530 case READ_ELEMENT: GenerateReadElement(masm); break; |
| 531 case NEW_OBJECT: GenerateNewObject(masm); break; | 531 case NEW_OBJECT: GenerateNewObject(masm); break; |
| 532 } | 532 } |
| 533 } | 533 } |
| 534 | 534 |
| 535 | 535 |
| 536 } } // namespace v8::internal | 536 } } // namespace v8::internal |
| OLD | NEW |