| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 \ | 56 \ |
| 57 V(HandleApiCall, NEEDS_CALLED_FUNCTION) \ | 57 V(HandleApiCall, NEEDS_CALLED_FUNCTION) \ |
| 58 V(FastHandleApiCall, NO_EXTRA_ARGUMENTS) \ | 58 V(FastHandleApiCall, NO_EXTRA_ARGUMENTS) \ |
| 59 V(HandleApiCallConstruct, NEEDS_CALLED_FUNCTION) \ | 59 V(HandleApiCallConstruct, NEEDS_CALLED_FUNCTION) \ |
| 60 V(HandleApiCallAsFunction, NO_EXTRA_ARGUMENTS) \ | 60 V(HandleApiCallAsFunction, NO_EXTRA_ARGUMENTS) \ |
| 61 V(HandleApiCallAsConstructor, NO_EXTRA_ARGUMENTS) | 61 V(HandleApiCallAsConstructor, NO_EXTRA_ARGUMENTS) |
| 62 | 62 |
| 63 | 63 |
| 64 // Define list of builtins implemented in assembly. | 64 // Define list of builtins implemented in assembly. |
| 65 #define BUILTIN_LIST_A(V) \ | 65 #define BUILTIN_LIST_A(V) \ |
| 66 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED) \ | 66 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, \ |
| 67 V(JSConstructCall, BUILTIN, UNINITIALIZED) \ | 67 Code::kNoExtraICState) \ |
| 68 V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED) \ | 68 V(JSConstructCall, BUILTIN, UNINITIALIZED, \ |
| 69 V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED) \ | 69 Code::kNoExtraICState) \ |
| 70 V(JSConstructStubApi, BUILTIN, UNINITIALIZED) \ | 70 V(JSConstructStubCountdown, BUILTIN, UNINITIALIZED, \ |
| 71 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED) \ | 71 Code::kNoExtraICState) \ |
| 72 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED) \ | 72 V(JSConstructStubGeneric, BUILTIN, UNINITIALIZED, \ |
| 73 V(LazyCompile, BUILTIN, UNINITIALIZED) \ | 73 Code::kNoExtraICState) \ |
| 74 V(LazyRecompile, BUILTIN, UNINITIALIZED) \ | 74 V(JSConstructStubApi, BUILTIN, UNINITIALIZED, \ |
| 75 V(NotifyDeoptimized, BUILTIN, UNINITIALIZED) \ | 75 Code::kNoExtraICState) \ |
| 76 V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED) \ | 76 V(JSEntryTrampoline, BUILTIN, UNINITIALIZED, \ |
| 77 V(NotifyOSR, BUILTIN, UNINITIALIZED) \ | 77 Code::kNoExtraICState) \ |
| 78 V(JSConstructEntryTrampoline, BUILTIN, UNINITIALIZED, \ |
| 79 Code::kNoExtraICState) \ |
| 80 V(LazyCompile, BUILTIN, UNINITIALIZED, \ |
| 81 Code::kNoExtraICState) \ |
| 82 V(LazyRecompile, BUILTIN, UNINITIALIZED, \ |
| 83 Code::kNoExtraICState) \ |
| 84 V(NotifyDeoptimized, BUILTIN, UNINITIALIZED, \ |
| 85 Code::kNoExtraICState) \ |
| 86 V(NotifyLazyDeoptimized, BUILTIN, UNINITIALIZED, \ |
| 87 Code::kNoExtraICState) \ |
| 88 V(NotifyOSR, BUILTIN, UNINITIALIZED, \ |
| 89 Code::kNoExtraICState) \ |
| 78 \ | 90 \ |
| 79 V(LoadIC_Miss, BUILTIN, UNINITIALIZED) \ | 91 V(LoadIC_Miss, BUILTIN, UNINITIALIZED, \ |
| 80 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED) \ | 92 Code::kNoExtraICState) \ |
| 81 V(StoreIC_Miss, BUILTIN, UNINITIALIZED) \ | 93 V(KeyedLoadIC_Miss, BUILTIN, UNINITIALIZED, \ |
| 82 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED) \ | 94 Code::kNoExtraICState) \ |
| 95 V(StoreIC_Miss, BUILTIN, UNINITIALIZED, \ |
| 96 Code::kNoExtraICState) \ |
| 97 V(KeyedStoreIC_Miss, BUILTIN, UNINITIALIZED, \ |
| 98 Code::kNoExtraICState) \ |
| 83 \ | 99 \ |
| 84 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED) \ | 100 V(LoadIC_Initialize, LOAD_IC, UNINITIALIZED, \ |
| 85 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC) \ | 101 Code::kNoExtraICState) \ |
| 86 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC) \ | 102 V(LoadIC_PreMonomorphic, LOAD_IC, PREMONOMORPHIC, \ |
| 87 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC) \ | 103 Code::kNoExtraICState) \ |
| 88 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC) \ | 104 V(LoadIC_Normal, LOAD_IC, MONOMORPHIC, \ |
| 89 V(LoadIC_StringWrapperLength, LOAD_IC, MONOMORPHIC) \ | 105 Code::kNoExtraICState) \ |
| 90 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC) \ | 106 V(LoadIC_ArrayLength, LOAD_IC, MONOMORPHIC, \ |
| 91 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC) \ | 107 Code::kNoExtraICState) \ |
| 108 V(LoadIC_StringLength, LOAD_IC, MONOMORPHIC, \ |
| 109 Code::kNoExtraICState) \ |
| 110 V(LoadIC_StringWrapperLength, LOAD_IC, MONOMORPHIC, \ |
| 111 Code::kNoExtraICState) \ |
| 112 V(LoadIC_FunctionPrototype, LOAD_IC, MONOMORPHIC, \ |
| 113 Code::kNoExtraICState) \ |
| 114 V(LoadIC_Megamorphic, LOAD_IC, MEGAMORPHIC, \ |
| 115 Code::kNoExtraICState) \ |
| 92 \ | 116 \ |
| 93 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED) \ | 117 V(KeyedLoadIC_Initialize, KEYED_LOAD_IC, UNINITIALIZED, \ |
| 94 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC) \ | 118 Code::kNoExtraICState) \ |
| 95 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC) \ | 119 V(KeyedLoadIC_PreMonomorphic, KEYED_LOAD_IC, PREMONOMORPHIC, \ |
| 96 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC) \ | 120 Code::kNoExtraICState) \ |
| 97 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MEGAMORPHIC) \ | 121 V(KeyedLoadIC_Generic, KEYED_LOAD_IC, MEGAMORPHIC, \ |
| 122 Code::kNoExtraICState) \ |
| 123 V(KeyedLoadIC_String, KEYED_LOAD_IC, MEGAMORPHIC, \ |
| 124 Code::kNoExtraICState) \ |
| 125 V(KeyedLoadIC_IndexedInterceptor, KEYED_LOAD_IC, MEGAMORPHIC, \ |
| 126 Code::kNoExtraICState) \ |
| 98 \ | 127 \ |
| 99 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED) \ | 128 V(StoreIC_Initialize, STORE_IC, UNINITIALIZED, \ |
| 100 V(StoreIC_ArrayLength, STORE_IC, MONOMORPHIC) \ | 129 Code::kNoExtraICState) \ |
| 101 V(StoreIC_Normal, STORE_IC, MONOMORPHIC) \ | 130 V(StoreIC_ArrayLength, STORE_IC, MONOMORPHIC, \ |
| 102 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC) \ | 131 Code::kNoExtraICState) \ |
| 103 V(StoreIC_GlobalProxy, STORE_IC, MEGAMORPHIC) \ | 132 V(StoreIC_Normal, STORE_IC, MONOMORPHIC, \ |
| 133 Code::kNoExtraICState) \ |
| 134 V(StoreIC_Megamorphic, STORE_IC, MEGAMORPHIC, \ |
| 135 Code::kNoExtraICState) \ |
| 136 V(StoreIC_GlobalProxy, STORE_IC, MEGAMORPHIC, \ |
| 137 Code::kNoExtraICState) \ |
| 138 V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \ |
| 139 StoreIC::kStoreICStrict) \ |
| 140 V(StoreIC_ArrayLength_Strict, STORE_IC, MONOMORPHIC, \ |
| 141 StoreIC::kStoreICStrict) \ |
| 142 V(StoreIC_Normal_Strict, STORE_IC, MONOMORPHIC, \ |
| 143 StoreIC::kStoreICStrict) \ |
| 144 V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ |
| 145 StoreIC::kStoreICStrict) \ |
| 146 V(StoreIC_GlobalProxy_Strict, STORE_IC, MEGAMORPHIC, \ |
| 147 StoreIC::kStoreICStrict) \ |
| 104 \ | 148 \ |
| 105 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED) \ | 149 V(KeyedStoreIC_Initialize, KEYED_STORE_IC, UNINITIALIZED, \ |
| 106 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC) \ | 150 Code::kNoExtraICState) \ |
| 151 V(KeyedStoreIC_Generic, KEYED_STORE_IC, MEGAMORPHIC, \ |
| 152 Code::kNoExtraICState) \ |
| 107 \ | 153 \ |
| 108 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ | 154 /* Uses KeyedLoadIC_Initialize; must be after in list. */ \ |
| 109 V(FunctionCall, BUILTIN, UNINITIALIZED) \ | 155 V(FunctionCall, BUILTIN, UNINITIALIZED, \ |
| 110 V(FunctionApply, BUILTIN, UNINITIALIZED) \ | 156 Code::kNoExtraICState) \ |
| 157 V(FunctionApply, BUILTIN, UNINITIALIZED, \ |
| 158 Code::kNoExtraICState) \ |
| 111 \ | 159 \ |
| 112 V(ArrayCode, BUILTIN, UNINITIALIZED) \ | 160 V(ArrayCode, BUILTIN, UNINITIALIZED, \ |
| 113 V(ArrayConstructCode, BUILTIN, UNINITIALIZED) \ | 161 Code::kNoExtraICState) \ |
| 162 V(ArrayConstructCode, BUILTIN, UNINITIALIZED, \ |
| 163 Code::kNoExtraICState) \ |
| 114 \ | 164 \ |
| 115 V(StringConstructCode, BUILTIN, UNINITIALIZED) \ | 165 V(StringConstructCode, BUILTIN, UNINITIALIZED, \ |
| 166 Code::kNoExtraICState) \ |
| 116 \ | 167 \ |
| 117 V(OnStackReplacement, BUILTIN, UNINITIALIZED) | 168 V(OnStackReplacement, BUILTIN, UNINITIALIZED, \ |
| 169 Code::kNoExtraICState) |
| 118 | 170 |
| 119 | 171 |
| 120 #ifdef ENABLE_DEBUGGER_SUPPORT | 172 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 121 // Define list of builtins used by the debugger implemented in assembly. | 173 // Define list of builtins used by the debugger implemented in assembly. |
| 122 #define BUILTIN_LIST_DEBUG_A(V) \ | 174 #define BUILTIN_LIST_DEBUG_A(V) \ |
| 123 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK) \ | 175 V(Return_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
| 124 V(ConstructCall_DebugBreak, BUILTIN, DEBUG_BREAK) \ | 176 Code::kNoExtraICState) \ |
| 125 V(StubNoRegisters_DebugBreak, BUILTIN, DEBUG_BREAK) \ | 177 V(ConstructCall_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
| 126 V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK) \ | 178 Code::kNoExtraICState) \ |
| 127 V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK) \ | 179 V(StubNoRegisters_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
| 128 V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK) \ | 180 Code::kNoExtraICState) \ |
| 129 V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK) \ | 181 V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK, \ |
| 130 V(Slot_DebugBreak, BUILTIN, DEBUG_BREAK) \ | 182 Code::kNoExtraICState) \ |
| 131 V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK) \ | 183 V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK, \ |
| 132 V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK) | 184 Code::kNoExtraICState) \ |
| 185 V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK, \ |
| 186 Code::kNoExtraICState) \ |
| 187 V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK, \ |
| 188 Code::kNoExtraICState) \ |
| 189 V(Slot_DebugBreak, BUILTIN, DEBUG_BREAK, \ |
| 190 Code::kNoExtraICState) \ |
| 191 V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK, \ |
| 192 Code::kNoExtraICState) \ |
| 193 V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK, \ |
| 194 Code::kNoExtraICState) |
| 133 #else | 195 #else |
| 134 #define BUILTIN_LIST_DEBUG_A(V) | 196 #define BUILTIN_LIST_DEBUG_A(V) |
| 135 #endif | 197 #endif |
| 136 | 198 |
| 137 // Define list of builtins implemented in JavaScript. | 199 // Define list of builtins implemented in JavaScript. |
| 138 #define BUILTINS_LIST_JS(V) \ | 200 #define BUILTINS_LIST_JS(V) \ |
| 139 V(EQUALS, 1) \ | 201 V(EQUALS, 1) \ |
| 140 V(STRICT_EQUALS, 1) \ | 202 V(STRICT_EQUALS, 1) \ |
| 141 V(COMPARE, 2) \ | 203 V(COMPARE, 2) \ |
| 142 V(ADD, 1) \ | 204 V(ADD, 1) \ |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 static void TearDown(); | 241 static void TearDown(); |
| 180 | 242 |
| 181 // Garbage collection support. | 243 // Garbage collection support. |
| 182 static void IterateBuiltins(ObjectVisitor* v); | 244 static void IterateBuiltins(ObjectVisitor* v); |
| 183 | 245 |
| 184 // Disassembler support. | 246 // Disassembler support. |
| 185 static const char* Lookup(byte* pc); | 247 static const char* Lookup(byte* pc); |
| 186 | 248 |
| 187 enum Name { | 249 enum Name { |
| 188 #define DEF_ENUM_C(name, ignore) name, | 250 #define DEF_ENUM_C(name, ignore) name, |
| 189 #define DEF_ENUM_A(name, kind, state) name, | 251 #define DEF_ENUM_A(name, kind, state, extra) name, |
| 190 BUILTIN_LIST_C(DEF_ENUM_C) | 252 BUILTIN_LIST_C(DEF_ENUM_C) |
| 191 BUILTIN_LIST_A(DEF_ENUM_A) | 253 BUILTIN_LIST_A(DEF_ENUM_A) |
| 192 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) | 254 BUILTIN_LIST_DEBUG_A(DEF_ENUM_A) |
| 193 #undef DEF_ENUM_C | 255 #undef DEF_ENUM_C |
| 194 #undef DEF_ENUM_A | 256 #undef DEF_ENUM_A |
| 195 builtin_count | 257 builtin_count |
| 196 }; | 258 }; |
| 197 | 259 |
| 198 enum CFunctionId { | 260 enum CFunctionId { |
| 199 #define DEF_ENUM_C(name, ignore) c_##name, | 261 #define DEF_ENUM_C(name, ignore) c_##name, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 static void Generate_ArrayConstructCode(MacroAssembler* masm); | 325 static void Generate_ArrayConstructCode(MacroAssembler* masm); |
| 264 | 326 |
| 265 static void Generate_StringConstructCode(MacroAssembler* masm); | 327 static void Generate_StringConstructCode(MacroAssembler* masm); |
| 266 | 328 |
| 267 static void Generate_OnStackReplacement(MacroAssembler* masm); | 329 static void Generate_OnStackReplacement(MacroAssembler* masm); |
| 268 }; | 330 }; |
| 269 | 331 |
| 270 } } // namespace v8::internal | 332 } } // namespace v8::internal |
| 271 | 333 |
| 272 #endif // V8_BUILTINS_H_ | 334 #endif // V8_BUILTINS_H_ |
| OLD | NEW |