| 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 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2429 stream->Add(" push "); | 2429 stream->Add(" push "); |
| 2430 } | 2430 } |
| 2431 values_[i]->PrintNameTo(stream); | 2431 values_[i]->PrintNameTo(stream); |
| 2432 if (i > 0) stream->Add(","); | 2432 if (i > 0) stream->Add(","); |
| 2433 } | 2433 } |
| 2434 } | 2434 } |
| 2435 } | 2435 } |
| 2436 | 2436 |
| 2437 | 2437 |
| 2438 void HSimulate::ReplayEnvironment(HEnvironment* env) { | 2438 void HSimulate::ReplayEnvironment(HEnvironment* env) { |
| 2439 if (done_with_replay_) return; |
| 2439 ASSERT(env != NULL); | 2440 ASSERT(env != NULL); |
| 2440 env->set_ast_id(ast_id()); | 2441 env->set_ast_id(ast_id()); |
| 2441 env->Drop(pop_count()); | 2442 env->Drop(pop_count()); |
| 2442 for (int i = values()->length() - 1; i >= 0; --i) { | 2443 for (int i = values()->length() - 1; i >= 0; --i) { |
| 2443 HValue* value = values()->at(i); | 2444 HValue* value = values()->at(i); |
| 2444 if (HasAssignedIndexAt(i)) { | 2445 if (HasAssignedIndexAt(i)) { |
| 2445 env->Bind(GetAssignedIndexAt(i), value); | 2446 env->Bind(GetAssignedIndexAt(i), value); |
| 2446 } else { | 2447 } else { |
| 2447 env->Push(value); | 2448 env->Push(value); |
| 2448 } | 2449 } |
| 2449 } | 2450 } |
| 2451 done_with_replay_ = true; |
| 2450 } | 2452 } |
| 2451 | 2453 |
| 2452 | 2454 |
| 2453 static void ReplayEnvironmentNested(const ZoneList<HValue*>* values, | 2455 static void ReplayEnvironmentNested(const ZoneList<HValue*>* values, |
| 2454 HCapturedObject* other) { | 2456 HCapturedObject* other) { |
| 2455 for (int i = 0; i < values->length(); ++i) { | 2457 for (int i = 0; i < values->length(); ++i) { |
| 2456 HValue* value = values->at(i); | 2458 HValue* value = values->at(i); |
| 2457 if (value->IsCapturedObject()) { | 2459 if (value->IsCapturedObject()) { |
| 2458 if (HCapturedObject::cast(value)->capture_id() == other->capture_id()) { | 2460 if (HCapturedObject::cast(value)->capture_id() == other->capture_id()) { |
| 2459 values->at(i) = other; | 2461 values->at(i) = other; |
| (...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4413 break; | 4415 break; |
| 4414 case kExternalMemory: | 4416 case kExternalMemory: |
| 4415 stream->Add("[external-memory]"); | 4417 stream->Add("[external-memory]"); |
| 4416 break; | 4418 break; |
| 4417 } | 4419 } |
| 4418 | 4420 |
| 4419 stream->Add("@%d", offset()); | 4421 stream->Add("@%d", offset()); |
| 4420 } | 4422 } |
| 4421 | 4423 |
| 4422 } } // namespace v8::internal | 4424 } } // namespace v8::internal |
| OLD | NEW |