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 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 Isolate* isolate_; | 1419 Isolate* isolate_; |
1420 Handle<Context> context_; | 1420 Handle<Context> context_; |
1421 SaveContext* prev_; | 1421 SaveContext* prev_; |
1422 Address c_entry_fp_; | 1422 Address c_entry_fp_; |
1423 }; | 1423 }; |
1424 | 1424 |
1425 | 1425 |
1426 class AssertNoContextChange BASE_EMBEDDED { | 1426 class AssertNoContextChange BASE_EMBEDDED { |
1427 #ifdef DEBUG | 1427 #ifdef DEBUG |
1428 public: | 1428 public: |
1429 AssertNoContextChange() : context_(Isolate::Current()->context()) { } | 1429 AssertNoContextChange() |
| 1430 : isolate_(Isolate::Current()), |
| 1431 context_(isolate_->context()) { } |
1430 ~AssertNoContextChange() { | 1432 ~AssertNoContextChange() { |
1431 ASSERT(Isolate::Current()->context() == *context_); | 1433 ASSERT(isolate_->context() == *context_); |
1432 } | 1434 } |
1433 | 1435 |
1434 private: | 1436 private: |
| 1437 Isolate* isolate_; |
1435 Handle<Context> context_; | 1438 Handle<Context> context_; |
1436 #else | 1439 #else |
1437 public: | 1440 public: |
1438 AssertNoContextChange() { } | 1441 AssertNoContextChange() { } |
1439 #endif | 1442 #endif |
1440 }; | 1443 }; |
1441 | 1444 |
1442 | 1445 |
1443 // TODO(mstarzinger): Depracate as soon as everything is handlified. | 1446 // TODO(mstarzinger): Depracate as soon as everything is handlified. |
1444 class AssertNoContextChangeWithHandleScope BASE_EMBEDDED { | 1447 class AssertNoContextChangeWithHandleScope BASE_EMBEDDED { |
1445 #ifdef DEBUG | 1448 #ifdef DEBUG |
1446 public: | 1449 public: |
1447 AssertNoContextChangeWithHandleScope() : | 1450 AssertNoContextChangeWithHandleScope() : |
1448 scope_(Isolate::Current()), | 1451 isolate_(Isolate::Current()), |
1449 context_(Isolate::Current()->context(), Isolate::Current()) { | 1452 scope_(isolate_), |
| 1453 context_(isolate_->context(), isolate_) { |
1450 } | 1454 } |
1451 | 1455 |
1452 ~AssertNoContextChangeWithHandleScope() { | 1456 ~AssertNoContextChangeWithHandleScope() { |
1453 ASSERT(Isolate::Current()->context() == *context_); | 1457 ASSERT(isolate_->context() == *context_); |
1454 } | 1458 } |
1455 | 1459 |
1456 private: | 1460 private: |
| 1461 Isolate* isolate_; |
1457 HandleScope scope_; | 1462 HandleScope scope_; |
1458 Handle<Context> context_; | 1463 Handle<Context> context_; |
1459 #else | 1464 #else |
1460 public: | 1465 public: |
1461 AssertNoContextChangeWithHandleScope() { } | 1466 AssertNoContextChangeWithHandleScope() { } |
1462 #endif | 1467 #endif |
1463 }; | 1468 }; |
1464 | 1469 |
1465 | 1470 |
1466 class ExecutionAccess BASE_EMBEDDED { | 1471 class ExecutionAccess BASE_EMBEDDED { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 | 1531 |
1527 // Mark the native context with out of memory. | 1532 // Mark the native context with out of memory. |
1528 inline void Context::mark_out_of_memory() { | 1533 inline void Context::mark_out_of_memory() { |
1529 native_context()->set_out_of_memory(GetIsolate()->heap()->true_value()); | 1534 native_context()->set_out_of_memory(GetIsolate()->heap()->true_value()); |
1530 } | 1535 } |
1531 | 1536 |
1532 | 1537 |
1533 } } // namespace v8::internal | 1538 } } // namespace v8::internal |
1534 | 1539 |
1535 #endif // V8_ISOLATE_H_ | 1540 #endif // V8_ISOLATE_H_ |
OLD | NEW |