OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/ic-inl.h" | 10 #include "src/ic/ic-inl.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 GenerateLoadCallback(reg, callback); | 226 GenerateLoadCallback(reg, callback); |
227 return GetCode(kind(), Code::FAST, name); | 227 return GetCode(kind(), Code::FAST, name); |
228 } | 228 } |
229 | 229 |
230 | 230 |
231 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( | 231 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback( |
232 Handle<Name> name, const CallOptimization& call_optimization) { | 232 Handle<Name> name, const CallOptimization& call_optimization) { |
233 DCHECK(call_optimization.is_simple_api_call()); | 233 DCHECK(call_optimization.is_simple_api_call()); |
234 Frontend(name); | 234 Frontend(name); |
235 Handle<Map> receiver_map = IC::TypeToMap(*type(), isolate()); | 235 Handle<Map> receiver_map = IC::TypeToMap(*type(), isolate()); |
236 GenerateFastApiCall(masm(), call_optimization, receiver_map, receiver(), | 236 GenerateApiAccessorCall(masm(), call_optimization, receiver_map, receiver(), |
237 scratch1(), false, 0, NULL); | 237 scratch1(), false, no_reg); |
238 return GetCode(kind(), Code::FAST, name); | 238 return GetCode(kind(), Code::FAST, name); |
239 } | 239 } |
240 | 240 |
241 | 241 |
242 void NamedLoadHandlerCompiler::InterceptorVectorSlotPush(Register holder_reg) { | 242 void NamedLoadHandlerCompiler::InterceptorVectorSlotPush(Register holder_reg) { |
243 if (IC::ICUseVector(kind())) { | 243 if (IC::ICUseVector(kind())) { |
244 if (holder_reg.is(receiver())) { | 244 if (holder_reg.is(receiver())) { |
245 PushVectorAndSlot(); | 245 PushVectorAndSlot(); |
246 } else { | 246 } else { |
247 DCHECK(holder_reg.is(scratch1())); | 247 DCHECK(holder_reg.is(scratch1())); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 GenerateStoreViaSetter(masm(), type(), receiver(), setter); | 446 GenerateStoreViaSetter(masm(), type(), receiver(), setter); |
447 | 447 |
448 return GetCode(kind(), Code::FAST, name); | 448 return GetCode(kind(), Code::FAST, name); |
449 } | 449 } |
450 | 450 |
451 | 451 |
452 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 452 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
453 Handle<JSObject> object, Handle<Name> name, | 453 Handle<JSObject> object, Handle<Name> name, |
454 const CallOptimization& call_optimization) { | 454 const CallOptimization& call_optimization) { |
455 Frontend(name); | 455 Frontend(name); |
456 Register values[] = {value()}; | 456 GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()), |
457 GenerateFastApiCall(masm(), call_optimization, handle(object->map()), | 457 receiver(), scratch1(), true, value()); |
458 receiver(), scratch1(), true, 1, values); | |
459 return GetCode(kind(), Code::FAST, name); | 458 return GetCode(kind(), Code::FAST, name); |
460 } | 459 } |
461 | 460 |
462 | 461 |
463 #undef __ | 462 #undef __ |
464 | 463 |
465 | 464 |
466 void ElementHandlerCompiler::CompileElementHandlers( | 465 void ElementHandlerCompiler::CompileElementHandlers( |
467 MapHandleList* receiver_maps, CodeHandleList* handlers) { | 466 MapHandleList* receiver_maps, CodeHandleList* handlers) { |
468 for (int i = 0; i < receiver_maps->length(); ++i) { | 467 for (int i = 0; i < receiver_maps->length(); ++i) { |
(...skipping 20 matching lines...) Expand all Loading... |
489 DCHECK(elements_kind == DICTIONARY_ELEMENTS); | 488 DCHECK(elements_kind == DICTIONARY_ELEMENTS); |
490 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); | 489 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); |
491 } | 490 } |
492 } | 491 } |
493 | 492 |
494 handlers->Add(cached_stub); | 493 handlers->Add(cached_stub); |
495 } | 494 } |
496 } | 495 } |
497 } | 496 } |
498 } // namespace v8::internal | 497 } // namespace v8::internal |
OLD | NEW |