Chromium Code Reviews| 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2320 | 2320 |
| 2321 assembler->Bind(&if_valueisundetectable); | 2321 assembler->Bind(&if_valueisundetectable); |
| 2322 assembler->Return(assembler->BooleanConstant(false)); | 2322 assembler->Return(assembler->BooleanConstant(false)); |
| 2323 | 2323 |
| 2324 assembler->Bind(&if_valueisnotundetectable); | 2324 assembler->Bind(&if_valueisnotundetectable); |
| 2325 assembler->Return(assembler->BooleanConstant(true)); | 2325 assembler->Return(assembler->BooleanConstant(true)); |
| 2326 } | 2326 } |
| 2327 } | 2327 } |
| 2328 } | 2328 } |
| 2329 | 2329 |
| 2330 void LoadIndexedInterceptorStub::GenerateAssembly( | |
| 2331 compiler::CodeStubAssembler* assembler) const { | |
| 2332 typedef compiler::Node Node; | |
| 2333 typedef compiler::CodeStubAssembler::Label Label; | |
| 2334 Node* receiver = assembler->Parameter(0); | |
| 2335 Node* key = assembler->Parameter(1); | |
| 2336 Node* slot = assembler->Parameter(2); | |
| 2337 Node* vector = assembler->Parameter(3); | |
| 2338 Node* context = assembler->Parameter(4); | |
| 2339 | |
| 2340 Label if_keyissmi(assembler), if_keyisnotsmi(assembler); | |
| 2341 assembler->Branch(assembler->WordIsSmi(key), &if_keyissmi, &if_keyisnotsmi); | |
| 2342 assembler->Bind(&if_keyissmi); | |
| 2343 { | |
| 2344 Label if_keyvalid(assembler), if_keyinvalid(assembler); | |
| 2345 assembler->BranchIfSmiLessThan(key, assembler->Int32Constant(0), | |
|
Benedikt Meurer
2016/03/21 09:36:56
Nit: SmiConstant(0)
| |
| 2346 &if_keyvalid, &if_keyinvalid); | |
| 2347 assembler->Bind(&if_keyvalid); | |
| 2348 { | |
| 2349 assembler->TailCallRuntime(Runtime::kLoadElementWithInterceptor, context, | |
| 2350 receiver, key); | |
| 2351 } | |
| 2352 | |
| 2353 assembler->Bind(&if_keyinvalid); | |
| 2354 assembler->TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, | |
| 2355 key, slot, vector); | |
| 2356 } | |
| 2357 assembler->Bind(&if_keyisnotsmi); | |
| 2358 assembler->TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, key, | |
|
Benedikt Meurer
2016/03/21 09:36:56
Nit: Add a merge Label and Goto to it from both ca
| |
| 2359 slot, vector); | |
| 2360 } | |
| 2361 | |
| 2330 void StoreInterceptorStub::GenerateAssembly( | 2362 void StoreInterceptorStub::GenerateAssembly( |
| 2331 compiler::CodeStubAssembler* assembler) const { | 2363 compiler::CodeStubAssembler* assembler) const { |
| 2332 typedef compiler::Node Node; | 2364 typedef compiler::Node Node; |
| 2333 Node* receiver = assembler->Parameter(0); | 2365 Node* receiver = assembler->Parameter(0); |
| 2334 Node* name = assembler->Parameter(1); | 2366 Node* name = assembler->Parameter(1); |
| 2335 Node* value = assembler->Parameter(2); | 2367 Node* value = assembler->Parameter(2); |
| 2336 Node* context = assembler->Parameter(3); | 2368 Node* context = assembler->Parameter(3); |
| 2337 assembler->TailCallRuntime(Runtime::kStorePropertyWithInterceptor, context, | 2369 assembler->TailCallRuntime(Runtime::kStorePropertyWithInterceptor, context, |
| 2338 receiver, name, value); | 2370 receiver, name, value); |
| 2339 } | 2371 } |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2766 if (type->Is(Type::UntaggedPointer())) { | 2798 if (type->Is(Type::UntaggedPointer())) { |
| 2767 return Representation::External(); | 2799 return Representation::External(); |
| 2768 } | 2800 } |
| 2769 | 2801 |
| 2770 DCHECK(!type->Is(Type::Untagged())); | 2802 DCHECK(!type->Is(Type::Untagged())); |
| 2771 return Representation::Tagged(); | 2803 return Representation::Tagged(); |
| 2772 } | 2804 } |
| 2773 | 2805 |
| 2774 } // namespace internal | 2806 } // namespace internal |
| 2775 } // namespace v8 | 2807 } // namespace v8 |
| OLD | NEW |