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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 #ifdef ENABLE_DEBUGGER_SUPPORT | 427 #ifdef ENABLE_DEBUGGER_SUPPORT |
428 Handle<Code> CompileCallDebugBreak(Code::Flags flags); | 428 Handle<Code> CompileCallDebugBreak(Code::Flags flags); |
429 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); | 429 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); |
430 #endif | 430 #endif |
431 | 431 |
432 // Static functions for generating parts of stubs. | 432 // Static functions for generating parts of stubs. |
433 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 433 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
434 int index, | 434 int index, |
435 Register prototype); | 435 Register prototype); |
436 | 436 |
| 437 // Helper function used to check that the dictionary doesn't contain |
| 438 // the property. This function may return false negatives, so miss_label |
| 439 // must always call a backup property check that is complete. |
| 440 // This function is safe to call if the receiver has fast properties. |
| 441 // Name must be unique and receiver must be a heap object. |
| 442 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
| 443 Label* miss_label, |
| 444 Register receiver, |
| 445 Handle<Name> name, |
| 446 Register r0, |
| 447 Register r1); |
| 448 |
437 // Generates prototype loading code that uses the objects from the | 449 // Generates prototype loading code that uses the objects from the |
438 // context we were in when this function was called. If the context | 450 // context we were in when this function was called. If the context |
439 // has changed, a jump to miss is performed. This ties the generated | 451 // has changed, a jump to miss is performed. This ties the generated |
440 // code to a particular context and so must not be used in cases | 452 // code to a particular context and so must not be used in cases |
441 // where the generated code is not allowed to have references to | 453 // where the generated code is not allowed to have references to |
442 // objects from a context. | 454 // objects from a context. |
443 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, | 455 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, |
444 int index, | 456 int index, |
445 Register prototype, | 457 Register prototype, |
446 Label* miss); | 458 Label* miss); |
(...skipping 15 matching lines...) Expand all Loading... |
462 Register scratch1, | 474 Register scratch1, |
463 Register scratch2, | 475 Register scratch2, |
464 Label* miss_label); | 476 Label* miss_label); |
465 | 477 |
466 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, | 478 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, |
467 Register receiver, | 479 Register receiver, |
468 Register scratch1, | 480 Register scratch1, |
469 Register scratch2, | 481 Register scratch2, |
470 Label* miss_label); | 482 Label* miss_label); |
471 | 483 |
| 484 // Generate code to check that a global property cell is empty. Create |
| 485 // the property cell at compilation time if no cell exists for the |
| 486 // property. |
| 487 static void GenerateCheckPropertyCell(MacroAssembler* masm, |
| 488 Handle<GlobalObject> global, |
| 489 Handle<Name> name, |
| 490 Register scratch, |
| 491 Label* miss); |
| 492 |
| 493 // Calls GenerateCheckPropertyCell for each global object in the prototype |
| 494 // chain from object to (but not including) holder. |
| 495 static void GenerateCheckPropertyCells(MacroAssembler* masm, |
| 496 Handle<JSObject> object, |
| 497 Handle<JSObject> holder, |
| 498 Handle<Name> name, |
| 499 Register scratch, |
| 500 Label* miss); |
| 501 |
472 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); | 502 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); |
473 | 503 |
474 // Generates code that verifies that the property holder has not changed | 504 // Generates code that verifies that the property holder has not changed |
475 // (checking maps of objects in the prototype chain for fast and global | 505 // (checking maps of objects in the prototype chain for fast and global |
476 // objects or doing negative lookup for slow objects, ensures that the | 506 // objects or doing negative lookup for slow objects, ensures that the |
477 // property cells for global objects are still empty) and checks that the map | 507 // property cells for global objects are still empty) and checks that the map |
478 // of the holder has not changed. If necessary the function also generates | 508 // of the holder has not changed. If necessary the function also generates |
479 // code for security check in case of global object holders. Helps to make | 509 // code for security check in case of global object holders. Helps to make |
480 // sure that the current IC is still valid. | 510 // sure that the current IC is still valid. |
481 // | 511 // |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 Handle<JSFunction> constant_function_; | 1098 Handle<JSFunction> constant_function_; |
1069 bool is_simple_api_call_; | 1099 bool is_simple_api_call_; |
1070 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1100 Handle<FunctionTemplateInfo> expected_receiver_type_; |
1071 Handle<CallHandlerInfo> api_call_info_; | 1101 Handle<CallHandlerInfo> api_call_info_; |
1072 }; | 1102 }; |
1073 | 1103 |
1074 | 1104 |
1075 } } // namespace v8::internal | 1105 } } // namespace v8::internal |
1076 | 1106 |
1077 #endif // V8_STUB_CACHE_H_ | 1107 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |