Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: src/isolate.h

Issue 25513002: Remove obsolete AssertNoContextChangeWithHandleScope. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Another minor fix. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 Isolate* isolate_; 1404 Isolate* isolate_;
1405 Handle<Context> context_; 1405 Handle<Context> context_;
1406 SaveContext* prev_; 1406 SaveContext* prev_;
1407 Address c_entry_fp_; 1407 Address c_entry_fp_;
1408 }; 1408 };
1409 1409
1410 1410
1411 class AssertNoContextChange BASE_EMBEDDED { 1411 class AssertNoContextChange BASE_EMBEDDED {
1412 #ifdef DEBUG 1412 #ifdef DEBUG
1413 public: 1413 public:
1414 AssertNoContextChange() 1414 explicit AssertNoContextChange(Isolate* isolate)
1415 : isolate_(Isolate::Current()), 1415 : isolate_(isolate),
1416 context_(isolate_->context()) { } 1416 context_(isolate->context(), isolate) { }
1417 ~AssertNoContextChange() { 1417 ~AssertNoContextChange() {
1418 ASSERT(isolate_->context() == *context_); 1418 ASSERT(isolate_->context() == *context_);
1419 } 1419 }
1420 1420
1421 private: 1421 private:
1422 Isolate* isolate_; 1422 Isolate* isolate_;
1423 Handle<Context> context_; 1423 Handle<Context> context_;
1424 #else 1424 #else
1425 public: 1425 public:
1426 AssertNoContextChange() { } 1426 explicit AssertNoContextChange(Isolate* isolate) { }
1427 #endif 1427 #endif
1428 }; 1428 };
1429 1429
1430
1431 // TODO(mstarzinger): Depracate as soon as everything is handlified.
1432 class AssertNoContextChangeWithHandleScope BASE_EMBEDDED {
1433 #ifdef DEBUG
1434 public:
1435 AssertNoContextChangeWithHandleScope() :
1436 isolate_(Isolate::Current()),
1437 scope_(isolate_),
1438 context_(isolate_->context(), isolate_) {
1439 }
1440
1441 ~AssertNoContextChangeWithHandleScope() {
1442 ASSERT(isolate_->context() == *context_);
1443 }
1444
1445 private:
1446 Isolate* isolate_;
1447 HandleScope scope_;
1448 Handle<Context> context_;
1449 #else
1450 public:
1451 AssertNoContextChangeWithHandleScope() { }
1452 #endif
1453 };
1454
1455 1430
1456 class ExecutionAccess BASE_EMBEDDED { 1431 class ExecutionAccess BASE_EMBEDDED {
1457 public: 1432 public:
1458 explicit ExecutionAccess(Isolate* isolate) : isolate_(isolate) { 1433 explicit ExecutionAccess(Isolate* isolate) : isolate_(isolate) {
1459 Lock(isolate); 1434 Lock(isolate);
1460 } 1435 }
1461 ~ExecutionAccess() { Unlock(isolate_); } 1436 ~ExecutionAccess() { Unlock(isolate_); }
1462 1437
1463 static void Lock(Isolate* isolate) { isolate->break_access()->Lock(); } 1438 static void Lock(Isolate* isolate) { isolate->break_access()->Lock(); }
1464 static void Unlock(Isolate* isolate) { isolate->break_access()->Unlock(); } 1439 static void Unlock(Isolate* isolate) { isolate->break_access()->Unlock(); }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 1491
1517 // Mark the native context with out of memory. 1492 // Mark the native context with out of memory.
1518 inline void Context::mark_out_of_memory() { 1493 inline void Context::mark_out_of_memory() {
1519 native_context()->set_out_of_memory(GetIsolate()->heap()->true_value()); 1494 native_context()->set_out_of_memory(GetIsolate()->heap()->true_value());
1520 } 1495 }
1521 1496
1522 1497
1523 } } // namespace v8::internal 1498 } } // namespace v8::internal
1524 1499
1525 #endif // V8_ISOLATE_H_ 1500 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698