Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/runtime.cc

Issue 436653002: Correct a misuse of sizeof (introduced in r22709). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 15573 matching lines...) Expand 10 before | Expand all | Expand 10 after
15584 if (entry != kNotFound) { 15584 if (entry != kNotFound) {
15585 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry); 15585 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry);
15586 int function_index = Smi::cast(smi_index)->value(); 15586 int function_index = Smi::cast(smi_index)->value();
15587 return &(kIntrinsicFunctions[function_index]); 15587 return &(kIntrinsicFunctions[function_index]);
15588 } 15588 }
15589 return NULL; 15589 return NULL;
15590 } 15590 }
15591 15591
15592 15592
15593 const Runtime::Function* Runtime::FunctionForEntry(Address entry) { 15593 const Runtime::Function* Runtime::FunctionForEntry(Address entry) {
15594 for (size_t i = 0; i < sizeof(kIntrinsicFunctions); ++i) { 15594 size_t length = sizeof(kIntrinsicFunctions) / sizeof(*kIntrinsicFunctions);
15595 for (size_t i = 0; i < length; ++i) {
15595 if (entry == kIntrinsicFunctions[i].entry) { 15596 if (entry == kIntrinsicFunctions[i].entry) {
15596 return &(kIntrinsicFunctions[i]); 15597 return &(kIntrinsicFunctions[i]);
15597 } 15598 }
15598 } 15599 }
15599 return NULL; 15600 return NULL;
15600 } 15601 }
15601 15602
15602 15603
15603 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15604 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15604 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15605 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15605 } 15606 }
15606 15607
15607 } } // namespace v8::internal 15608 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698