OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // True if index is included in the expression stack part of the environment. | 448 // True if index is included in the expression stack part of the environment. |
449 bool HasExpressionAt(int index) const; | 449 bool HasExpressionAt(int index) const; |
450 | 450 |
451 void Initialize(int parameter_count, int local_count, int stack_height); | 451 void Initialize(int parameter_count, int local_count, int stack_height); |
452 void Initialize(const HEnvironment* other); | 452 void Initialize(const HEnvironment* other); |
453 | 453 |
454 // Map a variable to an environment index. Parameter indices are shifted | 454 // Map a variable to an environment index. Parameter indices are shifted |
455 // by 1 (receiver is parameter index -1 but environment index 0). | 455 // by 1 (receiver is parameter index -1 but environment index 0). |
456 // Stack-allocated local indices are shifted by the number of parameters. | 456 // Stack-allocated local indices are shifted by the number of parameters. |
457 int IndexFor(Variable* variable) const { | 457 int IndexFor(Variable* variable) const { |
458 Slot* slot = variable->AsSlot(); | 458 ASSERT(variable->IsStackAllocated()); |
459 ASSERT(slot != NULL && slot->IsStackAllocated()); | 459 int shift = variable->IsParameter() |
460 int shift = (slot->type() == Slot::PARAMETER) | |
461 ? 1 | 460 ? 1 |
462 : parameter_count_ + specials_count_; | 461 : parameter_count_ + specials_count_; |
463 return slot->index() + shift; | 462 return variable->index() + shift; |
464 } | 463 } |
465 | 464 |
466 Handle<JSFunction> closure_; | 465 Handle<JSFunction> closure_; |
467 // Value array [parameters] [specials] [locals] [temporaries]. | 466 // Value array [parameters] [specials] [locals] [temporaries]. |
468 ZoneList<HValue*> values_; | 467 ZoneList<HValue*> values_; |
469 ZoneList<int> assigned_variables_; | 468 ZoneList<int> assigned_variables_; |
470 int parameter_count_; | 469 int parameter_count_; |
471 int specials_count_; | 470 int specials_count_; |
472 int local_count_; | 471 int local_count_; |
473 HEnvironment* outer_; | 472 HEnvironment* outer_; |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 const char* filename_; | 1232 const char* filename_; |
1234 HeapStringAllocator string_allocator_; | 1233 HeapStringAllocator string_allocator_; |
1235 StringStream trace_; | 1234 StringStream trace_; |
1236 int indent_; | 1235 int indent_; |
1237 }; | 1236 }; |
1238 | 1237 |
1239 | 1238 |
1240 } } // namespace v8::internal | 1239 } } // namespace v8::internal |
1241 | 1240 |
1242 #endif // V8_HYDROGEN_H_ | 1241 #endif // V8_HYDROGEN_H_ |
OLD | NEW |