| OLD | NEW |
| 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 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2406 stream->Add(" push "); | 2406 stream->Add(" push "); |
| 2407 } | 2407 } |
| 2408 values_[i]->PrintNameTo(stream); | 2408 values_[i]->PrintNameTo(stream); |
| 2409 if (i > 0) stream->Add(","); | 2409 if (i > 0) stream->Add(","); |
| 2410 } | 2410 } |
| 2411 } | 2411 } |
| 2412 } | 2412 } |
| 2413 | 2413 |
| 2414 | 2414 |
| 2415 void HSimulate::ReplayEnvironment(HEnvironment* env) { | 2415 void HSimulate::ReplayEnvironment(HEnvironment* env) { |
| 2416 if (done_with_replay_) return; |
| 2416 ASSERT(env != NULL); | 2417 ASSERT(env != NULL); |
| 2417 env->set_ast_id(ast_id()); | 2418 env->set_ast_id(ast_id()); |
| 2418 env->Drop(pop_count()); | 2419 env->Drop(pop_count()); |
| 2419 for (int i = values()->length() - 1; i >= 0; --i) { | 2420 for (int i = values()->length() - 1; i >= 0; --i) { |
| 2420 HValue* value = values()->at(i); | 2421 HValue* value = values()->at(i); |
| 2421 if (HasAssignedIndexAt(i)) { | 2422 if (HasAssignedIndexAt(i)) { |
| 2422 env->Bind(GetAssignedIndexAt(i), value); | 2423 env->Bind(GetAssignedIndexAt(i), value); |
| 2423 } else { | 2424 } else { |
| 2424 env->Push(value); | 2425 env->Push(value); |
| 2425 } | 2426 } |
| 2426 } | 2427 } |
| 2428 done_with_replay_ = true; |
| 2427 } | 2429 } |
| 2428 | 2430 |
| 2429 | 2431 |
| 2430 static void ReplayEnvironmentNested(const ZoneList<HValue*>* values, | 2432 static void ReplayEnvironmentNested(const ZoneList<HValue*>* values, |
| 2431 HCapturedObject* other) { | 2433 HCapturedObject* other) { |
| 2432 for (int i = 0; i < values->length(); ++i) { | 2434 for (int i = 0; i < values->length(); ++i) { |
| 2433 HValue* value = values->at(i); | 2435 HValue* value = values->at(i); |
| 2434 if (value->IsCapturedObject()) { | 2436 if (value->IsCapturedObject()) { |
| 2435 if (HCapturedObject::cast(value)->capture_id() == other->capture_id()) { | 2437 if (HCapturedObject::cast(value)->capture_id() == other->capture_id()) { |
| 2436 values->at(i) = other; | 2438 values->at(i) = other; |
| (...skipping 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4476 break; | 4478 break; |
| 4477 case kExternalMemory: | 4479 case kExternalMemory: |
| 4478 stream->Add("[external-memory]"); | 4480 stream->Add("[external-memory]"); |
| 4479 break; | 4481 break; |
| 4480 } | 4482 } |
| 4481 | 4483 |
| 4482 stream->Add("@%d", offset()); | 4484 stream->Add("@%d", offset()); |
| 4483 } | 4485 } |
| 4484 | 4486 |
| 4485 } } // namespace v8::internal | 4487 } } // namespace v8::internal |
| OLD | NEW |