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 17 matching lines...) Expand all Loading... |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "scopes.h" | 30 #include "scopes.h" |
31 | 31 |
32 #include "accessors.h" | 32 #include "accessors.h" |
33 #include "bootstrapper.h" | 33 #include "bootstrapper.h" |
34 #include "compiler.h" | 34 #include "compiler.h" |
35 #include "messages.h" | 35 #include "messages.h" |
36 #include "scopeinfo.h" | 36 #include "scopeinfo.h" |
37 | 37 |
38 #include "allocation-inl.h" | |
39 | |
40 namespace v8 { | 38 namespace v8 { |
41 namespace internal { | 39 namespace internal { |
42 | 40 |
43 // ---------------------------------------------------------------------------- | 41 // ---------------------------------------------------------------------------- |
44 // Implementation of LocalsMap | 42 // Implementation of LocalsMap |
45 // | 43 // |
46 // Note: We are storing the handle locations as key values in the hash map. | 44 // Note: We are storing the handle locations as key values in the hash map. |
47 // When inserting a new variable via Declare(), we rely on the fact that | 45 // When inserting a new variable via Declare(), we rely on the fact that |
48 // the handle location remains alive for the duration of that variable | 46 // the handle location remains alive for the duration of that variable |
49 // use. Because a Variable holding a handle with the same location exists | 47 // use. Because a Variable holding a handle with the same location exists |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 } | 1405 } |
1408 | 1406 |
1409 | 1407 |
1410 int Scope::ContextLocalCount() const { | 1408 int Scope::ContextLocalCount() const { |
1411 if (num_heap_slots() == 0) return 0; | 1409 if (num_heap_slots() == 0) return 0; |
1412 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1410 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
1413 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1411 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
1414 } | 1412 } |
1415 | 1413 |
1416 } } // namespace v8::internal | 1414 } } // namespace v8::internal |
OLD | NEW |