| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ | 290 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ |
| 291 V(JS_GLOBAL_OBJECT_TYPE) \ | 291 V(JS_GLOBAL_OBJECT_TYPE) \ |
| 292 V(JS_BUILTINS_OBJECT_TYPE) \ | 292 V(JS_BUILTINS_OBJECT_TYPE) \ |
| 293 V(JS_GLOBAL_PROXY_TYPE) \ | 293 V(JS_GLOBAL_PROXY_TYPE) \ |
| 294 V(JS_ARRAY_TYPE) \ | 294 V(JS_ARRAY_TYPE) \ |
| 295 V(JS_REGEXP_TYPE) \ | 295 V(JS_REGEXP_TYPE) \ |
| 296 \ | 296 \ |
| 297 V(JS_FUNCTION_TYPE) \ | 297 V(JS_FUNCTION_TYPE) \ |
| 298 | 298 |
| 299 | 299 |
| 300 |
| 300 // Since string types are not consecutive, this macro is used to | 301 // Since string types are not consecutive, this macro is used to |
| 301 // iterate over them. | 302 // iterate over them. |
| 302 #define STRING_TYPE_LIST(V) \ | 303 #define STRING_TYPE_LIST(V) \ |
| 303 V(SHORT_SYMBOL_TYPE, SeqTwoByteString::kAlignedSize, short_symbol) \ | 304 V(SHORT_SYMBOL_TYPE, \ |
| 304 V(MEDIUM_SYMBOL_TYPE, SeqTwoByteString::kAlignedSize, medium_symbol) \ | 305 SeqTwoByteString::kAlignedSize, \ |
| 305 V(LONG_SYMBOL_TYPE, SeqTwoByteString::kAlignedSize, long_symbol) \ | 306 short_symbol, \ |
| 306 V(SHORT_ASCII_SYMBOL_TYPE, SeqAsciiString::kAlignedSize, short_ascii_symbol) \ | 307 ShortSymbol) \ |
| 308 V(MEDIUM_SYMBOL_TYPE, \ |
| 309 SeqTwoByteString::kAlignedSize, \ |
| 310 medium_symbol, \ |
| 311 MediumSymbol) \ |
| 312 V(LONG_SYMBOL_TYPE, \ |
| 313 SeqTwoByteString::kAlignedSize, \ |
| 314 long_symbol, \ |
| 315 LongSymbol) \ |
| 316 V(SHORT_ASCII_SYMBOL_TYPE, \ |
| 317 SeqAsciiString::kAlignedSize, \ |
| 318 short_ascii_symbol, \ |
| 319 ShortAsciiSymbol) \ |
| 307 V(MEDIUM_ASCII_SYMBOL_TYPE, \ | 320 V(MEDIUM_ASCII_SYMBOL_TYPE, \ |
| 308 SeqAsciiString::kAlignedSize, \ | 321 SeqAsciiString::kAlignedSize, \ |
| 309 medium_ascii_symbol) \ | 322 medium_ascii_symbol, \ |
| 310 V(LONG_ASCII_SYMBOL_TYPE, SeqAsciiString::kAlignedSize, long_ascii_symbol) \ | 323 MediumAsciiSymbol) \ |
| 311 V(SHORT_CONS_SYMBOL_TYPE, ConsString::kSize, short_cons_symbol) \ | 324 V(LONG_ASCII_SYMBOL_TYPE, \ |
| 312 V(MEDIUM_CONS_SYMBOL_TYPE, ConsString::kSize, medium_cons_symbol) \ | 325 SeqAsciiString::kAlignedSize, \ |
| 313 V(LONG_CONS_SYMBOL_TYPE, ConsString::kSize, long_cons_symbol) \ | 326 long_ascii_symbol, \ |
| 314 V(SHORT_CONS_ASCII_SYMBOL_TYPE, ConsString::kSize, short_cons_ascii_symbol) \ | 327 LongAsciiSymbol) \ |
| 315 V(MEDIUM_CONS_ASCII_SYMBOL_TYPE, ConsString::kSize, medium_cons_ascii_symbol)\ | 328 V(SHORT_CONS_SYMBOL_TYPE, \ |
| 316 V(LONG_CONS_ASCII_SYMBOL_TYPE, ConsString::kSize, long_cons_ascii_symbol) \ | 329 ConsString::kSize, \ |
| 317 V(SHORT_SLICED_SYMBOL_TYPE, SlicedString::kSize, short_sliced_symbol) \ | 330 short_cons_symbol, \ |
| 318 V(MEDIUM_SLICED_SYMBOL_TYPE, SlicedString::kSize, medium_sliced_symbol) \ | 331 ShortConsSymbol) \ |
| 319 V(LONG_SLICED_SYMBOL_TYPE, SlicedString::kSize, long_sliced_symbol) \ | 332 V(MEDIUM_CONS_SYMBOL_TYPE, \ |
| 333 ConsString::kSize, \ |
| 334 medium_cons_symbol, \ |
| 335 MediumConsSymbol) \ |
| 336 V(LONG_CONS_SYMBOL_TYPE, \ |
| 337 ConsString::kSize, \ |
| 338 long_cons_symbol, \ |
| 339 LongConsSymbol) \ |
| 340 V(SHORT_CONS_ASCII_SYMBOL_TYPE, \ |
| 341 ConsString::kSize, \ |
| 342 short_cons_ascii_symbol, \ |
| 343 ShortConsAsciiSymbol) \ |
| 344 V(MEDIUM_CONS_ASCII_SYMBOL_TYPE, \ |
| 345 ConsString::kSize, \ |
| 346 medium_cons_ascii_symbol, \ |
| 347 MediumConsAsciiSymbol) \ |
| 348 V(LONG_CONS_ASCII_SYMBOL_TYPE, \ |
| 349 ConsString::kSize, \ |
| 350 long_cons_ascii_symbol, \ |
| 351 LongConsAsciiSymbol) \ |
| 352 V(SHORT_SLICED_SYMBOL_TYPE, \ |
| 353 SlicedString::kSize, \ |
| 354 short_sliced_symbol, \ |
| 355 ShortSlicedSymbol) \ |
| 356 V(MEDIUM_SLICED_SYMBOL_TYPE, \ |
| 357 SlicedString::kSize, \ |
| 358 medium_sliced_symbol, \ |
| 359 MediumSlicedSymbol) \ |
| 360 V(LONG_SLICED_SYMBOL_TYPE, \ |
| 361 SlicedString::kSize, \ |
| 362 long_sliced_symbol, \ |
| 363 LongSlicedSymbol) \ |
| 320 V(SHORT_SLICED_ASCII_SYMBOL_TYPE, \ | 364 V(SHORT_SLICED_ASCII_SYMBOL_TYPE, \ |
| 321 SlicedString::kSize, \ | 365 SlicedString::kSize, \ |
| 322 short_sliced_ascii_symbol) \ | 366 short_sliced_ascii_symbol, \ |
| 367 ShortSlicedAsciiSymbol) \ |
| 323 V(MEDIUM_SLICED_ASCII_SYMBOL_TYPE, \ | 368 V(MEDIUM_SLICED_ASCII_SYMBOL_TYPE, \ |
| 324 SlicedString::kSize, \ | 369 SlicedString::kSize, \ |
| 325 medium_sliced_ascii_symbol) \ | 370 medium_sliced_ascii_symbol, \ |
| 371 MediumSlicedAsciiSymbol) \ |
| 326 V(LONG_SLICED_ASCII_SYMBOL_TYPE, \ | 372 V(LONG_SLICED_ASCII_SYMBOL_TYPE, \ |
| 327 SlicedString::kSize, \ | 373 SlicedString::kSize, \ |
| 328 long_sliced_ascii_symbol) \ | 374 long_sliced_ascii_symbol, \ |
| 375 LongSlicedAsciiSymbol) \ |
| 329 V(SHORT_EXTERNAL_SYMBOL_TYPE, \ | 376 V(SHORT_EXTERNAL_SYMBOL_TYPE, \ |
| 330 ExternalTwoByteString::kSize, \ | 377 ExternalTwoByteString::kSize, \ |
| 331 short_external_symbol) \ | 378 short_external_symbol, \ |
| 379 ShortExternalSymbol) \ |
| 332 V(MEDIUM_EXTERNAL_SYMBOL_TYPE, \ | 380 V(MEDIUM_EXTERNAL_SYMBOL_TYPE, \ |
| 333 ExternalTwoByteString::kSize, \ | 381 ExternalTwoByteString::kSize, \ |
| 334 medium_external_symbol) \ | 382 medium_external_symbol, \ |
| 383 MediumExternalSymbol) \ |
| 335 V(LONG_EXTERNAL_SYMBOL_TYPE, \ | 384 V(LONG_EXTERNAL_SYMBOL_TYPE, \ |
| 336 ExternalTwoByteString::kSize, \ | 385 ExternalTwoByteString::kSize, \ |
| 337 long_external_symbol) \ | 386 long_external_symbol, \ |
| 387 LongExternalSymbol) \ |
| 338 V(SHORT_EXTERNAL_ASCII_SYMBOL_TYPE, \ | 388 V(SHORT_EXTERNAL_ASCII_SYMBOL_TYPE, \ |
| 339 ExternalAsciiString::kSize, \ | 389 ExternalAsciiString::kSize, \ |
| 340 short_external_ascii_symbol) \ | 390 short_external_ascii_symbol, \ |
| 391 ShortExternalAsciiSymbol) \ |
| 341 V(MEDIUM_EXTERNAL_ASCII_SYMBOL_TYPE, \ | 392 V(MEDIUM_EXTERNAL_ASCII_SYMBOL_TYPE, \ |
| 342 ExternalAsciiString::kSize, \ | 393 ExternalAsciiString::kSize, \ |
| 343 medium_external_ascii_symbol) \ | 394 medium_external_ascii_symbol, \ |
| 395 MediumExternalAsciiSymbol) \ |
| 344 V(LONG_EXTERNAL_ASCII_SYMBOL_TYPE, \ | 396 V(LONG_EXTERNAL_ASCII_SYMBOL_TYPE, \ |
| 345 ExternalAsciiString::kSize, \ | 397 ExternalAsciiString::kSize, \ |
| 346 long_external_ascii_symbol) \ | 398 long_external_ascii_symbol, \ |
| 347 V(SHORT_STRING_TYPE, SeqTwoByteString::kAlignedSize, short_string) \ | 399 LongExternalAsciiSymbol) \ |
| 348 V(MEDIUM_STRING_TYPE, SeqTwoByteString::kAlignedSize, medium_string) \ | 400 V(SHORT_STRING_TYPE, \ |
| 349 V(LONG_STRING_TYPE, SeqTwoByteString::kAlignedSize, long_string) \ | 401 SeqTwoByteString::kAlignedSize, \ |
| 350 V(SHORT_ASCII_STRING_TYPE, SeqAsciiString::kAlignedSize, short_ascii_string) \ | 402 short_string, \ |
| 403 ShortString) \ |
| 404 V(MEDIUM_STRING_TYPE, \ |
| 405 SeqTwoByteString::kAlignedSize, \ |
| 406 medium_string, \ |
| 407 MediumString) \ |
| 408 V(LONG_STRING_TYPE, \ |
| 409 SeqTwoByteString::kAlignedSize, \ |
| 410 long_string, \ |
| 411 LongString) \ |
| 412 V(SHORT_ASCII_STRING_TYPE, \ |
| 413 SeqAsciiString::kAlignedSize, \ |
| 414 short_ascii_string, \ |
| 415 ShortAsciiString) \ |
| 351 V(MEDIUM_ASCII_STRING_TYPE, \ | 416 V(MEDIUM_ASCII_STRING_TYPE, \ |
| 352 SeqAsciiString::kAlignedSize, \ | 417 SeqAsciiString::kAlignedSize, \ |
| 353 medium_ascii_string) \ | 418 medium_ascii_string, \ |
| 354 V(LONG_ASCII_STRING_TYPE, SeqAsciiString::kAlignedSize, long_ascii_string) \ | 419 MediumAsciiString) \ |
| 355 V(SHORT_CONS_STRING_TYPE, ConsString::kSize, short_cons_string) \ | 420 V(LONG_ASCII_STRING_TYPE, \ |
| 356 V(MEDIUM_CONS_STRING_TYPE, ConsString::kSize, medium_cons_string) \ | 421 SeqAsciiString::kAlignedSize, \ |
| 357 V(LONG_CONS_STRING_TYPE, ConsString::kSize, long_cons_string) \ | 422 long_ascii_string, \ |
| 358 V(SHORT_CONS_ASCII_STRING_TYPE, ConsString::kSize, short_cons_ascii_string) \ | 423 LongAsciiString) \ |
| 359 V(MEDIUM_CONS_ASCII_STRING_TYPE, ConsString::kSize, medium_cons_ascii_string)\ | 424 V(SHORT_CONS_STRING_TYPE, \ |
| 360 V(LONG_CONS_ASCII_STRING_TYPE, ConsString::kSize, long_cons_ascii_string) \ | 425 ConsString::kSize, \ |
| 361 V(SHORT_SLICED_STRING_TYPE, SlicedString::kSize, short_sliced_string) \ | 426 short_cons_string, \ |
| 362 V(MEDIUM_SLICED_STRING_TYPE, SlicedString::kSize, medium_sliced_string) \ | 427 ShortConsString) \ |
| 363 V(LONG_SLICED_STRING_TYPE, SlicedString::kSize, long_sliced_string) \ | 428 V(MEDIUM_CONS_STRING_TYPE, \ |
| 429 ConsString::kSize, \ |
| 430 medium_cons_string, \ |
| 431 MediumConsString) \ |
| 432 V(LONG_CONS_STRING_TYPE, \ |
| 433 ConsString::kSize, \ |
| 434 long_cons_string, \ |
| 435 LongConsString) \ |
| 436 V(SHORT_CONS_ASCII_STRING_TYPE, \ |
| 437 ConsString::kSize, \ |
| 438 short_cons_ascii_string, \ |
| 439 ShortConsAsciiString) \ |
| 440 V(MEDIUM_CONS_ASCII_STRING_TYPE, \ |
| 441 ConsString::kSize, \ |
| 442 medium_cons_ascii_string, \ |
| 443 MediumConsAsciiString) \ |
| 444 V(LONG_CONS_ASCII_STRING_TYPE, \ |
| 445 ConsString::kSize, \ |
| 446 long_cons_ascii_string, \ |
| 447 LongConsAsciiString) \ |
| 448 V(SHORT_SLICED_STRING_TYPE, \ |
| 449 SlicedString::kSize, \ |
| 450 short_sliced_string, \ |
| 451 ShortSlicedString) \ |
| 452 V(MEDIUM_SLICED_STRING_TYPE, \ |
| 453 SlicedString::kSize, \ |
| 454 medium_sliced_string, \ |
| 455 MediumSlicedString) \ |
| 456 V(LONG_SLICED_STRING_TYPE, \ |
| 457 SlicedString::kSize, \ |
| 458 long_sliced_string, \ |
| 459 LongSlicedString) \ |
| 364 V(SHORT_SLICED_ASCII_STRING_TYPE, \ | 460 V(SHORT_SLICED_ASCII_STRING_TYPE, \ |
| 365 SlicedString::kSize, \ | 461 SlicedString::kSize, \ |
| 366 short_sliced_ascii_string) \ | 462 short_sliced_ascii_string, \ |
| 463 ShortSlicedAsciiString) \ |
| 367 V(MEDIUM_SLICED_ASCII_STRING_TYPE, \ | 464 V(MEDIUM_SLICED_ASCII_STRING_TYPE, \ |
| 368 SlicedString::kSize, \ | 465 SlicedString::kSize, \ |
| 369 medium_sliced_ascii_string) \ | 466 medium_sliced_ascii_string, \ |
| 467 MediumSlicedAsciiString) \ |
| 370 V(LONG_SLICED_ASCII_STRING_TYPE, \ | 468 V(LONG_SLICED_ASCII_STRING_TYPE, \ |
| 371 SlicedString::kSize, \ | 469 SlicedString::kSize, \ |
| 372 long_sliced_ascii_string) \ | 470 long_sliced_ascii_string, \ |
| 471 LongSlicedAsciiString) \ |
| 373 V(SHORT_EXTERNAL_STRING_TYPE, \ | 472 V(SHORT_EXTERNAL_STRING_TYPE, \ |
| 374 ExternalTwoByteString::kSize, \ | 473 ExternalTwoByteString::kSize, \ |
| 375 short_external_string) \ | 474 short_external_string, \ |
| 475 ShortExternalString) \ |
| 376 V(MEDIUM_EXTERNAL_STRING_TYPE, \ | 476 V(MEDIUM_EXTERNAL_STRING_TYPE, \ |
| 377 ExternalTwoByteString::kSize, \ | 477 ExternalTwoByteString::kSize, \ |
| 378 medium_external_string) \ | 478 medium_external_string, \ |
| 479 MediumExternalString) \ |
| 379 V(LONG_EXTERNAL_STRING_TYPE, \ | 480 V(LONG_EXTERNAL_STRING_TYPE, \ |
| 380 ExternalTwoByteString::kSize, \ | 481 ExternalTwoByteString::kSize, \ |
| 381 long_external_string) \ | 482 long_external_string, \ |
| 483 LongExternalString) \ |
| 382 V(SHORT_EXTERNAL_ASCII_STRING_TYPE, \ | 484 V(SHORT_EXTERNAL_ASCII_STRING_TYPE, \ |
| 383 ExternalAsciiString::kSize, \ | 485 ExternalAsciiString::kSize, \ |
| 384 short_external_ascii_string) \ | 486 short_external_ascii_string, \ |
| 487 ShortExternalAsciiString) \ |
| 385 V(MEDIUM_EXTERNAL_ASCII_STRING_TYPE, \ | 488 V(MEDIUM_EXTERNAL_ASCII_STRING_TYPE, \ |
| 386 ExternalAsciiString::kSize, \ | 489 ExternalAsciiString::kSize, \ |
| 387 medium_external_ascii_string) \ | 490 medium_external_ascii_string, \ |
| 491 MediumExternalAsciiString) \ |
| 388 V(LONG_EXTERNAL_ASCII_STRING_TYPE, \ | 492 V(LONG_EXTERNAL_ASCII_STRING_TYPE, \ |
| 389 ExternalAsciiString::kSize, \ | 493 ExternalAsciiString::kSize, \ |
| 390 long_external_ascii_string) | 494 long_external_ascii_string, \ |
| 495 LongExternalAsciiString) |
| 391 | 496 |
| 392 // A struct is a simple object a set of object-valued fields. Including an | 497 // A struct is a simple object a set of object-valued fields. Including an |
| 393 // object type in this causes the compiler to generate most of the boilerplate | 498 // object type in this causes the compiler to generate most of the boilerplate |
| 394 // code for the class including allocation and garbage collection routines, | 499 // code for the class including allocation and garbage collection routines, |
| 395 // casts and predicates. All you need to define is the class, methods and | 500 // casts and predicates. All you need to define is the class, methods and |
| 396 // object verification routines. Easy, no? | 501 // object verification routines. Easy, no? |
| 397 // | 502 // |
| 398 // Note that for subtle reasons related to the ordering or numerical values of | 503 // Note that for subtle reasons related to the ordering or numerical values of |
| 399 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST | 504 // type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST |
| 400 // manually. | 505 // manually. |
| (...skipping 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4616 } else { | 4721 } else { |
| 4617 value &= ~(1 << bit_position); | 4722 value &= ~(1 << bit_position); |
| 4618 } | 4723 } |
| 4619 return value; | 4724 return value; |
| 4620 } | 4725 } |
| 4621 }; | 4726 }; |
| 4622 | 4727 |
| 4623 } } // namespace v8::internal | 4728 } } // namespace v8::internal |
| 4624 | 4729 |
| 4625 #endif // V8_OBJECTS_H_ | 4730 #endif // V8_OBJECTS_H_ |
| OLD | NEW |