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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 DescriptorArray* descriptors = transition->instance_descriptors(); | 333 DescriptorArray* descriptors = transition->instance_descriptors(); |
334 PropertyDetails details = descriptors->GetDetails(descriptor); | 334 PropertyDetails details = descriptors->GetDetails(descriptor); |
335 Representation representation = details.representation(); | 335 Representation representation = details.representation(); |
336 DCHECK(!representation.IsNone()); | 336 DCHECK(!representation.IsNone()); |
337 | 337 |
338 // Stub is never generated for objects that require access checks. | 338 // Stub is never generated for objects that require access checks. |
339 DCHECK(!transition->is_access_check_needed()); | 339 DCHECK(!transition->is_access_check_needed()); |
340 | 340 |
341 // Call to respective StoreTransitionStub. | 341 // Call to respective StoreTransitionStub. |
342 if (details.type() == CONSTANT) { | 342 if (details.type() == CONSTANT) { |
| 343 GenerateConstantCheck(descriptors->GetValue(descriptor), value(), &miss); |
| 344 |
343 GenerateRestoreMap(transition, scratch2(), &miss); | 345 GenerateRestoreMap(transition, scratch2(), &miss); |
344 DCHECK(descriptors->GetValue(descriptor)->IsJSFunction()); | |
345 Register map_reg = StoreTransitionDescriptor::MapRegister(); | |
346 GenerateConstantCheck(map_reg, descriptor, value(), scratch2(), &miss); | |
347 GenerateRestoreName(name); | 346 GenerateRestoreName(name); |
348 StoreTransitionStub stub(isolate()); | 347 StoreTransitionStub stub(isolate()); |
349 GenerateTailCall(masm(), stub.GetCode()); | 348 GenerateTailCall(masm(), stub.GetCode()); |
350 | 349 |
351 } else { | 350 } else { |
352 if (representation.IsHeapObject()) { | 351 if (representation.IsHeapObject()) { |
353 GenerateFieldTypeChecks(descriptors->GetFieldType(descriptor), value(), | 352 GenerateFieldTypeChecks(descriptors->GetFieldType(descriptor), value(), |
354 &miss); | 353 &miss); |
355 } | 354 } |
356 StoreTransitionStub::StoreMode store_mode = | 355 StoreTransitionStub::StoreMode store_mode = |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 DCHECK(elements_kind == DICTIONARY_ELEMENTS); | 435 DCHECK(elements_kind == DICTIONARY_ELEMENTS); |
437 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); | 436 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); |
438 } | 437 } |
439 } | 438 } |
440 | 439 |
441 handlers->Add(cached_stub); | 440 handlers->Add(cached_stub); |
442 } | 441 } |
443 } | 442 } |
444 } | 443 } |
445 } // namespace v8::internal | 444 } // namespace v8::internal |
OLD | NEW |