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

Side by Side Diff: src/isolate.h

Issue 23694011: Make implicit HandleScope of AssertNoContextChange explicit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: One spot missed. Created 7 years, 3 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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 private: 1407 private:
1408 Handle<Context> context_; 1408 Handle<Context> context_;
1409 SaveContext* prev_; 1409 SaveContext* prev_;
1410 Address c_entry_fp_; 1410 Address c_entry_fp_;
1411 }; 1411 };
1412 1412
1413 1413
1414 class AssertNoContextChange BASE_EMBEDDED { 1414 class AssertNoContextChange BASE_EMBEDDED {
1415 #ifdef DEBUG 1415 #ifdef DEBUG
1416 public: 1416 public:
1417 AssertNoContextChange() : 1417 AssertNoContextChange() : context_(Isolate::Current()->context()) { }
1418 ~AssertNoContextChange() {
1419 ASSERT(Isolate::Current()->context() == *context_);
1420 }
1421
1422 private:
1423 Handle<Context> context_;
1424 #else
1425 public:
1426 AssertNoContextChange() { }
1427 #endif
1428 };
1429
1430
1431 // TODO(mstarzinger): Depracate as soon as everything is handlified.
1432 class AssertNoContextChangeWithHandleScope BASE_EMBEDDED {
1433 #ifdef DEBUG
1434 public:
1435 AssertNoContextChangeWithHandleScope() :
1418 scope_(Isolate::Current()), 1436 scope_(Isolate::Current()),
1419 context_(Isolate::Current()->context(), Isolate::Current()) { 1437 context_(Isolate::Current()->context(), Isolate::Current()) {
1420 } 1438 }
1421 1439
1422 ~AssertNoContextChange() { 1440 ~AssertNoContextChangeWithHandleScope() {
1423 ASSERT(Isolate::Current()->context() == *context_); 1441 ASSERT(Isolate::Current()->context() == *context_);
1424 } 1442 }
1425 1443
1426 private: 1444 private:
1427 HandleScope scope_; 1445 HandleScope scope_;
1428 Handle<Context> context_; 1446 Handle<Context> context_;
1429 #else 1447 #else
1430 public: 1448 public:
1431 AssertNoContextChange() { } 1449 AssertNoContextChangeWithHandleScope() { }
1432 #endif 1450 #endif
1433 }; 1451 };
1434 1452
1435 1453
1436 class ExecutionAccess BASE_EMBEDDED { 1454 class ExecutionAccess BASE_EMBEDDED {
1437 public: 1455 public:
1438 explicit ExecutionAccess(Isolate* isolate) : isolate_(isolate) { 1456 explicit ExecutionAccess(Isolate* isolate) : isolate_(isolate) {
1439 Lock(isolate); 1457 Lock(isolate);
1440 } 1458 }
1441 ~ExecutionAccess() { Unlock(isolate_); } 1459 ~ExecutionAccess() { Unlock(isolate_); }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 1520
1503 // Mark the native context with out of memory. 1521 // Mark the native context with out of memory.
1504 inline void Context::mark_out_of_memory() { 1522 inline void Context::mark_out_of_memory() {
1505 native_context()->set_out_of_memory(HEAP->true_value()); 1523 native_context()->set_out_of_memory(HEAP->true_value());
1506 } 1524 }
1507 1525
1508 1526
1509 } } // namespace v8::internal 1527 } } // namespace v8::internal
1510 1528
1511 #endif // V8_ISOLATE_H_ 1529 #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