| 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 #include "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
| 6 #include "src/code-events.h" | 6 #include "src/code-events.h" |
| 7 #include "src/code-stub-assembler.h" | 7 #include "src/code-stub-assembler.h" |
| 8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
| 9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 builtins_[index++] = code; | 141 builtins_[index++] = code; |
| 142 #define BUILD_ASM(Name) \ | 142 #define BUILD_ASM(Name) \ |
| 143 code = \ | 143 code = \ |
| 144 BuildWithMacroAssembler(isolate, Generate_##Name, kBuiltinFlags, #Name); \ | 144 BuildWithMacroAssembler(isolate, Generate_##Name, kBuiltinFlags, #Name); \ |
| 145 builtins_[index++] = code; | 145 builtins_[index++] = code; |
| 146 #define BUILD_ASH(Name, Kind, Extra) \ | 146 #define BUILD_ASH(Name, Kind, Extra) \ |
| 147 code = BuildWithMacroAssembler( \ | 147 code = BuildWithMacroAssembler( \ |
| 148 isolate, Generate_##Name, Code::ComputeFlags(Code::Kind, Extra), #Name); \ | 148 isolate, Generate_##Name, Code::ComputeFlags(Code::Kind, Extra), #Name); \ |
| 149 builtins_[index++] = code; | 149 builtins_[index++] = code; |
| 150 | 150 |
| 151 BUILTIN_LIST(BUILD_CPP, BUILD_API, BUILD_TFJ, BUILD_TFS, BUILD_ASM, | 151 BUILTIN_LIST(BUILD_CPP, BUILD_API, BUILD_TFJ, BUILD_TFS, BUILD_TFS, |
| 152 BUILD_ASH, BUILD_ASM); | 152 BUILD_ASM, BUILD_ASH, BUILD_ASM); |
| 153 | 153 |
| 154 #undef BUILD_CPP | 154 #undef BUILD_CPP |
| 155 #undef BUILD_API | 155 #undef BUILD_API |
| 156 #undef BUILD_TFJ | 156 #undef BUILD_TFJ |
| 157 #undef BUILD_TFS | 157 #undef BUILD_TFS |
| 158 #undef BUILD_ASM | 158 #undef BUILD_ASM |
| 159 #undef BUILD_ASH | 159 #undef BUILD_ASH |
| 160 CHECK_EQ(builtin_count, index); | 160 CHECK_EQ(builtin_count, index); |
| 161 for (int i = 0; i < builtin_count; i++) { | 161 for (int i = 0; i < builtin_count; i++) { |
| 162 Code::cast(builtins_[i])->set_builtin_index(i); | 162 Code::cast(builtins_[i])->set_builtin_index(i); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 // static | 217 // static |
| 218 bool Builtins::IsCpp(int index) { | 218 bool Builtins::IsCpp(int index) { |
| 219 DCHECK(0 <= index && index < builtin_count); | 219 DCHECK(0 <= index && index < builtin_count); |
| 220 switch (index) { | 220 switch (index) { |
| 221 #define CASE(Name, ...) \ | 221 #define CASE(Name, ...) \ |
| 222 case k##Name: \ | 222 case k##Name: \ |
| 223 return true; | 223 return true; |
| 224 #define BUILTIN_LIST_CPP(V) \ | 224 #define BUILTIN_LIST_CPP(V) \ |
| 225 BUILTIN_LIST(V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 225 BUILTIN_LIST(V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
| 226 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) | 226 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 227 BUILTIN_LIST_CPP(CASE) | 227 BUILTIN_LIST_CPP(CASE) |
| 228 #undef BUILTIN_LIST_CPP | 228 #undef BUILTIN_LIST_CPP |
| 229 #undef CASE | 229 #undef CASE |
| 230 default: | 230 default: |
| 231 return false; | 231 return false; |
| 232 } | 232 } |
| 233 UNREACHABLE(); | 233 UNREACHABLE(); |
| 234 } | 234 } |
| 235 | 235 |
| 236 // static | 236 // static |
| 237 bool Builtins::IsApi(int index) { | 237 bool Builtins::IsApi(int index) { |
| 238 DCHECK(0 <= index && index < builtin_count); | 238 DCHECK(0 <= index && index < builtin_count); |
| 239 switch (index) { | 239 switch (index) { |
| 240 #define CASE(Name, ...) \ | 240 #define CASE(Name, ...) \ |
| 241 case k##Name: \ | 241 case k##Name: \ |
| 242 return true; | 242 return true; |
| 243 #define BUILTIN_LIST_API(V) \ | 243 #define BUILTIN_LIST_API(V) \ |
| 244 BUILTIN_LIST(IGNORE_BUILTIN, V, IGNORE_BUILTIN, IGNORE_BUILTIN, \ | 244 BUILTIN_LIST(IGNORE_BUILTIN, V, IGNORE_BUILTIN, IGNORE_BUILTIN, \ |
| 245 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) | 245 IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN) |
| 246 BUILTIN_LIST_API(CASE); | 246 BUILTIN_LIST_API(CASE); |
| 247 #undef BUILTIN_LIST_API | 247 #undef BUILTIN_LIST_API |
| 248 #undef CASE | 248 #undef CASE |
| 249 default: | 249 default: |
| 250 return false; | 250 return false; |
| 251 } | 251 } |
| 252 UNREACHABLE(); | 252 UNREACHABLE(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 // static | 255 // static |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 if (responsible_context.is_null()) { | 287 if (responsible_context.is_null()) { |
| 288 return true; | 288 return true; |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 if (*responsible_context == target->context()) return true; | 291 if (*responsible_context == target->context()) return true; |
| 292 return isolate->MayAccess(responsible_context, target_global_proxy); | 292 return isolate->MayAccess(responsible_context, target_global_proxy); |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace internal | 295 } // namespace internal |
| 296 } // namespace v8 | 296 } // namespace v8 |
| OLD | NEW |