| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 
| 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 
| 7 | 7 | 
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" | 
| 9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" | 
| 10 #include "src/frames.h" | 10 #include "src/frames.h" | 
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 253   // Leave the current exit frame. Expects the return value in | 253   // Leave the current exit frame. Expects the return value in | 
| 254   // register eax (untouched). | 254   // register eax (untouched). | 
| 255   void LeaveApiExitFrame(bool restore_context); | 255   void LeaveApiExitFrame(bool restore_context); | 
| 256 | 256 | 
| 257   // Find the function context up the context chain. | 257   // Find the function context up the context chain. | 
| 258   void LoadContext(Register dst, int context_chain_length); | 258   void LoadContext(Register dst, int context_chain_length); | 
| 259 | 259 | 
| 260   // Load the global proxy from the current context. | 260   // Load the global proxy from the current context. | 
| 261   void LoadGlobalProxy(Register dst); | 261   void LoadGlobalProxy(Register dst); | 
| 262 | 262 | 
| 263   // Conditionally load the cached Array transitioned map of type |  | 
| 264   // transitioned_kind from the native context if the map in register |  | 
| 265   // map_in_out is the cached Array map in the native context of |  | 
| 266   // expected_kind. |  | 
| 267   void LoadTransitionedArrayMapConditional(ElementsKind expected_kind, |  | 
| 268                                            ElementsKind transitioned_kind, |  | 
| 269                                            Register map_in_out, |  | 
| 270                                            Register scratch, |  | 
| 271                                            Label* no_map_match); |  | 
| 272 |  | 
| 273   // Load the global function with the given index. | 263   // Load the global function with the given index. | 
| 274   void LoadGlobalFunction(int index, Register function); | 264   void LoadGlobalFunction(int index, Register function); | 
| 275 | 265 | 
| 276   // Load the initial map from the global function. The registers | 266   // Load the initial map from the global function. The registers | 
| 277   // function and map can be the same. | 267   // function and map can be the same. | 
| 278   void LoadGlobalFunctionInitialMap(Register function, Register map); | 268   void LoadGlobalFunctionInitialMap(Register function, Register map); | 
| 279 | 269 | 
| 280   // Push and pop the registers that can hold pointers. | 270   // Push and pop the registers that can hold pointers. | 
| 281   void PushSafepointRegisters() { pushad(); } | 271   void PushSafepointRegisters() { pushad(); } | 
| 282   void PopSafepointRegisters() { popad(); } | 272   void PopSafepointRegisters() { popad(); } | 
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 384   void SafeMove(Register dst, const Immediate& x); | 374   void SafeMove(Register dst, const Immediate& x); | 
| 385   void SafePush(const Immediate& x); | 375   void SafePush(const Immediate& x); | 
| 386 | 376 | 
| 387   // Compare object type for heap object. | 377   // Compare object type for heap object. | 
| 388   // Incoming register is heap_object and outgoing register is map. | 378   // Incoming register is heap_object and outgoing register is map. | 
| 389   void CmpObjectType(Register heap_object, InstanceType type, Register map); | 379   void CmpObjectType(Register heap_object, InstanceType type, Register map); | 
| 390 | 380 | 
| 391   // Compare instance type for map. | 381   // Compare instance type for map. | 
| 392   void CmpInstanceType(Register map, InstanceType type); | 382   void CmpInstanceType(Register map, InstanceType type); | 
| 393 | 383 | 
| 394   // Check if a map for a JSObject indicates that the object can have both smi |  | 
| 395   // and HeapObject elements.  Jump to the specified label if it does not. |  | 
| 396   void CheckFastObjectElements(Register map, Label* fail, |  | 
| 397                                Label::Distance distance = Label::kFar); |  | 
| 398 |  | 
| 399   // Check if a map for a JSObject indicates that the object has fast smi only |  | 
| 400   // elements.  Jump to the specified label if it does not. |  | 
| 401   void CheckFastSmiElements(Register map, Label* fail, |  | 
| 402                             Label::Distance distance = Label::kFar); |  | 
| 403 |  | 
| 404   // Check to see if maybe_number can be stored as a double in |  | 
| 405   // FastDoubleElements. If it can, store it at the index specified by key in |  | 
| 406   // the FastDoubleElements array elements, otherwise jump to fail. |  | 
| 407   void StoreNumberToDoubleElements(Register maybe_number, Register elements, |  | 
| 408                                    Register key, Register scratch1, |  | 
| 409                                    XMMRegister scratch2, Label* fail, |  | 
| 410                                    int offset = 0); |  | 
| 411 |  | 
| 412   // Compare an object's map with the specified map. | 384   // Compare an object's map with the specified map. | 
| 413   void CompareMap(Register obj, Handle<Map> map); | 385   void CompareMap(Register obj, Handle<Map> map); | 
| 414 | 386 | 
| 415   // Check if the map of an object is equal to a specified map and branch to | 387   // Check if the map of an object is equal to a specified map and branch to | 
| 416   // label if not. Skip the smi check if not required (object is known to be a | 388   // label if not. Skip the smi check if not required (object is known to be a | 
| 417   // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match | 389   // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match | 
| 418   // against maps that are ElementsKind transition maps of the specified map. | 390   // against maps that are ElementsKind transition maps of the specified map. | 
| 419   void CheckMap(Register obj, Handle<Map> map, Label* fail, | 391   void CheckMap(Register obj, Handle<Map> map, Label* fail, | 
| 420                 SmiCheckType smi_check_type); | 392                 SmiCheckType smi_check_type); | 
| 421 | 393 | 
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 936   // AllocationMemento support. Arrays may have an associated | 908   // AllocationMemento support. Arrays may have an associated | 
| 937   // AllocationMemento object that can be checked for in order to pretransition | 909   // AllocationMemento object that can be checked for in order to pretransition | 
| 938   // to another type. | 910   // to another type. | 
| 939   // On entry, receiver_reg should point to the array object. | 911   // On entry, receiver_reg should point to the array object. | 
| 940   // scratch_reg gets clobbered. | 912   // scratch_reg gets clobbered. | 
| 941   // If allocation info is present, conditional code is set to equal. | 913   // If allocation info is present, conditional code is set to equal. | 
| 942   void TestJSArrayForAllocationMemento(Register receiver_reg, | 914   void TestJSArrayForAllocationMemento(Register receiver_reg, | 
| 943                                        Register scratch_reg, | 915                                        Register scratch_reg, | 
| 944                                        Label* no_memento_found); | 916                                        Label* no_memento_found); | 
| 945 | 917 | 
| 946   void JumpIfJSArrayHasAllocationMemento(Register receiver_reg, |  | 
| 947                                          Register scratch_reg, |  | 
| 948                                          Label* memento_found) { |  | 
| 949     Label no_memento_found; |  | 
| 950     TestJSArrayForAllocationMemento(receiver_reg, scratch_reg, |  | 
| 951                                     &no_memento_found); |  | 
| 952     j(equal, memento_found); |  | 
| 953     bind(&no_memento_found); |  | 
| 954   } |  | 
| 955 |  | 
| 956   // Jumps to found label if a prototype map has dictionary elements. |  | 
| 957   void JumpIfDictionaryInPrototypeChain(Register object, Register scratch0, |  | 
| 958                                         Register scratch1, Label* found); |  | 
| 959 |  | 
| 960  private: | 918  private: | 
| 961   bool generating_stub_; | 919   bool generating_stub_; | 
| 962   bool has_frame_; | 920   bool has_frame_; | 
| 963   // This handle will be patched with the code object on installation. | 921   // This handle will be patched with the code object on installation. | 
| 964   Handle<Object> code_object_; | 922   Handle<Object> code_object_; | 
| 965 | 923 | 
| 966   // Helper functions for generating invokes. | 924   // Helper functions for generating invokes. | 
| 967   void InvokePrologue(const ParameterCount& expected, | 925   void InvokePrologue(const ParameterCount& expected, | 
| 968                       const ParameterCount& actual, Label* done, | 926                       const ParameterCount& actual, Label* done, | 
| 969                       bool* definitely_mismatches, InvokeFlag flag, | 927                       bool* definitely_mismatches, InvokeFlag flag, | 
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1053 inline Operand NativeContextOperand() { | 1011 inline Operand NativeContextOperand() { | 
| 1054   return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); | 1012   return ContextOperand(esi, Context::NATIVE_CONTEXT_INDEX); | 
| 1055 } | 1013 } | 
| 1056 | 1014 | 
| 1057 #define ACCESS_MASM(masm) masm-> | 1015 #define ACCESS_MASM(masm) masm-> | 
| 1058 | 1016 | 
| 1059 }  // namespace internal | 1017 }  // namespace internal | 
| 1060 }  // namespace v8 | 1018 }  // namespace v8 | 
| 1061 | 1019 | 
| 1062 #endif  // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1020 #endif  // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 
| OLD | NEW | 
|---|