Chromium Code Reviews| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 | 411 |
| 412 | 412 |
| 413 void JSGeneratorObject::JSGeneratorObjectVerify() { | 413 void JSGeneratorObject::JSGeneratorObjectVerify() { |
| 414 // In an expression like "new g()", there can be a point where a generator | 414 // In an expression like "new g()", there can be a point where a generator |
| 415 // object is allocated but its fields are all undefined, as it hasn't yet been | 415 // object is allocated but its fields are all undefined, as it hasn't yet been |
| 416 // initialized by the generator. Hence these weak checks. | 416 // initialized by the generator. Hence these weak checks. |
| 417 VerifyObjectField(kFunctionOffset); | 417 VerifyObjectField(kFunctionOffset); |
| 418 VerifyObjectField(kContextOffset); | 418 VerifyObjectField(kContextOffset); |
| 419 VerifyObjectField(kOperandStackOffset); | 419 VerifyObjectField(kOperandStackOffset); |
| 420 VerifyObjectField(kContinuationOffset); | 420 VerifyObjectField(kContinuationOffset); |
| 421 | |
| 422 // Verify that the sentinel values are not positive, and thus that they do not | |
| 423 // indicate a suspended continuation. | |
| 424 STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0); | |
|
Michael Starzinger
2013/04/21 22:45:21
Move these static asserts into the runtime functio
| |
| 425 STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0); | |
| 421 } | 426 } |
| 422 | 427 |
| 423 | 428 |
| 424 void JSModule::JSModuleVerify() { | 429 void JSModule::JSModuleVerify() { |
| 425 VerifyObjectField(kContextOffset); | 430 VerifyObjectField(kContextOffset); |
| 426 VerifyObjectField(kScopeInfoOffset); | 431 VerifyObjectField(kScopeInfoOffset); |
| 427 CHECK(context()->IsUndefined() || | 432 CHECK(context()->IsUndefined() || |
| 428 Context::cast(context())->IsModuleContext()); | 433 Context::cast(context())->IsModuleContext()); |
| 429 } | 434 } |
| 430 | 435 |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1110 for (int i = 0; i < number_of_transitions(); ++i) { | 1115 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1111 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1116 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1112 } | 1117 } |
| 1113 return true; | 1118 return true; |
| 1114 } | 1119 } |
| 1115 | 1120 |
| 1116 | 1121 |
| 1117 #endif // DEBUG | 1122 #endif // DEBUG |
| 1118 | 1123 |
| 1119 } } // namespace v8::internal | 1124 } } // namespace v8::internal |
| OLD | NEW |