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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 436 |
437 // Generate code to check that a global property cell is empty. Create | 437 // Generate code to check that a global property cell is empty. Create |
438 // the property cell at compilation time if no cell exists for the | 438 // the property cell at compilation time if no cell exists for the |
439 // property. | 439 // property. |
440 static void GenerateCheckPropertyCell(MacroAssembler* masm, | 440 static void GenerateCheckPropertyCell(MacroAssembler* masm, |
441 Handle<JSGlobalObject> global, | 441 Handle<JSGlobalObject> global, |
442 Handle<Name> name, | 442 Handle<Name> name, |
443 Register scratch, | 443 Register scratch, |
444 Label* miss); | 444 Label* miss); |
445 | 445 |
446 // Calls GenerateCheckPropertyCell for each global object in the prototype | |
447 // chain from object to (but not including) holder. | |
448 static void GenerateCheckPropertyCells(MacroAssembler* masm, | |
449 Handle<JSObject> object, | |
450 Handle<JSObject> holder, | |
451 Handle<Name> name, | |
452 Register scratch, | |
453 Label* miss); | |
454 | |
455 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); | 446 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); |
456 | 447 |
457 // Generates code that verifies that the property holder has not changed | 448 // Generates code that verifies that the property holder has not changed |
458 // (checking maps of objects in the prototype chain for fast and global | 449 // (checking maps of objects in the prototype chain for fast and global |
459 // objects or doing negative lookup for slow objects, ensures that the | 450 // objects or doing negative lookup for slow objects, ensures that the |
460 // property cells for global objects are still empty) and checks that the map | 451 // property cells for global objects are still empty) and checks that the map |
461 // of the holder has not changed. If necessary the function also generates | 452 // of the holder has not changed. If necessary the function also generates |
462 // code for security check in case of global object holders. Helps to make | 453 // code for security check in case of global object holders. Helps to make |
463 // sure that the current IC is still valid. | 454 // sure that the current IC is still valid. |
464 // | 455 // |
465 // The scratch and holder registers are always clobbered, but the object | 456 // The scratch and holder registers are always clobbered, but the object |
466 // register is only clobbered if it the same as the holder register. The | 457 // register is only clobbered if it the same as the holder register. The |
467 // function returns a register containing the holder - either object_reg or | 458 // function returns a register containing the holder - either object_reg or |
468 // holder_reg. | 459 // holder_reg. |
469 // The function can optionally (when save_at_depth != | 460 // The function can optionally (when save_at_depth != |
470 // kInvalidProtoDepth) save the object at the given depth by moving | 461 // kInvalidProtoDepth) save the object at the given depth by moving |
471 // it to [esp + kPointerSize]. | 462 // it to [esp + kPointerSize]. |
472 Register CheckPrototypes(Handle<JSObject> object, | 463 Register CheckPrototypes(Handle<Type> type, |
473 Register object_reg, | 464 Register object_reg, |
474 Handle<JSObject> holder, | 465 Handle<JSObject> holder, |
475 Register holder_reg, | 466 Register holder_reg, |
476 Register scratch1, | 467 Register scratch1, |
477 Register scratch2, | 468 Register scratch2, |
478 Handle<Name> name, | 469 Handle<Name> name, |
479 Label* miss, | 470 Label* miss, |
480 PrototypeCheckType check = CHECK_ALL_MAPS) { | 471 PrototypeCheckType check = CHECK_ALL_MAPS) { |
481 return CheckPrototypes(object, object_reg, holder, holder_reg, scratch1, | 472 return CheckPrototypes(type, object_reg, holder, holder_reg, scratch1, |
482 scratch2, name, kInvalidProtoDepth, miss, check); | 473 scratch2, name, kInvalidProtoDepth, miss, check); |
483 } | 474 } |
484 | 475 |
485 Register CheckPrototypes(Handle<JSObject> object, | 476 Register CheckPrototypes(Handle<Type> type, |
486 Register object_reg, | 477 Register object_reg, |
487 Handle<JSObject> holder, | 478 Handle<JSObject> holder, |
488 Register holder_reg, | 479 Register holder_reg, |
489 Register scratch1, | 480 Register scratch1, |
490 Register scratch2, | 481 Register scratch2, |
491 Handle<Name> name, | 482 Handle<Name> name, |
492 int save_at_depth, | 483 int save_at_depth, |
493 Label* miss, | 484 Label* miss, |
494 PrototypeCheckType check = CHECK_ALL_MAPS); | 485 PrototypeCheckType check = CHECK_ALL_MAPS); |
495 | 486 |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 Handle<JSFunction> constant_function_; | 1041 Handle<JSFunction> constant_function_; |
1051 bool is_simple_api_call_; | 1042 bool is_simple_api_call_; |
1052 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1043 Handle<FunctionTemplateInfo> expected_receiver_type_; |
1053 Handle<CallHandlerInfo> api_call_info_; | 1044 Handle<CallHandlerInfo> api_call_info_; |
1054 }; | 1045 }; |
1055 | 1046 |
1056 | 1047 |
1057 } } // namespace v8::internal | 1048 } } // namespace v8::internal |
1058 | 1049 |
1059 #endif // V8_STUB_CACHE_H_ | 1050 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |