| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 static int break_id_; | 287 static int break_id_; |
| 288 | 288 |
| 289 friend class SaveContext; | 289 friend class SaveContext; |
| 290 friend class AssertNoContextChange; | 290 friend class AssertNoContextChange; |
| 291 friend class ExecutionAccess; | 291 friend class ExecutionAccess; |
| 292 | 292 |
| 293 static void FillCache(); | 293 static void FillCache(); |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 | 296 |
| 297 // TODO(122): If the GCC version is 4.2.0 or higher an additional field is added |
| 298 // to this class as a workarround for a bug in the generated code found with |
| 299 // GCC 4.2.3. |
| 297 class SaveContext BASE_EMBEDDED { | 300 class SaveContext BASE_EMBEDDED { |
| 298 public: | 301 public: |
| 299 SaveContext() : | 302 SaveContext() : |
| 300 context_(Top::context()), | 303 context_(Top::context()), |
| 304 #if __GNUC_VERSION__ >= 40200 |
| 305 dummy_(Top::context()), |
| 306 #endif |
| 301 prev_(Top::save_context()) { | 307 prev_(Top::save_context()) { |
| 302 Top::set_save_context(this); | 308 Top::set_save_context(this); |
| 303 } | 309 } |
| 304 | 310 |
| 305 ~SaveContext() { | 311 ~SaveContext() { |
| 306 Top::set_context(*context_); | 312 Top::set_context(*context_); |
| 307 Top::set_save_context(prev_); | 313 Top::set_save_context(prev_); |
| 308 } | 314 } |
| 309 | 315 |
| 310 Handle<Context> context() { return context_; } | 316 Handle<Context> context() { return context_; } |
| 311 SaveContext* prev() { return prev_; } | 317 SaveContext* prev() { return prev_; } |
| 312 | 318 |
| 313 private: | 319 private: |
| 314 Handle<Context> context_; | 320 Handle<Context> context_; |
| 321 #if __GNUC_VERSION__ >= 40200 |
| 322 Handle<Context> dummy_; |
| 323 #endif |
| 315 SaveContext* prev_; | 324 SaveContext* prev_; |
| 316 }; | 325 }; |
| 317 | 326 |
| 318 | 327 |
| 319 class AssertNoContextChange BASE_EMBEDDED { | 328 class AssertNoContextChange BASE_EMBEDDED { |
| 320 #ifdef DEBUG | 329 #ifdef DEBUG |
| 321 public: | 330 public: |
| 322 AssertNoContextChange() : | 331 AssertNoContextChange() : |
| 323 context_(Top::context()) { | 332 context_(Top::context()) { |
| 324 } | 333 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 339 | 348 |
| 340 class ExecutionAccess BASE_EMBEDDED { | 349 class ExecutionAccess BASE_EMBEDDED { |
| 341 public: | 350 public: |
| 342 ExecutionAccess(); | 351 ExecutionAccess(); |
| 343 ~ExecutionAccess(); | 352 ~ExecutionAccess(); |
| 344 }; | 353 }; |
| 345 | 354 |
| 346 } } // namespace v8::internal | 355 } } // namespace v8::internal |
| 347 | 356 |
| 348 #endif // V8_TOP_H_ | 357 #endif // V8_TOP_H_ |
| OLD | NEW |