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 4421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4432 class SafepointEntry; | 4432 class SafepointEntry; |
| 4433 class TypeFeedbackInfo; | 4433 class TypeFeedbackInfo; |
| 4434 | 4434 |
| 4435 // Code describes objects with on-the-fly generated machine code. | 4435 // Code describes objects with on-the-fly generated machine code. |
| 4436 class Code: public HeapObject { | 4436 class Code: public HeapObject { |
| 4437 public: | 4437 public: |
| 4438 // Opaque data type for encapsulating code flags like kind, inline | 4438 // Opaque data type for encapsulating code flags like kind, inline |
| 4439 // cache state, and arguments count. | 4439 // cache state, and arguments count. |
| 4440 typedef uint32_t Flags; | 4440 typedef uint32_t Flags; |
| 4441 | 4441 |
| 4442 #define CODE_KIND_LIST(V) \ | 4442 #define NON_IC_KIND_LIST(V) \ |
| 4443 V(FUNCTION) \ | 4443 V(FUNCTION) \ |
| 4444 V(OPTIMIZED_FUNCTION) \ | 4444 V(OPTIMIZED_FUNCTION) \ |
| 4445 V(STUB) \ | 4445 V(STUB) \ |
| 4446 V(BUILTIN) \ | 4446 V(BUILTIN) \ |
| 4447 V(LOAD_IC) \ | |
| 4448 V(KEYED_LOAD_IC) \ | |
| 4449 V(CALL_IC) \ | |
| 4450 V(KEYED_CALL_IC) \ | |
| 4451 V(STORE_IC) \ | |
| 4452 V(KEYED_STORE_IC) \ | |
| 4453 V(UNARY_OP_IC) \ | |
| 4454 V(BINARY_OP_IC) \ | |
| 4455 V(COMPARE_IC) \ | |
| 4456 V(COMPARE_NIL_IC) \ | |
| 4457 V(TO_BOOLEAN_IC) \ | |
| 4458 V(REGEXP) | 4447 V(REGEXP) |
| 4459 | 4448 |
| 4449 #define IC_KIND_LIST(V) \ | |
| 4450 V(LOAD_IC) \ | |
| 4451 V(KEYED_LOAD_IC) \ | |
| 4452 V(CALL_IC) \ | |
| 4453 V(KEYED_CALL_IC) \ | |
| 4454 V(STORE_IC) \ | |
| 4455 V(KEYED_STORE_IC) \ | |
| 4456 V(UNARY_OP_IC) \ | |
| 4457 V(BINARY_OP_IC) \ | |
| 4458 V(COMPARE_IC) \ | |
| 4459 V(COMPARE_NIL_IC) \ | |
| 4460 V(TO_BOOLEAN_IC) | |
| 4461 | |
| 4462 #define CODE_KIND_LIST(V) \ | |
| 4463 NON_IC_KIND_LIST(V) \ | |
| 4464 IC_KIND_LIST(V) | |
| 4460 | 4465 |
| 4461 enum Kind { | 4466 enum Kind { |
| 4462 #define DEFINE_CODE_KIND_ENUM(name) name, | 4467 #define DEFINE_CODE_KIND_ENUM(name) name, |
| 4463 CODE_KIND_LIST(DEFINE_CODE_KIND_ENUM) | 4468 NON_IC_KIND_LIST(DEFINE_CODE_KIND_ENUM) |
| 4469 IC_KIND_LIST(DEFINE_CODE_KIND_ENUM) | |
| 4464 #undef DEFINE_CODE_KIND_ENUM | 4470 #undef DEFINE_CODE_KIND_ENUM |
| 4465 | 4471 |
| 4466 // Pseudo-kinds. | 4472 // Pseudo-kinds. |
| 4467 LAST_CODE_KIND = TO_BOOLEAN_IC, | 4473 #define COUNT_FLAG(name) + 1 |
| 4468 FIRST_IC_KIND = LOAD_IC, | 4474 LAST_CODE_KIND = -1 CODE_KIND_LIST(COUNT_FLAG) |
|
Sven Panne
2013/06/25 08:08:10
I don't think we need both LAST_CODE_KIND and NUMB
Benedikt Meurer
2013/06/25 08:48:09
Done.
| |
| 4469 LAST_IC_KIND = TO_BOOLEAN_IC | 4475 #undef COUNT_FLAG |
| 4470 }; | 4476 }; |
| 4471 | 4477 |
| 4472 // No more than 16 kinds. The value is currently encoded in four bits in | 4478 // No more than 16 kinds. The value is currently encoded in four bits in |
| 4473 // Flags. | 4479 // Flags. |
| 4474 STATIC_ASSERT(LAST_CODE_KIND < 16); | 4480 STATIC_ASSERT(LAST_CODE_KIND < 16); |
| 4475 | 4481 |
| 4476 static const char* Kind2String(Kind kind); | 4482 static const char* Kind2String(Kind kind); |
| 4477 | 4483 |
| 4478 // Types of stubs. | 4484 // Types of stubs. |
| 4479 enum StubType { | 4485 enum StubType { |
| 4480 NORMAL, | 4486 NORMAL, |
| 4481 FIELD, | 4487 FIELD, |
| 4482 CONSTANT_FUNCTION, | 4488 CONSTANT_FUNCTION, |
| 4483 CALLBACKS, | 4489 CALLBACKS, |
| 4484 INTERCEPTOR, | 4490 INTERCEPTOR, |
| 4485 MAP_TRANSITION, | 4491 MAP_TRANSITION, |
| 4486 NONEXISTENT | 4492 NONEXISTENT |
| 4487 }; | 4493 }; |
| 4488 | 4494 |
| 4489 enum StubHolder { | 4495 enum StubHolder { |
| 4490 OWN_STUB, | 4496 OWN_STUB, |
| 4491 PROTOTYPE_STUB | 4497 PROTOTYPE_STUB |
| 4492 }; | 4498 }; |
| 4493 | 4499 |
| 4494 enum { | 4500 enum { |
| 4495 NUMBER_OF_KINDS = LAST_IC_KIND + 1 | 4501 NUMBER_OF_KINDS = LAST_CODE_KIND + 1 |
| 4496 }; | 4502 }; |
| 4497 | 4503 |
| 4498 typedef int ExtraICState; | 4504 typedef int ExtraICState; |
| 4499 | 4505 |
| 4500 static const ExtraICState kNoExtraICState = 0; | 4506 static const ExtraICState kNoExtraICState = 0; |
| 4501 | 4507 |
| 4502 #ifdef ENABLE_DISASSEMBLER | 4508 #ifdef ENABLE_DISASSEMBLER |
| 4503 // Printing | 4509 // Printing |
| 4504 static const char* ICState2String(InlineCacheState state); | 4510 static const char* ICState2String(InlineCacheState state); |
| 4505 static const char* StubType2String(StubType type); | 4511 static const char* StubType2String(StubType type); |
| (...skipping 5222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9728 } else { | 9734 } else { |
| 9729 value &= ~(1 << bit_position); | 9735 value &= ~(1 << bit_position); |
| 9730 } | 9736 } |
| 9731 return value; | 9737 return value; |
| 9732 } | 9738 } |
| 9733 }; | 9739 }; |
| 9734 | 9740 |
| 9735 } } // namespace v8::internal | 9741 } } // namespace v8::internal |
| 9736 | 9742 |
| 9737 #endif // V8_OBJECTS_H_ | 9743 #endif // V8_OBJECTS_H_ |
| OLD | NEW |